Example #1
0
        public override void AfterRender(IPart Part, EventArgs args)
        {
            base.AfterRender(Part, args);
            ToPoTryCalcUIForListFormWebPart p = (ToPoTryCalcUIForListFormWebPart)Part;
            UFGrid g = (UFGrid)Part.GetUFControlByName(Part.TopLevelContainer, "DataGrid01");

            g.AllowAddRow    = false;
            g.AllowDeleteRow = false;
            g.AllowInsertRow = false;
            //试算页面选中需要进行试算的请购行
            IUIRecordCollection arr = p.Model.PRLine.SelectRecords;

            //循环试算结果集合,试算结果集合的PrimaryKey是料号的ID
            for (int j = 0; j < p.Model.TryCalcView.Records.Count; j++)
            {
                for (int i = 0; i < arr.Count; i++)
                {
                    PRLineRecord r = (PRLineRecord)arr[i];
                    if (r.ItemInfo_ItemID_PurchaseInfo_PurchaseQuotaMode == 4)                                   //料号的分配方式是4:按比例分配,则设置对应的试算结果行不可编辑供应商
                    {
                        if (r.ItemInfo_ItemID.ToString() == p.Model.TryCalcView.Records[j]["ItemID"].ToString()) //请购行的料号ID与试算结果的主键(料号ID)比较
                        {
                            g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "Supplier");
                        }
                    }
                }
                //设置试算结果的数量不可编辑
                g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "ToPOQtyTU");
                g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "ToPOQtyTBU");
            }
        }
        private void Register_DataGrid_BeforeDeleteLine_PoskBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid8;
            assocControl.SourceControl.EventName = "OnBeforeRowDelete";//OnBeforeRowAdd

            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid8);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnBeforeRowDelete";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid itemGrid = this.DataGrid8 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(itemGriding_GridCustomerPostBackEvent);



            //ClientCallBackFrm cf = new ClientCallBackFrm();
            //cf.ParameterControls.Add(this.DataGrid8);
            //cf.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(cf_DoCustomerAction);
            //cf.Add(assocControl);
            //this.Controls.Add(cf);
        }
Example #3
0
        private void SetGridRowBackColor()
        {
            UFGrid uGrid = this.DataGrid0 as UFGrid;

            if (this.Model.PurchaseOrderView.Records.Count > 0)
            {
                uGrid.ClearCellsStyle();
                uGrid.AlwaysFocus = false;
                int i = 0;
                foreach (PurchaseOrderViewRecord lineRecord in this.Model.PurchaseOrderView.Records)
                {
                    uGrid.SetCellStyle(i, "ThisPreMoney", "LightGreen");
                    i++;
                }
            }
        }
Example #4
0
        // <summary>
        /// 注册表格单元格内容改变的回调事件
        /// </summary>
        private void RegisterGridCellDataChangedPostBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid1;
            assocControl.SourceControl.EventName = "GridRowClicked";
            //((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("Gift");
            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid1);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "GridRowClicked";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid itemGrid = this.DataGrid1 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(GridCellOnChanged_DoCustomerAction_Grid);
        }
        private void CellDataChangedPostBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid5;
            assocControl.SourceControl.EventName = "OnCellDataChanged";
            ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("BillNoid");
            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid5);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnCellDataChanged";//OnCellDataValueChanged
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid itemGrid = this.DataGrid5 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(itemGrid_GridCustomerPostBackEvent);
        }
Example #6
0
        private void Register_DataGrid_BeforeDeleteLine_PoskBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid1;
            assocControl.SourceControl.EventName = "OnBeforeRowDelete";//OnBeforeRowAdd

            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid1);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnBeforeRowDelete";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid itemGrid = this.DataGrid1 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(itemGrid_GridCustomerPostBackEvent);
        }
        /// <summary>
        /// 注册表格单元格内容改变的回调事件
        /// </summary>
        private void SumDeliveryCellDataChangedPostBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid13;
            assocControl.SourceControl.EventName = "OnCellDataValueChanged";

            ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("InstalledArkNumber");
            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid13);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnCellDataValueChanged";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid itemGrid = this.DataGrid13 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(GridCellOnChanged_DoCustomerAction_Grid);
        }
        private void SetGridRowBackColor()
        {
            UFGrid grid1 = this.DataGrid1 as UFGrid;

            if (this.Model.ShipPlanDetailHead.RecordCount > 0)
            {
                int i = 0;
                grid1.ClearRowStyles();
                grid1.AlwaysFocus = false;
                foreach (ShipPlanDetailHeadRecord linerecord in this.Model.ShipPlanDetailHead.Records)
                {
                    if (linerecord["IsSpace"].ToString().ToLower() == "true")
                    {
                        grid1.SetRowStyle(i, "#FF0000", "");
                    }
                    i++;
                }
            }
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        private void QryCellDataChangedPostBack()
        {
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = this.DataGrid1;
            assocControl.SourceControl.EventName = "OnCellClick";

            //((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("SONo");
            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid1);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnCellClick";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);
            UFGrid qryGrid = this.DataGrid1 as UFGrid;

            qryGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(qryGrid_GridCustomerPostBackEvent);
        }
