Пример #1
0
        private void CustGridControl_Discount()
        {
            UFWebClientGridAdapter adapter = new UFWebClientGridAdapter(this.DataGrid5);
            string             str         = adapter.getSelectedValuePK("DiscountType");
            int                EnumValues  = (int)AllEnumBE.DiscountTypeEnumData.FixedValues;
            string             expression  = "debugger;if(" + adapter.getSelectedValuePK("DiscountType") + "=='" + EnumValues + "')";
            CodeBlock          codeBlock   = new CodeBlock();
            AssociationControl control     = this.CreateAssociationControl(this.DataGrid5, codeBlock, "OnBeforeCellFocusEnter", expression);

            string[]        strArray = new string[] { "Discount" };//, "Prices"
            List <string[]> list     = new List <string[]>();

            list.Add(new string[] { "Discount", "false", "" });

            foreach (string str2 in strArray)
            {
                adapter.FireEventCols.Add(str2);
            }
            foreach (string[] strArray2 in list)
            {
                adapter.EnabledCols.Add(new string[] { strArray2[0], strArray2[1], strArray2[2] });
            }

            codeBlock.TargetControls.addControl(adapter);
        }
Пример #2
0
        private void CustGridControlForTrue()
        {
            UFWebClientGridAdapter adapter = new UFWebClientGridAdapter(this.DataGrid0);
            string             str         = adapter.getSelectedValuePK("ArrirmState");
            string             expression  = "debugger;if(" + adapter.getSelectedValuePK("ArrirmState") + "=='false')";
            CodeBlock          codeBlock   = new CodeBlock();
            AssociationControl control     = this.CreateAssociationControl(this.DataGrid0, codeBlock, "OnBeforeCellFocusEnter", expression);

            //使列不可用
            //
            //this.DataGrid5.r

            string[]        strArray = new string[] { "SubKey", "Dosage", "Tier" };
            List <string[]> list     = new List <string[]>();

            list.Add(new string[] { "SubKey", "true", "" });
            list.Add(new string[] { "Dosage", "true", "" });
            list.Add(new string[] { "Tier", "true", "" });
            foreach (string str2 in strArray)
            {
                adapter.FireEventCols.Add(str2);
            }
            foreach (string[] strArray2 in list)
            {
                adapter.EnabledCols.Add(new string[] { strArray2[0], strArray2[1], strArray2[2] });
            }

            codeBlock.TargetControls.addControl(adapter);
        }
        private void RegisterGridCellEnableTrue(IUFDataGrid grid)
        {
            AssociationControl gridCellDataChangedASC = new AssociationControl();

            gridCellDataChangedASC.SourceServerControl     = grid;
            gridCellDataChangedASC.SourceControl.EventName = "OnBeforeCellFocusEnter";
            CodeBlock codeBlock  = new CodeBlock();
            string    expression = "";

            expression = "if(";
            UFWebClientGridAdapter webClientGridAdapter = null;

            webClientGridAdapter = new UFWebClientGridAdapter(grid);
            expression          += webClientGridAdapter.getSelectedValuePK("DiscountType");
            expression          += "==";
            expression          += "0";
            expression          += ")";
            codeBlock.Condition  = expression;
            webClientGridAdapter.FireEventCols.Add("DiscountPrice");
            webClientGridAdapter.FireEventCols.Add("DiscountRate");

            webClientGridAdapter.EnabledCols.Add(new object[] { "DiscountPrice", "true", "" });
            webClientGridAdapter.EnabledCols.Add(new object[] { "DiscountRate", "false", "" });
            codeBlock.TargetControls.addControl(webClientGridAdapter);
            gridCellDataChangedASC.addBlock(codeBlock);
        }