用友U9系统客开常用代码_第1页
用友U9系统客开常用代码_第2页
用友U9系统客开常用代码_第3页
用友U9系统客开常用代码_第4页
用友U9系统客开常用代码_第5页
已阅读5页,还剩62页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

PAGE2页U9脚本大全PO终止,后台改状态脚本updatePM_POLinesetCancel_Canceled=0,Cancel_CancelDate=null,Cancel_CancelUser=null,Cancel_CancelReason=nullwherePurchaseOrderin(selectIDfromPM_PurchaseOrderwhereDocNo='564191')updatePM_POShipLinesetCancel_Canceled=0,Cancel_CancelDate=null,Cancel_CancelUser=null,Cancel_CancelReason=nullwherePOLinein(selectIDfromPM_POLinewherePurchaseOrderin(selectIDfromPM_PurchaseOrderwhereDocNo='564191'))updatePM_PurchaseOrdersetCancel_Canceled=0,Cancel_CancelDate=null,Cancel_CancelUser=null,Cancel_CancelReason=nullwhereDocNo='564191'改系统启用状态的脚本updateUBF_SM_AppStatesetIsEnabled=0,EnableDate=null,EnableUser=nullwhereID=1001910293209585查用户操作记录select*fromUBF_Portal_OperationRecordwhereOccurrenceTime>='2014-01-0412:25:30'andOccurrenceTime<'2014-01-0412:55:57'库存在手量更新execP_InvTrans_WhQohRebuild'','1002305137407081'料品ID,空表示全部账簿科目失效updateCBO_NaturalAccountSOBPropertysetEffective_IsEffective=0whereOrgin(selectIDfromBase_OrganizationwhereCode='015')取堆位计划数据到过磅系统中间表selectOrgCode,ShipmentNo,LWPO,a.CabinetNo,c.Code,a.DescFlexSegments_PrivateDescSeg1,d.NamefromLM_HeapBitPlanLineajoinLM_HeapBitPlanbona.HeapBitPlan=b.IDleftjoinCBO_Bincona.Bin=c.IDleftjoin(selectEValue,NamefromUBF_Sys_ExtEnumValuexjoinUBF_Sys_ExtEnumValue_Trlyonx.ID=y.IDwhereExtEnumTypeUIDin(selectUIDfromubf_sys_extenumtypewhereCode='UFIDA.U9.Cust.LM.Lit.UserPubLicBE.DisLocalEnum'))dona.DisLocalEnum=d.EValuewhereb.Org=1002106211219055andb.DocStatusEnum=2anda.PlanStatusEnumin(0,2)anda.Binisnotnullanda.CabinetNoin('')INSERTINTOU9_LOC_Interface(cmpNo,SHIPMENT_NO,PO_NO,CNTR_NO,LOC_NO,Machine_NO,CreateBy,CreateDate,unloadplate)VALUES('971','IJX1314626','34470130','CCLU7372378','0203D','28車間','Tolly','2014-02-12','1#卸貨臺')--更新实体类型值集值updateBase_ValueSetDefsetEntityType=1002703219891445,CodeAttribute=1002703219891453,NameAttribute=1002703219891454whereCode='ItemSpec'--更新枚举类型值集值updateBase_ValueSetDefsetEnumType=1002312283452368whereCode='TCEnum'--selectEntityType,CodeAttribute,*fromBase_ValueSetDefwhereCode='ItemSpec'查找实体或枚举对应的IDselectID,*fromUBF_MD_ClasswhereFullNamelike'%ItemSpec'orderbyCreateTimedesc查找实体下字段的IDselectName,*fromUBF_MD_AttributewhereMD_Class_ID='4FFBABAD-32EC-477C-963F-3AD6139427A9'凭证签字加内账连接串insertintoGD_CUST_IQCParametervalues(1002706044798845,getdate(),'Tolly',getdate(),'Tolly',0,'neizhangIP','19:MRPRW:^M2dmin','leemanpaper',1002705253515024)查死锁select*fromsys.sysprocesseswhereblocked<>0select*fromsys.sysprocessesorderbywaitresource查报表词条及对应报表名selectcValue,c.cName,c.cDescriptionfromUBF_MD_ASRPT_ReportTemplate_langajoinUBF_MD_ASRPT_CategoryconA.uReportID=c.IDwherea.cKey+convert(nvarchar(500),a.uReportID)in(selectcKey+convert(nvarchar(500),uReportID)from(selectcKey,uReportID,count(*)numfromUBF_MD_ASRPT_ReportTemplate_langgroupbycKey,uReportID)aawherenum=1)anda.cCulture='zh-CN'查U9页面、菜单词条selectr.DisplayName,t.DisplayNamefromUBF_RES_ResourceValuerjoinUBF_MD_UIRComponentuonr.ComponentID=u.UIDjoinUBF_MD_UIRComponent_trltonu.ID=t.IDandt.SysMLFlag='zh-CN'where1=1andr.[Type]notin('BEEntityStereotype','BEEventAttribute','BPEvent','BEAutoEvent','BPEventAttribute','BPOperationAttribute','BPOperationImplementsOperation','SvrOperationAttribute','SvrOperationImplementsOperation','SvrExceptionAttribute','BPExceptionAttribute','BEExceptionAttribute','BEException','BPException','SvrException','Uimcomponent','DicComponent')andr.ComponentIDin(selectdistinctIDfromUBF_MD_ComponentwhereAssemblyNamelike'%Cust.%'orAssemblyNamelike'%LM%'unionallselectdistinctUIDfromUBF_MD_UIFormwhereAssemblyNamelike'%Cust.%'orAssemblyNamelike'%LM%'unionallselectdistinctm.UIDfromUBF_MD_UIModelmjoinUBF_MD_UIComponentconm.UIComponent=c.IDwherec.AssemblyNamelikeorc.AssemblyNamelike'%LM%'unionallselectdistinctUIDfromUBF_MD_UIRComponentwhereURIlike'%Cust.%'orURIlike'%LM%')更新收货单立账方式(凭单制、非凭单制)updatePM_RcvLinesetConfirmMode=0wherereceivementin(selectidfromPM_Receivementwhereorg=1002705221521670andStatus=0)Postback支持的事件UFDateGridEventName.OnCellFocusEnter越南收货报“未将对象*****”select*DELETEfromLM_IQC_RcvDoc_RcvIqcRelwhereRcvDocin(selectIDfromPM_Receivementwheredocno='YNMZ16020052')andRcvLinenotin(selectIDfromPM_RcvLinewherereceivementin(selectIDfromPM_Receivementwheredocno='YNMZ16020052'))审批中单据改为开立updateCBO_ItemCodeApplyDocsetDocState=0,WFCurrentState=-1,WFOriginalState=-1wheredocnoin('REQ028968','REQ028975','REQ028976','REQ028977','REQ028978','REQ028979','REQ028980','REQ028981','REQ028982','REQ028983','REQ028984','REQ028985','REQ028986','REQ028987','REQ028988','REQ028989','REQ028991','REQ028992','REQ028993')结算单未生单,改未生单状态selectDescFlexField_PrivateDescSeg27,*fromKK_SettlementCoalwheredocnolike'%GLM201605009%'updateKK_SettlementCoalsetDescFlexField_PrivateDescSeg27=''wheredocnolike'%GLM201605009%'deletefromKK_SettlementLinkAllDocwhereDocType='andSettlementCoal=1003308310578339没有分录处理updateKK_SettlementCoalsetstatus=2wheredocnolike'%GLM201604008_02%'execp_GetNewDocData1003304188593934,'领用和在途',0,'','',''转售查询selectdistinctC.lm_po_no,A.shipment_no,A.po_no,A.U9_po_no,sum_Weight,sum_No,Is_Transfer_Factory,Transfer_Customer_Id,contract_customer_id,B.Is_Transfe_Fator,caswhenTerms_Of_Trad'T'thenelseendasTerms_Of_Trad,C.o_Nasfactory_Po,iniceno,nvoce_ateinviceamont,customs_clear_dteasu9_grn_date,b.transfer_datefrom(selectshipment_no,po_no,prod_id,U9_po_no,sum(net_weight)sum_Weight,sum(no_of_bales)sum_Nofromu9_shipment_po_cntr_dtlwherecompany_id=75andRoll_over_flag='N'and(u9_trans_flagisnulloru9_trans_flag=''oru9_trans_flag='N')groupbyshipment_no,po_no,prod_id,U9_po_no)Ainnerjoinu9_inland_track_hdrBonA.shipment_no=B.Shipment_Noinnerjoinu9_po_hdrConA.po_no=C.Po_NoinnerjoinAcct_ArDonD.Company_Id=B.Company_IdandD.so_no=C.So_NoandA.shipment_no=D.Shipment_NowhereB.company_id='75'andIs_Transfer_Factory='Y'andnvl(Transfer_Customer_Id,'')<>860andcontract_customer_id=860ANDinvoice_date>ADD_MONTHS(SYSDATE,-6)--anda.shipment_no='IDG1607375'国废批量采购超交期审不了declare@FlowInstancebigint,@BatchPObigint,@BatchPOLinebigint--查询批量采购订单信息select@FlowInstance=a.FlowInstance,@BatchPO=a.id,@BatchPOLine=c.IDfromCust_LM_Waste_BatchPOainnerjoinCust_LM_Waste_BatchPOSupplierbona.id=b.bathpoinnerjoinCust_LM_Waste_BatchPOLineconb.id=c.BathPOSupplierwherea.docno='CPPG17010296'--修改审批流状态设为开立修改交期updateCust_LM_Waste_BatchPOsetStatus=0,WFCurrentState=-1,WFOriginalState=-1whereid=@BatchPO--删除流程实例信息deleteCS_Workflow_FlowInstancewhereid=@FlowInstancedeleteCS_Workflow_FlowInstance_trlwhereid=@FlowInstancePAGE3页 BE 2010年2月4日 20:57赋默认组织2010年2月4日20:17赋默认组织2010年2月4日20:17PAGE4页///<summary>///设置默认值///</summary>protectedoverridevoidOnSetDefaultValue(){base.OnSetDefaultValue();if(this.Org==null){this.Org=UFIDA.U9.Base.Context.LoginOrg;}}获取上下文企业信息2014年7月8日8:56获取上下文企业信息2014年7月8日8:56PAGE5页UFSoft.UBF.Util.Context.PlatformContext.Current.EnterpriseIDUFSoft.UBF.Util.Context.PlatformContext.Current.EnterpriseName验证有效性2010年2月4日20:40验证有效性2010年2月4日20:40PAGE6页///<summary>///验证有效性///</summary>privatevoidEffectiveValidator(){//地区if(!this.Area.Effective.GetIsEffective(UFIDA.U9.Base.Context.LoginDate))thrownewException("地区档案'"+this.Area.Name+"'已失效");}获取枚举中文名2010年2月5日17:28获取枚举中文名2010年2月5日17:28PAGE7页VehicleTypeEnum.EnumRes.GetResource(this.VehicleType.Name)));单据删除校验2010年2月5日21:45单据删除校验2010年2月5日21:45PAGE8页///<summary>///beforeDelete///</summary>protectedoverridevoidOnDeleting(){base.OnDeleting();//删除校验if(this.DocStatus==DocStatusEnum.Approving||this.DocStatus==DocStatusEnum.Approved||this.IsWeightingHold){thrownewException("当前单据已审核或已挂起,不允许删除!");}}PAGE9页 BP 2010年2月4日 20:58简单例子2010年2月4日简单例子2010年2月4日20:50PAGE10页publicoverrideobjectDo(objectobj){GetItembpObj=(GetItem)obj;if(bpObj==null)returnnull;if(bpObj.ItemKey<0)returnnull;if(bpObj.OrgID<=0)thrownewException("调用BP时未传入Org参数");ItemMasteritemMaster=ItemMaster.Finder.Find("Org=@OrgandID=@IDandEffective.IsEffective=1andEffective.EffectiveDate<=@DateTimeNowandEffective.DisableDate>=@DateTimeNow",newOqlParam[]{newOqlParam("Org",bpObj.OrgID),newOqlParam("ID",bpObj.ItemKey),newOqlParam("DateTimeNow",UFIDA.U9.Base.Context.LoginDate)});if(itemMaster==null)returnnull;ItemDTOItemDTOData=newItemDTO();ItemDTOData.ItemID=itemMaster.ID;ItemDTOData.ItemCode=itemMaster.Code;ItemDTOData.ItemName=itemMaster.Name;ItemDTOData.PriceUOMID=itemMaster.PriceUOM.ID;ItemDTOData.PriceUOMCode=itemMaster.PriceUOM.Code;ItemDTOData.PriceUOMName=itemMaster.PriceUOM.Name;ItemDTOData.PriceUOMPrecision=itemMaster.PriceUOM.Round.Precision;ItemDTOData.PriceUOMRoundType=itemMaster.PriceUOM.Round.RoundType;ItemDTOData.PriceUOMRoundValue=itemMaster.PriceUOM.Round.RoundValue;ItemDTOData.RefrenceCost=itemMaster.RefrenceCost;returnItemDTOData;}获取枚举项2010年2月4日20:44获取枚举项2010年2月4日20:44PAGE11页publicoverrideobjectDo(objectobj){GetEnumExtValueInfobpObj=(GetEnumExtValueInfo)obj;if(bpObj==null)returnnull;ExtEnumTypeenumType=ExtEnumType.Finder.Find("Code=@Code",newOqlParam("Code",bpObj.EnumFullName));if(enumType==null)returnnull;List<EnumExtValueInfoDTO>enumValueDTOs=newList<EnumExtValueInfoDTO>();EnumExtValueInfoDTOenumValueDTO=null;foreach(ExtEnumValueenumValueinenumType.ExtEnumValues){enumValueDTO=newEnumExtValueInfoDTO();enumValueDTO.Code=enumValue.Code;enumValueDTO.Name=enumValue.Name;enumValueDTO.Value=enumValue.EValue;enumValueDTOs.Add(enumValueDTO);}returnenumValueDTOs;}获取系统参数2010年2月4日20:54获取系统参数2010年2月4日20:54PAGE12页privatestringGetProfileValue(stringprofileCode){stringprofileValue="";GetProfileValueProxygetProfileValueProxy=newGetProfileValueProxy();getProfileValueProxy.ProfileCode=profileCode;getProfileValueProxy.ProfileOrg=OrgID;PVDTODatapVDTOData=newPVDTOData();pVDTOData=getProfileValueProxy.Do();if(pVDTOData!=null&&pVDTOData.ProfileValue.Trim().Length!=0){profileValue=pVDTOData.ProfileValue;}returnprofileValue;}Session事务2010年2月5日Session事务2010年2月5日21:48PAGE13页publicoverrideobjectDo(objectobj){CreateWeightingbpObj=(CreateWeighting)obj;Weightingweighting=bpObj.Weighting;weighting.Status=UFIDA.U9.Cust.TY.AM.CBO.PubBE.EnumDef.DocStatusEnum.Opened;using(ISessionsession=Session.Open()){session.Create(weighting);session.Commit();}returnnull;}提交&审核提交&审核&弃审2010年2月6日10:54PAGE14页publicoverrideobjectDo(objectobj){AllowanceApprovebpObj=(AllowanceApprove)obj;if(bpObj==null||bpObj.DocKey==null)returnnull;AllowanceMaterialallowanceMaterialDoc=bpObj.DocKey.GetEntity();if(allowanceMaterialDoc==null){thrownewDataDeletedException(AllowanceMaterial.EntityRes.GetResource(AllowanceMaterial.EntityRes.BE_FullName));}if((bpObj.UISysversion.Trim()!=string.Empty)&&(allowanceMaterialDoc.SysVersion.ToString()!=bpObj.UISysversion.Trim())){thrownewDataModifiedException(AllowanceMaterial.EntityRes.GetResource(AllowanceMaterial.EntityRes.BE_FullName));}if(bpObj.OperationType==0){//提交using(Sessions=Session.Open()){SubmitEvent());s.InList(allowanceMaterialDoc);s.Commit();}}elseif(bpObj.OperationType==1){//审核using(Sessions=Session.Open()){ApprovalResultEvent());s.InList(allowanceMaterialDoc);s.Commit();}}elseif(bpObj.OperationType==2){//弃审using(Sessions=Session.Open()){allowanceMaterialDoc.DocStatus=DocStatusEnum.Opened;allowanceMaterialDoc.WFCurrentState=1;allowanceMaterialDoc.WFOriginalState=0;s.Modify(allowanceMaterialDoc);s.Commit();}PAGE15页}returnnull;}PAGE16页 UI 2010年2月4日 20:59清除错误提示信息清除错误提示信息PAGE17页2012年10月10日 16:19this.Model.ClearErrorMessage();//清除错误提示信息修改参加弹出界面修改参加弹出界面PAGE18页2010年5月17日 10:49//弹出界面this.Countyside28.RefType="6642b63d-4ca9-4f6b-9c3e-32fb46a27ed5";//向导选择页面IDthis.Countyside28.RefHeight=408;//504;408this.Countyside28.RefWidth=580;//992;580this.Countyside28.AutoPostBack=true;赋默认值2010年2月5日赋默认值2010年2月5日14:48PAGE19页UI->Model://初始化UIMODELAfterInitModel(){this.viewRegion.FieldCodeRule.DefaultValue="1-2-2-2-2";//this.Views[0].Fields[0].DefaultValue=thsi.co//生效日期this.viewRegion.FieldEffective_EffectiveDate.DefaultValue=DateTime.Now;//多组织数据过滤this.Region.CurrentFilter.OPath="Org="+PDContext.Current.OrgID;}弹出页面返回刷新2010年4月8日9:12弹出页面返回刷新2010年4月8日9:12PAGE20页longid=long.Parse(Part.Action.CurrentModel.Views["MO"].FocusedRecord["ID"].ToString());NaviteParamterparamter=newNaviteParamter();paramter.NameValues.Add("PDPageStatus","Browse");paramter.NameValues.Add("ID",id.ToString());UFIDA.U9.UI.PDHelper.NavigateManager.NavigatePage(Part,"MFG.MO.DiscreteMO.DiscreteMO",paramter);列表导航2010年2月5日列表导航2010年2月5日13:44PAGE21页方法1、UI->WebPart://BtnList_Click...privatevoidBtnList_Click_Extend(objectsender,EventArgse){//调用模版提供的默认实现.--默认实现可能会调用相应的Action.this.Action.CommonAction.CurrentPart.NavigatePage("Cust.TY.AM.CBO.TrafficPointPairListUrl",null);BtnList_Click_DefaultImpl(sender,e);}方法2、UI->Action:privatevoidListClick_Extend(objectsender,UIActionEventArgse){//ListClickCodeDemo...//this.CurrentPart.NavigatePage("TestList",null);//this.ListClick_DefaultImpl(sender,e);this.CurrentPart.NavigatePage("Cust.TY.AM.CBO.TrafficPointPairListUrl",null);//调用模版定义的默认实现方法.如需扩展,请直接在此编程.this.ListClick_DefaultImpl(sender,e);}查找导航2010年2月5日查找导航2010年2月5日15:10PAGE22页//BtnFind_Click...privatevoidBtnFind_Click_Extend(objectsender,EventArgse){//调用模版提供的默认实现.--默认实现可能会调用相应的Action.this.Action.NavigateAction.MovePageAt(null,long.Parse(this.wpFindID.Value));BtnFind_Click_DefaultImpl(sender,e);}publicvoidAfterCreateChildControls(){//取得当前卡片参照的属性变量:FormID、Width、Height、Title;//传递隐藏域wpFindID的客户端ID;注意:隐藏域wpFindID会记录参照选择的记录ID;UFIDA.U9.UI.PDHelper.PDFormMessage.ShowConfirmDialog(this.Page,"79b90133-e246-4ada-aad6-04923c33650c","580","408",Title,wpFindID.ClientID,this.BtnFind,null);}删除确认提示2010年2月5日15:13删除确认提示2010年2月5日15:13PAGE23页publicvoidAfterCreateChildControls(){//取得提示信息资源:是否删除当前记录stringmessage=UFIDA.U9.UI.PDHelper.PDResource.GetDeleteConfirmInfo();//绑定注册弹出对话框到删除按钮UFIDA.U9.UI.PDHelper.PDFormMessage.ShowDelConfirmDialog(this.Page,message,"",this.BtnDelete);}启用页面个性化2010年2月5日15:17启用页面个性化2010年2月5日15:17PAGE24页publicvoidAfterCreateChildControls(){//启用页面个性化UFIDA.U9.UI.PDHelper.PersonalizationHelper.SetPersonalizationEnable(this,true);}设定弹性域2010年2月5日15:20设定弹性域2010年2月5日15:20PAGE25页publicvoidAfterCreateChildControls(){//设定弹性域FlexFieldHelper.SetDescFlexField(newDescFlexFieldParameter[]{newDescFlexFieldParameter(this.FlexFieldPicker0,this.Model.Planter)});}可扩展枚举Refresh2010年2月5日15:23可扩展枚举Refresh2010年2月5日15:23PAGE26页publicvoidAfterCreateChildControls(){//道路状况可扩展枚举UDC.Refresh(this,this.lblRoadCondition74,this.RoadCondition74);//车辆类型可扩展枚举UDC.Refresh(this.DataGrid8,"VehicleType");UDC.Refresh(this.DataGrid7,"VehicleType");}表体行号设置2010年2月5日15:26表体行号设置2010年2月5日15:26PAGE27页publicvoidAfterCreateChildControls(){//行号设置GetProfileValueProxybpObj=newGetProfileValueProxy();bpObj.ProfileCode="SysLineNo";bpObj.ProfileOrg=long.Parse(PDContext.Current.OrgID);PVDTODatapVDTOData=bpObj.Do();TrafficPointPairUIFormWebPart.SetGridAutoNumber(this.DataGrid8,"RowNO",pVDTOData);TrafficPointPairUIFormWebPart.SetGridAutoNumber(this.DataGrid7,"RowNO",pVDTOData);}publicstaticvoidSetGridAutoNumber(IUFDataGridgrid,StringcolName,PVDTODatapVDTOData){if(pVDTOData!=null){//初始步长为10intnStep=10;if(pVDTOData.ProfileValue!=null&&pVDTOData.ProfileValue.Length>0&&Int32.Parse(pVDTOData.ProfileValue)>0){nStep=Int32.Parse(pVDTOData.ProfileValue);}intcolIndex=GetIndexOfGrid(grid,colName);if(colIndex<0){thrownewException("GRID中不存在该列。");}((IAutoRowNo)grid.Columns[colIndex]).Sequence=true;((IAutoRowNo)grid.Columns[colIndex]).SequenceStep=nStep;((IAutoRowNo)grid.Columns[colIndex]).SequenceStart=nStep;}}privatestaticintGetIndexOfGrid(IUFDataGridgrid,stringcolName){intindex=0;for(inti=0;i<grid.Columns.Count;i++){if(grid.Columns[i].UIFieldID==colName){index=i;break;}}returnindex;}设置按钮状态2010年2月5日15:32设置按钮状态2010年2月5日15:32PAGE28页//BtnClose_Click...privatevoidBtnClose_Click_Extend(objectsender,EventArgse){//调用模版提供的默认实现.--默认实现可能会调用相应的Action.this.CloseDialog(false);BtnClose_Click_DefaultImpl(sender,e);}publicvoidAfterUIModelBinding(){//设置按钮状态if(UFIDA.U9.UI.PDHelper.NavigateManager.IsModelPopup(this)||UFIDA.U9.UI.PDHelper.NavigateManager.IsTitleLink(this)){this.BtnOk.Visible=true;this.BtnClose.Visible=true;this.BtnList.Enabled=false;}else{this.BtnOk.Visible=false;this.BtnClose.Visible=false;this.BtnList.Enabled=true;}//复制按钮this.BtnCopy.Enabled=(this.Model.TrafficPointPair.FocusedRecord!=null)&&((this.Model.TrafficPointPair.FocusedRecord.DataRecordState==DataRowState.Modified)||(this.Model.TrafficPointPair.FocusedRecord.DataRecordState==DataRowState.Unchanged));//删除按钮this.BtnDelete.Enabled=(this.Model.TrafficPointPair.FocusedRecord!=null)&&((this.Model.TrafficPointPair.FocusedRecord.DataRecordState==DataRowState.Modified)||(this.Model.TrafficPointPair.FocusedRecord.DataRecordState==DataRowState.Unchanged));}设置只读&Form引用禁用设置只读&Form引用禁用2010年2月5日17:10PAGE29页publicvoidAfterUIModelBinding(){//系统参数设置只读((UFSoft.UBF.UI.ControlModel.IUIFieldBindingDataBindControl)this.SugarcaneUom47).ReadOnly=true;((UFSoft.UBF.UI.ControlModel.IUIFieldBindingDataBindControl)this.DistanceUom53).ReadOnly=true;((UFSoft.UBF.UI.ControlModel.IUIFieldBindingDataBindControl)this.Currency59).ReadOnly=true;//所属组织设为只读((UFSoft.UBF.UI.ControlModel.IUIFieldBindingDataBindControl)this.StartTrafficPoint_PertainOrg1).ReadOnly=true;true;//Form引用设置禁用this.lblSugarcaneUom47.Enabled=false;this.lblDistanceUom53.Enabled=false;this.lblCurrency59.Enabled=false;this.DataGrid7.Columns["ItemUom"].Enabled=false;this.lblStartTrafficPoint_PertainOrg1.Enabled=false;this.lblDestinationTrafficPoint_PertainOrg0.Enabled=false;}移除枚举项2010年2月5日17:24移除枚举项2010年2月5日17:24PAGE30页publicvoidAfterUIModelBinding(){//Model中赋默认值--确认作业//确认方式枚举,去除“即时确认”项intEnumIndex=(int)ConfirmTypeEnumData.InTimeComfirm;this.ConfirmType41.Items.RemoveAt(EnumIndex);}BP调用BP调用2010年2月5日17:31PAGE31页privatevoidFuel43_TextChanged_Extend(objectsender,EventArgse){//调用模版提供的默认实现.--默认实现可能会调用相应的Action.longItemID=this.Model.FuelPrice.FocusedRecord.Fuel;if(ItemID>0){ItemDTODataitemDTOData=newItemDTOData();GetItemProxygetItemProxy=newGetItemProxy();getItemProxy.ItemKey=ItemID;getItemProxy.OrgID=long.Parse(PDContext.Current.OrgID);itemDTOData=getItemProxy.Do();//单价if(itemDTOData!=null){this.Model.FuelPrice.FocusedRecord.UnitPrice=itemDTOData.RefrenceCost;}else{this.Model.FuelPrice.FocusedRecord.UnitPrice=0;}}else{this.Model.FuelPrice.FocusedRecord.UnitPrice=0;}}参照过滤2010年2月5日参照过滤2010年2月5日17:31PAGE32页publicvoidBeforeUIModelBinding(){//参数过滤条件this.SetControlCustomInParams();}///<summary>///设置控件过滤条件、属性///</summary>privatevoidSetControlCustomInParams(){//地区this.VillageGrp44.CustomInParams=BaseAction.Symbol_AddCustomFilter+"=RegionLevel="+(int)RegionLevelEnumData.SubVillage;}PAGE33页CallBack&PostBack2010年2月5日 17:39publicvoidAfterCreateChildControls(){//设置控件属性this.SetControlPropery();this.RegisterGridCellDataChangedPostBack();//进厂重变化CallBack,用于计算扣超载重、扣超载运费重、欠砍运费//this.RegisterSugarCaneWeightChangedCallBack();//净重变化CallBack,用于计算甘蔗计价重、甘蔗运费计价重、甘蔗超距扣运费//this.RegisterNetSugarCaneWeightChangedCallBack();}#region回调注册\处理专区///<summary>///注册表格单元格内容改变的回调事件///</summary>privatevoidRegisterGridCellDataChangedPostBack(){AssociationControlgridCellDataChangedASC=newAssociationControl();gridCellDataChangedASC.SourceServerControl=this.DataGrid0;gridCellDataChangedASC.SourceControl.EventName="OnCellDataChanged";//CallBack处理方案//((IUFClientAssoGrid)gridCellDataChangedASC.SourceControl).FireEventCols.Add("AgentDeductItem");//ClientCallBackFrmgridCellDataChangedCBF=newClientCallBackFrm();//gridCellDataChangedCBF.ParameterControls.Add(this.DataGrid1);//gridCellDataChangedCBF.ParameterControls.Add(this.ApSugarCaneAmount82);//gridCellDataChangedCBF.ParameterControls.Add(this.ApFreightAmount61);//gridCellDataChangedCBF.ParameterControls.Add(this.SugarCanePriceWeight13);//gridCellDataChangedCBF.ParameterControls.Add(this.FreightPriceWeight61);//gridCellDataChangedCBF.DoCustomerAction+=newClientCallBackFrm.ActionCustomer(gridCellDataChangedCBF_DoCustomerAction);//gridCellDataChangedCBF.Add(gridCellDataChangedASC);//this.Controls.Add(gridCellDataChangedCBF);//PostBack处理方案CodeBlockcb=newCodeBlock();UFWebClientGridAdaptergridAdapter=newUFWebClientGridAdapter(this.DataGrid0);gridAdapter.IsPostBack=true;gridAdapter.PostBackTag=this.DataGrid0.ClientID+"_"+gridCellDataChangedASC.SourceControl.EventName;cb.TargetControls.addControl(gridAdapter);gridCellDataChangedASC.addBlock(cb);UFGridgrid=this.DataGrid0asUFGrid;grid.GridCustomerPostBackEvent+=newGridCustomerPostBackDelegate(grid_GridCustomerPostBackEvent);}PAGE34页///<summary>///表格的PostBack处理方法///</summary>///<paramname="sender"></param>///<paramname="e"></param>voidgrid_GridCustomerPostBackEvent(objectsender,GridCustomerPostBackEventArgse){if(!e.PostTag.ToString().EndsWith("OnCellDataChanged"))return;OnDataCollect(this);this.IsDataBinding=true;this.IsConsuming=true;stringcolFidldName=this.DataGrid0.Columns[e.ColIndex].UIFieldID;decimalcurrentTotalRatio=0.0M;//当前重量比例和foreach(Weighting_WeightingItemLineRecordrecordinthis.Model.Weighting_WeightingItemLine.Records){if(record.DataRecordState!=DataRowState.Deleted&&record.Index!=this.Model.Weighting_WeightingItemLine.FocusedRecord.Index){currentTotalRatio+=record.WeightRatio;}}if(colFidldName==this.Model.Weighting_WeightingItemLine.FieldSugarcaneBreed.Name)//[品种列]:自动计算重量比例、净重、单价、计价价格、金额{this.Model.Weighting_WeightingItemLine.FocusedRecord.WeightRatio=1-currentTotalRatio;this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedNetWeight=(decimal)this.Model.Weighting.FocusedRecord.SugarCanePriceWeight*this.Model.Weighting_WeightingItemLine.FocusedRecord.WeightRatio;if(!(bool)this.Model.Weighting.FocusedRecord.IsProcessByArriveItem){GetSugarCaneBreedPriceProxygetSugarCaneBreedPriceProxy=newGetSugarCaneBreedPriceProxy();getSugarCaneBreedPriceProxy.SuagerCaneBreedID=this.Model.Weighting_WeightingItemLine.FocusedRecord.SugarcaneBreed;getSugarCaneBreedPriceProxy.BreedLevel=(int)this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedLevel;getSugarCaneBreedPriceProxy.OrgID=long.Parse(PDContext.Current.OrgID);decimalbreedPrice=getSugarCaneBreedPriceProxy.Do();this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedPrice=breedPrice;this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedRealPrice=breedPrice-(decimal)this.Model.Weighting.FocusedRecord.DeductBadSugarCanePrice;//减去火烧降价this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedAmount=(decimal)this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedNetWeight*(decimal)this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedRealPrice;}}elseif(colFidldName==this.Model.Weighting_WeightingItemLine.FieldWeightRatio.Name)//[比例列]:自动计算净重、金额{//比例之和不能大于1if(this.Model.Weighting_WeightingItemLine.FocusedRecord.WeightRatio+currentTotalRatio>1){this.Model.Weighting_WeightingItemLine.FocusedRecord.WeightRatio=1-currentTotalRatio;}PAGE35页this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedNetWeight=(decimal)this.Model.Weighting.FocusedRecord.SugarCanePriceWeight*this.Model.Weighting_WeightingItemLine.FocusedRecord.WeightRatio;this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedAmount=(decimal)this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedNetWeight*(decimal)this.Model.Weighting_WeightingItemLine.FocusedRecord.BreedRealPrice;}}///<summary>///表格的CallBack处理方式///</summary>///<paramname="args"></param>///<returns></returns>privateobjectgridCellDataChangedCBF_DoCustomerAction(CustomerActionEventArgsargs){UFWebClientGridAdaptergrid=newUFWebClientGridAdapter(this.DataGrid1);//取表格数据ArrayListlist=(ArrayList)args.ArgsHash[UFWebClientGridAdapter.ALL_GRIDDATA_SelectedRows];intcurIndex=int.Parse(list[0].ToString());Hashtabletable=(Hashtable)((ArrayList)args.ArgsHash[this.DataGrid1.ClientID])[curIndex];longagentDeductItemID=long.Parse(table["AgentDeductItem"].ToString());//取其他数据decimalapSugarCaneAmount=decimal.Parse(args.ArgsHash[this.ApSugarCaneAmount82.ClientID].ToString());decimalapFreightAmount=decimal.Parse(args.ArgsHash[this.ApFreightAmount61.ClientID].ToString());decimalsugarCanePriceWeight=decimal.Parse(args.ArgsHash[this.SugarCanePriceWeight75.ClientID].ToString());decimalfreightPriceWeight=decimal.Parse(args.ArgsHash[this.FreightPriceWeight61.ClientID].ToString());//GetDeductAmountProxygetDeductAmountProxy=newGetDeductAmountProxy();//getDeductAmountProxy.AgentDeductID=agentDeductItemID;//getDeductAmountProxy.ApSugarCaneAmount=apSugarCaneAmount;//getDeductAmountProxy.ApFreightAmount=apFreightAmount;//getDeductAmountProxy.SugarCanePriceWeight=sugarCanePriceWeight;//getDeductAmountProxy.FreightPriceWeight=freightPriceWeight;//decimalagentDeductAmount=getDeductAmountProxy.Do();//grid.CellValue.Add(newObject[]{curIndex,"AgentDeductItemChanged",newstring[]{"true","true","true"}});//grid.CellValue.Add(newObject[]{curIndex,"AgentDeductAmount",newstring[]{""+agentDeductAmount,""+agentDeductAmount,""+agentDeductAmount}});//args.ArgsResult.Add(grid.ClientInstanceWithValue);returnargs;}#region暂未启用的Callback方法///<summary>///暂未启用:进厂重变化CallBack,用于计算扣超载重、扣超载运费重、欠砍运费///</summary>privatevoidRegisterSugarCaneWeightChangedCallBack(){//AssociationControlsugarCaneWeightChangedASC=newAssociationControl();//交互关联控件实例PAGE36页//sugarCaneWeightChangedASC.SourceServerControl=this.SugarCaneArriveWeight43;//触发源控件//sugarCaneWeightChangedASC.SourceControl.EventName="onchange";//触发事件//ClientCallBackFrmsugarCaneWeightChangedCBF=newClientCallBackFrm();//sugarCaneWeightChangedCBF.DoCustomerAction+=newClientCallBackFrm.ActionCustomer(sugarCaneWeightChangedCBF_DoCustomerAction);//定义服务器端的处理方法//sugarCaneWeightChangedCBF.ParameterControls.Add(this.SugarCaneArriveWeight43);//添加传送到服务器端的控件值//sugarCaneWeightChangedCBF.ParameterControls.Add(this.RatedWeight214);//添加传送到服务器端的控件值//sugarCaneWeightChangedCBF.Add(sugarCaneWeightChangedASC);//sugarCaneWeightChan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论