Example #10
0
 protected override void OnInitDo(EventArgs e)
 {
     this.Page.InitComplete += new EventHandler(Page_InitComplete);
     WebPartBuilder.InitWebPart(this);
     this.Action = new ItemRefAction(this);
     adjust      = new FormAdjust();
     CreateFormChildControls();
     DialogNoPersonalization = true;
     if (!UseQueryCase)
     {
         CardForRefQueryCase.Visible = false;
         UFGrid sortGrid = this.GetUFControlByName(this.TopLevelContainer, "DataGrid") as UFGrid;
         if (sortGrid != null)
         {
             sortGrid.ShowCustomFilterToolBar = false;
         }
     }
     else
     {
         UFIDA.UBF.Query.CommonService.RefQueryHelper.AfterCreateChildControls_Qry_DefaultImpl(this.Action);
         UFIDA.U9.UI.PDHelper.PDFormMessage.ShowQryDialogForReference(this, this.QryButton);
     }
 }
Example #11
0
        private void Register_DataGrid4_ExportPrice_PostBack()
        {
            if (DataGrid4 == null)
            {
                DataGrid4 = (IUFDataGrid)part.GetUFControlByName(part.TopLevelContainer, "DataGrid4");
            }
            AssociationControl assocControl = new AssociationControl();

            assocControl.SourceServerControl     = DataGrid4;
            assocControl.SourceControl.EventName = "OnCellDataChanged";
            ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("DescFlexField_PrivateDescSeg5");
            CodeBlock cb = new CodeBlock();
            UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(DataGrid4);

            gridAdapter.IsPostBack  = true;
            gridAdapter.PostBackTag = "OnCellDataChanged";
            cb.TargetControls.addControl(gridAdapter);
            assocControl.addBlock(cb);

            UFGrid itemGrid = DataGrid4 as UFGrid;

            itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(GridCellOnChanged_DoCustomerAction_Grid);
        }
Example #12
0
        public override void AfterRender(IPart Part, EventArgs args)
        {
            base.AfterRender(Part, args);
            ToPoTryCalcUIFormWebPart p = (ToPoTryCalcUIFormWebPart)Part;
            //获取页面上的DataGrid
            UFGrid g = (UFGrid)Part.GetUFControlByName(Part.TopLevelContainer, "DataGrid01");

            //设置DataGrid01不可新增、插入、删除
            g.AllowAddRow    = false;
            g.AllowDeleteRow = false;
            g.AllowInsertRow = false;

            //试算页面选中需要进行试算的请购行
            IUIRecordCollection arr = p.Model.PR_PRLineList.SelectRecords;

            //循环试算结果集合,试算结果集合的PrimaryKey是料号的ID
            for (int j = 0; j < p.Model.TryCalcView.Records.Count; j++)
            {
                for (int i = 0; i < arr.Count; i++)
                {
                    PR_PRLineListRecord r = (PR_PRLineListRecord)arr[i];
                    if (r.ItemInfo_ItemID_PurchaseInfo_PurchaseQuotaMode == 4)                                   //料号的分配方式是4:按比例分配,则设置对应的试算结果行不可编辑供应商
                    {
                        if (r.ItemInfo_ItemID.ToString() == p.Model.TryCalcView.Records[j]["ItemID"].ToString()) //请购行的料号ID与试算结果的主键(料号ID)比较
                        {
                            g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "Supplier");
                        }
                    }
                }
                //设置试算结果的数量不可编辑
                g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "ToPOQtyTU");
                g.SetCellDisabled(p.Model.TryCalcView.Records[j].Index, "ToPOQtyTBU");
            }

            //UFSoft.UBF.UI.AtlasHelper.RegisterClientScript(p.Page, p.Page.GetType(), "disabledategrid", "$().ready(function(){ $('#u_S_S1_DataGrid01_MainBody>table>tbody>tr>td').click(function(){$('#u_S_S1_DataGrid01_MainBody>table>tbody>tr>td input').attr('disabled', 'disabled');});});", true);
        }