private void uct_onClosePopUp(object sender)
        {
            if (this.frmEditorMode == "VIEW")
            {
                return;
            }

            TreeListNode nodeSel = treeList1.FocusedNode;

            if (nodeSel == null)
            {
                return;
            }

            DataRow drInfo = (treeList1.GetDataRecordByNode(treeList1.FocusedNode) as DataRowView).Row;

            ProduceManager.UcTreeList ucp = sender as ProduceManager.UcTreeList;
            if (!blPrevFindControl)
            {
                SetContrMoveNext(ucp.Name, false);
            }
            DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ucp.Name, ucp.Parent.Name);

            StaticFunctions.UpdateDataRowSynUcTreeList(drInfo, drContrl["SetSynFields"].ToString(), ucp);
        }
        private void uct_onClosePopUp(object sender)
        {
            ProduceManager.UcTreeList ucp = sender as ProduceManager.UcTreeList;
            DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ucp.Name, ucp.Parent.Name);

            StaticFunctions.UpdateDataRowSynUcTreeList(drSet, drContrl["SetSynFields"].ToString(), ucp);
        }
Esempio n. 3
0
        private void Txt_Enter(object sender, EventArgs e)
        {
            strFocusedContrName = (sender as Control).Name;
            FocusedControl      = sender as Control;

            Control ctrParent = FocusedControl.Parent;

            if (ctrParent != null)
            {
                if (strEnterGc != ctrParent.Name)
                {
                    strEnterGc    = ctrParent.Name;
                    ParentControl = GcOrdControls[strEnterGc];
                    arrContrSeq   = GcOrdarrContrSeq[strEnterGc];
                }
                if (FocusedControl.GetType().ToString() == "ProduceManager.UcTxtPopup")
                {
                    ProduceManager.UcTxtPopup ucp = FocusedControl as ProduceManager.UcTxtPopup;
                    ucp.DrFilterFieldsInfo = GridViewEdit.GetFocusedDataRow();
                }
                else if (FocusedControl.GetType().ToString() == "ProduceManager.UcTreeList")
                {
                    ProduceManager.UcTreeList ucp = FocusedControl as ProduceManager.UcTreeList;
                    ucp.DrFilterFieldsInfo = GridViewEdit.GetFocusedDataRow();
                }
            }
        }
Esempio n. 4
0
        private void uct_onClosePopUp(object sender)
        {
            if (strEnterGc == string.Empty)
            {
                return;
            }

            DataRow drInfo = GridViewEdit.GetFocusedDataRow();

            if (drInfo == null)
            {
                return;
            }

            ProduceManager.UcTreeList ucp = sender as ProduceManager.UcTreeList;
            if (!blPrevFindControl)
            {
                SetContrMoveNext(ucp.Name, false);
            }
            DataRow drContrl = StaticFunctions.GetContrRowValueById(dtShow, ucp.Name, ucp.Parent.Name);

            StaticFunctions.UpdateDataRowSynUcTreeList(drInfo, drContrl["SetSynFields"].ToString(), ucp);
        }
Esempio n. 5
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            CApplication.App.CurrentSession.TimerId = 0;
            frmEditorBase frm = CApplication.CurrForm as frmEditorBase;

            if (frm == null)
            {
                return(base.ProcessCmdKey(ref msg, keyData));
            }

            int k = msg.WParam.ToInt32();

            blPrevFindControl = false;
            if (k == 123) //F12
            {
                if (CApplication.Com_Prot != null)
                {
                    CApplication.Com_Prot.port_Send();
                }
            }
            else if (k == 27)//Esc
            {
                frm.Close();
                frm.Dispose();
            }
            else if (k == 13)//Enter
            {
                if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                {
                    return(base.ProcessCmdKey(ref msg, keyData));
                }
                if (!blNoEnterToSave)
                {
                    int index = arrContrSeq.IndexOf(strFocusedContrName);
                    if (index == arrContrSeq.Count - 1 && BtnEnterSave != null)
                    {
                        string strBtnType = BtnEnterSave.GetType().ToString();
                        if (strBtnType == "DevExpress.XtraEditors.SimpleButton")
                        {
                            (BtnEnterSave as SimpleButton).PerformClick();
                        }
                        else if (strBtnType == "DevExpress.XtraBars.BarButtonItem")
                        {
                            (BtnEnterSave as BarButtonItem).PerformClick();
                        }
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                if (FocusedControl is BaseEdit)
                {
                    BaseEdit bc = FocusedControl as BaseEdit;
                    if (bc.Properties.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                else if (FocusedControl is ProduceManager.UcTxtPopup)
                {
                    ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                    if (bc.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                else if (FocusedControl is ProduceManager.UcTreeList)
                {
                    ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                    if (bc.ReadOnly)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                }
                string strType = FocusedControl.GetType().ToString();
                if (strType == "DevExpress.XtraEditors.LookUpEdit")
                {
                    if (!(FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ExtendControl.ExtPopupTree")
                {
                    if (!(FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ProduceManager.UcTxtPopup")
                {
                    if (!(FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else if (strType == "ProduceManager.UcTreeList")
                {
                    if (!(FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                    }
                }
                else
                {
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);
                }
            }
            else if (k == 187 || k == 107 || k == 227) // +
            {
                if (keyData.ToString().ToUpper().IndexOf("CONTROL") != -1)
                {
                    if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                    if (FocusedControl is BaseEdit)
                    {
                        BaseEdit bc = FocusedControl as BaseEdit;
                        if (bc.Properties.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTxtPopup)
                    {
                        ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTreeList)
                    {
                        ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }

                    string strType = FocusedControl.GetType().ToString();
                    if (strType == "DevExpress.XtraEditors.LookUpEdit" &&
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ExtendControl.ExtPopupTree" &&
                             (FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ExtendControl.ExtPopupTree).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ProduceManager.UcTxtPopup" &&
                             (FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ProduceManager.UcTxtPopup).ClosePopup();
                        blPrevFindControl = false;
                    }
                    else if (strType == "ProduceManager.UcTreeList" &&
                             (FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        blPrevFindControl = true;
                        (FocusedControl as ProduceManager.UcTreeList).ClosePopup();
                        blPrevFindControl = false;
                    }
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl, 3);

                    return(true);
                }
            }
            else if (k == 189 || k == 109 || k == 229) // - //36:Home
            {
                if (keyData.ToString().ToUpper().IndexOf("CONTROL") != -1)
                {
                    if (string.IsNullOrEmpty(strFocusedContrName) || FocusedControl == null)
                    {
                        return(base.ProcessCmdKey(ref msg, keyData));
                    }
                    if (FocusedControl is BaseEdit)
                    {
                        BaseEdit bc = FocusedControl as BaseEdit;
                        if (bc.Properties.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTxtPopup)
                    {
                        ProduceManager.UcTxtPopup bc = FocusedControl as ProduceManager.UcTxtPopup;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    else if (FocusedControl is ProduceManager.UcTreeList)
                    {
                        ProduceManager.UcTreeList bc = FocusedControl as ProduceManager.UcTreeList;
                        if (bc.ReadOnly)
                        {
                            return(base.ProcessCmdKey(ref msg, keyData));
                        }
                    }
                    blPrevFindControl = true;

                    string strType = FocusedControl.GetType().ToString();
                    if (strType == "DevExpress.XtraEditors.LookUpEdit" &&
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).IsPopupOpen)
                    {
                        (FocusedControl as DevExpress.XtraEditors.LookUpEdit).ClosePopup();
                    }
                    else if (strType == "ExtendControl.ExtPopupTree" &&
                             (FocusedControl as ExtendControl.ExtPopupTree).IsPopupOpen)
                    {
                        (FocusedControl as ExtendControl.ExtPopupTree).ClosePopup();
                    }
                    else if (strType == "ProduceManager.UcTxtPopup" &&
                             (FocusedControl as ProduceManager.UcTxtPopup).IsPopupOpen)
                    {
                        (FocusedControl as ProduceManager.UcTxtPopup).ClosePopup();
                    }
                    else if (strType == "ProduceManager.UcTreeList" &&
                             (FocusedControl as ProduceManager.UcTreeList).IsPopupOpen)
                    {
                        (FocusedControl as ProduceManager.UcTreeList).ClosePopup();
                    }
                    frm.SetContrMoveNext(strFocusedContrName, blPrevFindControl);

                    return(true);
                }
            }
            else if (k == 33)//PgUp
            {
                if (GridViewEdit != null)
                {
                    GridViewEdit.MovePrev();
                    return(true);
                }
            }
            else if (k == 34)//PgDn
            {
                if (GridViewEdit != null)
                {
                    GridViewEdit.MoveNext();
                    return(true);
                }
            }
            else if (k == 46)//Delete
            {
                frm.DeleteFocusedItem();
                return(true);
                //if (GridViewEdit != null && GridViewEdit.GetFocusedDataRow() != null && frmEditorMode=="VIEW")
                //{
                //    frm.DeleteFocusedItem();
                //}
            }
            else if (k == 116)//F5
            {
                frm.RefreshItem();
                return(true);
            }
            else if (k == 20)//CapsLk
            {
                if (keyData.ToString().ToUpper().IndexOf("ALT") != -1)
                {
                    int idex = arrOpenedForms.IndexOf(this);
                    if (idex == -1)
                    {
                        return(true);
                    }

                    if (idex == 0)
                    {
                        idex = arrOpenedForms.Count - 1;
                    }
                    else
                    {
                        idex -= 1;
                    }


                    Form[] charr = this.ParentForm.MdiChildren;
                    foreach (Form chform in charr)
                    {
                        if (chform.Name.ToUpper() == arrOpenedForms[idex].Name.ToUpper())
                        {
                            chform.Show();
                            chform.Activate();

                            return(true);
                        }
                    }
                    return(true);
                }
            }

            return(base.ProcessCmdKey(ref msg, keyData));
        }
Esempio n. 6
0
        public virtual void SetContrMoveNext(string strContrName, bool blPrev, int iSeed)
        {
            int index = arrContrSeq.IndexOf(strContrName);

            if (index == -1)
            {
                return;
            }
            if (!blPrev && index == arrContrSeq.Count - 1 || blPrev && index == 0)
            {
                return;
            }
            if (FocusedControl.GetType().ToString() == "DevExpress.XtraEditors.CheckedComboBoxEdit")
            {
                DevExpress.XtraEditors.CheckedComboBoxEdit cklis = FocusedControl as DevExpress.XtraEditors.CheckedComboBoxEdit;
                string   strText  = string.Empty;
                string[] arrTexts = cklis.Text.Split(",,".ToCharArray());

                foreach (CheckedListBoxItem item in cklis.Properties.Items)
                {
                    foreach (string strT in arrTexts)
                    {
                        string strTxt = strT.Trim();
                        if (strTxt == string.Empty)
                        {
                            continue;
                        }

                        if (item.Value.ToString().ToLower() == strTxt.ToLower() ||
                            item.Description.ToLower() == strTxt.ToLower())
                        {
                            strText += strText == string.Empty ? item.Value.ToString() : "," + item.Value.ToString();
                        }
                    }
                }
                cklis.EditValue = strText;
                cklis.RefreshEditValue();
            }

            int iFidx = 0;

            if (blPrev)
            {
                iFidx = index - iSeed < 0 ? 0 : index - iSeed;
            }
            else
            {
                iFidx = index + iSeed > arrContrSeq.Count - 1 ? arrContrSeq.Count - 1 : index + iSeed;
            }

            Control[] contrs = FocusedControl.Parent.Controls.Find(arrContrSeq[iFidx], false);
            if (contrs.Length <= 0)
            {
                return;
            }

            Control contr = contrs[0];

            if (contr is BaseEdit)
            {
                BaseEdit bse = contr as BaseEdit;
                if (bse.Properties.ReadOnly || !bse.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            else if (contr is ProduceManager.UcTxtPopup)
            {
                ProduceManager.UcTxtPopup bc = contr as ProduceManager.UcTxtPopup;
                if (bc.ReadOnly || !bc.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            else if (contr is ProduceManager.UcTreeList)
            {
                ProduceManager.UcTreeList bc = contr as ProduceManager.UcTreeList;
                if (bc.ReadOnly || !bc.Visible)
                {
                    SetContrMoveNext(arrContrSeq[iFidx], blPrev, 1);
                    return;
                }
            }
            switch (contr.GetType().ToString())
            {
            case "DevExpress.XtraEditors.TextEdit":
                DevExpress.XtraEditors.TextEdit txt = contr as DevExpress.XtraEditors.TextEdit;
                txt.Focus();
                txt.SelectAll();
                break;

            case "DevExpress.XtraEditors.MemoEdit":
                DevExpress.XtraEditors.MemoEdit mTxt = contr as DevExpress.XtraEditors.MemoEdit;
                mTxt.Focus();
                mTxt.SelectAll();
                break;

            case "DevExpress.XtraEditors.SimpleButton":
                DevExpress.XtraEditors.SimpleButton btn = contr as DevExpress.XtraEditors.SimpleButton;
                btn.Select();
                break;

            case "DevExpress.XtraEditors.LookUpEdit":
                DevExpress.XtraEditors.LookUpEdit dpl = contr as DevExpress.XtraEditors.LookUpEdit;
                dpl.Focus();
                dpl.ShowPopup();
                break;

            case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                DevExpress.XtraEditors.CheckedComboBoxEdit ckcob = contr as DevExpress.XtraEditors.CheckedComboBoxEdit;
                ckcob.Focus();
                ckcob.SelectAll();
                break;

            case "DevExpress.XtraEditors.DateEdit":
                DevExpress.XtraEditors.DateEdit dt = contr as DevExpress.XtraEditors.DateEdit;
                dt.Focus();
                dt.Select();
                break;

            case "ExtendControl.ExtPopupTree":
                ExtendControl.ExtPopupTree ext = contr as ExtendControl.ExtPopupTree;
                ext.Focus();
                ext.ShowPopup();
                break;

            case "ProduceManager.UcTxtPopup":
                ProduceManager.UcTxtPopup ucp = contr as ProduceManager.UcTxtPopup;
                ucp.Focus();
                ucp.ShowPopup();
                break;

            case "ProduceManager.UcTreeList":
                ProduceManager.UcTreeList uct = contr as ProduceManager.UcTreeList;
                uct.Focus();
                uct.ShowPopup();
                break;

            case "DevExpress.XtraEditors.ComboBoxEdit":
                DevExpress.XtraEditors.ComboBoxEdit cob = contr as DevExpress.XtraEditors.ComboBoxEdit;
                cob.Focus();
                cob.ShowPopup();
                break;

            default:
                break;
            }
        }
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            dsFormUkyndaAdt = this.GetFrmLoadUkyndaDsAdt(strBusClassName);
            dsFormUkyndaAdt.AcceptChanges();
            dsFormAdt = this.GetFrmLoadDsAdt(strBusClassName);
            dsFormAdt.AcceptChanges();
            dsLoad = this.GetFrmLoadDsNew(strBusClassName);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];

            drMain   = dsLoad.Tables[2].Rows[0];
            dtBtns   = dsLoad.Tables[3];
            dtTabs   = dsLoad.Tables[4];
            dtGroupC = dsLoad.Tables[5];
            dtSte    = dsLoad.Tables[6];
            dtContr  = dsLoad.Tables[7];
            dtBtnsM  = dsLoad.Tables[8];
            dtSp     = dsLoad.Tables[9];

            StaticFunctions.ShowGridControl(treeList1, dtShow, dtConst);
            string[] strKeyIdFileds = drMain["KeyIdFiled"].ToString().Split("|".ToCharArray());
            if (strKeyIdFileds.Length != 3)
            {
                MessageBox.Show("主表主键必须以下列方式设置:Kind_Id|Parent_Kind_Id|Kind_Level");
                return;
            }
            this.treeList1.KeyFieldName    = strKeyIdFileds[0];
            this.treeList1.ParentFieldName = strKeyIdFileds[1];
            strKeyFiled       = this.treeList1.KeyFieldName;
            strParentKeyFiled = this.treeList1.ParentFieldName;
            strKind_Level     = strKeyIdFileds[2];
            strSpName         = drMain["SpName"].ToString();

            splitContainerControl2.SplitterPosition = int.Parse(drMain["MainSplitterPosition"].ToString());

            ParentControl = gcInfo;
            BtnEnterSave  = btnSave;
            Rectangle rect = SystemInformation.VirtualScreen;
            int       iGcW = rect.Width - 30 - splitContainerControl2.SplitterPosition;

            #region gcInfo
            List <Control> lisGcContrs = StaticFunctions.ShowGcContrs(gcInfo, iGcW, dtShow, dtConst, true, 50, true, arrContrSeq, false
                                                                      , out blSetDefault, out strNoEnableCtrIds, out strFileds, out CtrFirstEditContr);
            StrNoEnableEditCtrIds  = StaticFunctions.GetReadOnlyEditIds(dtShow, gcInfo.Name);
            CtrFirstEditFocusContr = StaticFunctions.GetFirstEditFocusContr(gcInfo, dtShow);
            foreach (Control ctrl in lisGcContrs)
            {
                ctrl.Enter += new System.EventHandler(this.Txt_Enter);
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                case "ProduceManager.UcTxtPopup":
                    ProduceManager.UcTxtPopup ucp = ctrl as ProduceManager.UcTxtPopup;
                    ucp.onClosePopUp += new UcTxtPopup.ClosePopUp(ucp_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ucp, dtShow);
                    break;

                case "ProduceManager.UcTreeList":
                    ProduceManager.UcTreeList uct = ctrl as ProduceManager.UcTreeList;
                    uct.onClosePopUp += new UcTreeList.ClosePopUp(uct_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, uct, dtShow);
                    break;

                case "ExtendControl.ExtPopupTree":
                    ExtendControl.ExtPopupTree ept = ctrl as ExtendControl.ExtPopupTree;
                    ept.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ept, dtShow);
                    break;

                default:
                    break;
                }
            }
            #endregion
        }
Esempio n. 8
0
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            dsFormUkyndaAdt = this.GetFrmLoadUkyndaDsAdt(strBusClassName);
            dsFormUkyndaAdt.AcceptChanges();
            dsFormAdt = this.GetFrmLoadDsAdt(strBusClassName);
            dsFormAdt.AcceptChanges();
            dsLoad = this.GetFrmLoadDsNew(strBusClassName);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];

            drMain       = dsLoad.Tables[2].Rows[0];
            strSpName    = drMain["SpName"].ToString();
            strQueryFlag = drMain["QueryFlag"].ToString();

            dtBtns   = dsLoad.Tables[3];
            dtTabs   = dsLoad.Tables[4];
            dtGroupC = dsLoad.Tables[5];
            dtSte    = dsLoad.Tables[6];
            dtContr  = dsLoad.Tables[7];
            dtBtnsM  = dsLoad.Tables[8];
            dtSp     = dsLoad.Tables[9];

            ParentControl = gcQuery;
            int            igcHeight;
            Rectangle      rect        = SystemInformation.VirtualScreen;
            List <Control> lisGcContrs = StaticFunctions.ShowGroupControl(gcQuery, rect.Width - 50, dtShow, dtConst, true, 30, false, null, true, out igcHeight);

            List <BarButtonItem> lisBarItems = StaticFunctions.ShowBarButtonItem(dtBtns, bar2, "bar2", strAllowList, imageList1);

            foreach (BarButtonItem item in lisBarItems)
            {
                item.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
            }
            gcItems = StaticFunctions.ShowTabItem(dtTabs, xtabItemInfo, "xtabItemInfo", strAllowList, lisrepImg);
            foreach (string strGv in gcItems.Keys)
            {
                StaticFunctions.ShowGridControl(gcItems[strGv], dtShow, dtConst);
                StaticFunctions.SaveOrLoadDelLayout(gcItems[strGv], this.strBusClassName + "_" + strGv, "LOAD");

                StaticFunctions.SetGridViewStyleFormatCondition(gcItems[strGv], dtBtnsM);
            }

            #region gcQuery
            foreach (Control ctrl in lisGcContrs)
            {
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                case "ProduceManager.UcTxtPopup":
                    ProduceManager.UcTxtPopup ucp = ctrl as ProduceManager.UcTxtPopup;
                    ucp.onClosePopUp += new UcTxtPopup.ClosePopUp(ucp_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ucp, dtShow);
                    break;

                case "ProduceManager.UcTreeList":
                    ProduceManager.UcTreeList uct = ctrl as ProduceManager.UcTreeList;
                    uct.onClosePopUp += new UcTreeList.ClosePopUp(uct_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, uct, dtShow);
                    break;

                case "ExtendControl.ExtPopupTree":
                    ExtendControl.ExtPopupTree ept = ctrl as ExtendControl.ExtPopupTree;
                    ept.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ept, dtShow);
                    break;

                default:
                    break;
                }
            }
            #endregion
            StaticFunctions.SetBtnStyle(barManager1, null, drMain);

            if (drMain["HideQuery"].ToString() == "True")
            {
                gcQuery.Visible = false;
            }

            if (xtabItemInfo.TabPages.Count == 1)
            {
                xtabItemInfo.ShowTabHeader = DevExpress.Utils.DefaultBoolean.False;
            }
            else
            {
                xtabItemInfo.ShowTabHeader = DevExpress.Utils.DefaultBoolean.True;
            }
        }
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            dsFormUkyndaAdt = this.GetFrmLoadUkyndaDsAdt(strFormName);
            dsFormUkyndaAdt.AcceptChanges();
            dsFormAdt = this.GetFrmLoadDsAdt(strFormName);
            dsFormAdt.AcceptChanges();
            dsLoad = this.GetFrmLoadDsNew(strFormName);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];
            dtContr = dsLoad.Tables[7];
            int            iGcH;
            List <Control> lisGcContrs = StaticFunctions.ShowGroupControl(gcSet, 700 - 50, dtShow, dtConst, false, 30, false, null, false, out iGcH);

            foreach (Control ctrl in lisGcContrs)
            {
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                case "ProduceManager.UcTxtPopup":
                    ProduceManager.UcTxtPopup ucp = ctrl as ProduceManager.UcTxtPopup;
                    ucp.onClosePopUp += new UcTxtPopup.ClosePopUp(ucp_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ucp, dtShow);
                    break;

                case "ProduceManager.UcTreeList":
                    ProduceManager.UcTreeList uct = ctrl as ProduceManager.UcTreeList;
                    uct.onClosePopUp += new UcTreeList.ClosePopUp(uct_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, uct, dtShow);
                    break;

                case "ExtendControl.ExtPopupTree":
                    ExtendControl.ExtPopupTree ept = ctrl as ExtendControl.ExtPopupTree;
                    ept.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ept, dtShow);
                    break;

                default:
                    break;
                }
            }
        }
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            dsFormUkyndaAdt = this.GetFrmLoadUkyndaDsAdt(strBusClassName);
            dsFormUkyndaAdt.AcceptChanges();
            dsFormAdt = this.GetFrmLoadDsAdt(strBusClassName);
            dsFormAdt.AcceptChanges();
            dsLoad = this.GetFrmLoadDsNew(strBusClassName);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];

            drMain                   = dsLoad.Tables[2].Rows[0];
            strSpName                = drMain["SpName"].ToString();
            strQueryFlag             = drMain["QueryFlag"].ToString();
            strGetInfoFlag           = drMain["GetInfoFlag"].ToString();
            strKeyFiled              = drMain["KeyIdFiled"].ToString();
            strMenus_ClassEdit       = drMain["Menus_ClassEdit"].ToString();
            strMenus_ClassEditTitle  = drMain["Menus_ClassEditTitle"].ToString();
            strEditBsuClass          = drMain["EditBsuClass"].ToString();
            strRelationsKeyId        = drMain["RelationsKeyId"].ToString();
            strNoShowDefaultBarItems = drMain["NoShowDefaultBarItems"].ToString();

            dtBtns   = dsLoad.Tables[3];
            dtTabs   = dsLoad.Tables[4];
            dtGroupC = dsLoad.Tables[5];
            dtSte    = dsLoad.Tables[6];
            dtContr  = dsLoad.Tables[7];
            dtBtnsM  = dsLoad.Tables[8];
            dtSp     = dsLoad.Tables[9];

            GridViewEdit  = gridVMain;
            ParentControl = gcQuery;
            int            igcHeight;
            Rectangle      rect        = SystemInformation.VirtualScreen;
            List <Control> lisGcContrs = StaticFunctions.ShowGroupControl(gcQuery, rect.Width - 50, dtShow, dtConst, true, 30, false, null, true, out igcHeight);

            //StaticFunctions.SetMainGridView(gridVMain, drMain, lisrepImg);
            //StaticFunctions.ShowGridControl(gridVMain, dtShow, dtConst);
            StaticFunctions.ShowGridControlBand(gridVMain, dtShow, dtConst);
            StaticFunctions.SaveOrLoadDelLayout(gridVMain, this.strBusClassName + "_gridVMain", "LOAD");
            StaticFunctions.SetGridViewStyleFormatCondition(gridVMain, dtBtnsM);

            List <BarButtonItem> lisBarItems = StaticFunctions.ShowBarButtonItem(dtBtns, bar2, "bar2", strAllowList, imageList1);

            foreach (BarButtonItem item in lisBarItems)
            {
                item.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
            }
            gcItems = StaticFunctions.ShowTabItem(dtTabs, xtabItemInfo, "xtabItemInfo", strAllowList, lisrepImg);
            foreach (string strGv in gcItems.Keys)
            {
                StaticFunctions.ShowGridControl(gcItems[strGv], dtShow, dtConst);
                StaticFunctions.SaveOrLoadDelLayout(gcItems[strGv], this.strBusClassName + "_" + strGv, "LOAD");

                DataRow[] drTabs = dtTabs.Select("IsAddChildGv=1 AND GridViewName='" + strGv + "'");
                if (drTabs.Length == 1)
                {
                    GridView gvChild = StaticFunctions.ShowGridVChildGv(strGv + "Com", gcItems[strGv].GridControl, dtShow, dtConst);
                    StaticFunctions.SetGridViewStyleFormatCondition(gvChild, dtBtnsM);
                }

                StaticFunctions.SetGridViewStyleFormatCondition(gcItems[strGv], dtBtnsM);
            }
            foreach (RepositoryItemImageEdit rep in lisrepImg)
            {
                rep.Popup += new System.EventHandler(this.repImg_Popup);
            }

            #region gcQuery
            foreach (Control ctrl in lisGcContrs)
            {
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                case "ProduceManager.UcTxtPopup":
                    ProduceManager.UcTxtPopup ucp = ctrl as ProduceManager.UcTxtPopup;
                    ucp.onClosePopUp += new UcTxtPopup.ClosePopUp(ucp_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ucp, dtShow);
                    break;

                case "ProduceManager.UcTreeList":
                    ProduceManager.UcTreeList uct = ctrl as ProduceManager.UcTreeList;
                    uct.onClosePopUp += new UcTreeList.ClosePopUp(uct_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, uct, dtShow);
                    break;

                case "ExtendControl.ExtPopupTree":
                    ExtendControl.ExtPopupTree ept = ctrl as ExtendControl.ExtPopupTree;
                    ept.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ept, dtShow);
                    break;

                default:
                    break;
                }
            }
            #endregion
            if (drMain["IsAddChildGv"].ToString() == "True")
            {
                GridView gvChild = StaticFunctions.ShowGridVChildGv("gridVCom", gridCMain, dtShow, dtConst);
                StaticFunctions.SetGridViewStyleFormatCondition(gvChild, dtBtnsM);
            }
            StaticFunctions.SetBtnStyle(barManager1, null, drMain);

            if (drMain["HideQuery"].ToString() == "True")
            {
                gcQuery.Visible = false;
            }
        }
Esempio n. 11
0
        private void InitContr()
        {
            if (dsLoad != null)
            {
                return;
            }

            string strBusClassName = drBtn["FrmClassName"].ToString();

            dsFormUkyndaAdt = this.GetFrmLoadUkyndaDsAdt(strBusClassName);
            dsFormUkyndaAdt.AcceptChanges();
            dsFormAdt = this.GetFrmLoadDsAdt(strBusClassName);
            dsFormAdt.AcceptChanges();
            dsLoad = this.GetFrmLoadDsNew(strBusClassName);
            dsLoad.AcceptChanges();
            dtShow  = dsLoad.Tables[0];
            dtConst = dsLoad.Tables[1];

            drMain               = dsLoad.Tables[2].Rows[0];
            strSpName            = drMain["SpName"].ToString();
            strQueryFlag         = drMain["QueryFlag"].ToString();
            strAddFlag           = drMain["AddFlag"].ToString();
            strKeyFiled          = drMain["KeyIdFiled"].ToString();
            strGetWFBalceCtrlIds = drMain["GetWFBalceCtrlIds"].ToString();

            splitContainerControl1.SplitterPosition = int.Parse(drMain["MainSplitterPosition"].ToString());

            dtBtns   = dsLoad.Tables[3];
            dtTabs   = dsLoad.Tables[4];
            dtGroupC = dsLoad.Tables[5];
            dtSte    = dsLoad.Tables[6];
            dtContr  = dsLoad.Tables[7];
            dtBtnsM  = dsLoad.Tables[8];
            dtSp     = dsLoad.Tables[9];

            if (drBtn["FrmShowIcon"].ToString() == "True")
            {
                GridColumn gridCol             = new GridColumn();
                RepositoryItemImageEdit repImg = new RepositoryItemImageEdit();
                repImg.AutoHeight = false;
                repImg.Buttons.Clear();
                repImg.Name             = "gridVInfo_repImg";
                repImg.PopupFormMinSize = new System.Drawing.Size(450, 350);
                repImg.ReadOnly         = true;
                repImg.Popup           += new System.EventHandler(this.repImg_Popup);

                gridCol.Caption    = "图片";
                gridCol.ColumnEdit = repImg;
                gridCol.FieldName  = "Icon";
                gridCol.Name       = "gridVInfo_GCol";
                gridCol.OptionsColumn.AllowMove  = false;
                gridCol.OptionsColumn.ReadOnly   = true;
                gridCol.OptionsColumn.FixedWidth = true;
                gridCol.Visible      = true;
                gridCol.VisibleIndex = 0;
                gridCol.Width        = 50;

                this.gridCInfo.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
                    repImg
                });
                gridVInfo.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { gridCol });
            }
            else if (drBtn["FrmShowPicEdit"].ToString() == "True")
            {
                GridColumn gridCol = new GridColumn();
                RepositoryItemPictureEdit repPic = new RepositoryItemPictureEdit();
                repPic.Name        = "gridVInfo_repPic";
                repPic.ReadOnly    = true;
                repPic.ShowMenu    = false;
                repPic.SizeMode    = DevExpress.XtraEditors.Controls.PictureSizeMode.Zoom;
                repPic.MouseLeave += new System.EventHandler(this.repPic_MouseLeave);
                repPic.MouseHover += new EventHandler(repPic_MouseHover);

                gridCol.Caption    = "图片";
                gridCol.ColumnEdit = repPic;
                gridCol.FieldName  = "Icon";
                gridCol.Name       = "gridVInfo_GCol";
                gridCol.OptionsColumn.AllowMove  = false;
                gridCol.OptionsColumn.ReadOnly   = true;
                gridCol.OptionsColumn.FixedWidth = true;
                gridCol.Visible      = true;
                gridCol.VisibleIndex = 0;
                gridCol.Width        = int.Parse(drBtn["FrmPicGvWidth"].ToString());

                this.gridCInfo.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
                    repPic
                });
                gridVInfo.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { gridCol });

                this.gridVInfo.RowHeight = int.Parse(drBtn["FrmPicGvRowHeight"].ToString());
                this.gridVInfo.OptionsView.ShowAutoFilterRow = false;
                this.picEdit.Location = new System.Drawing.Point(int.Parse(drBtn["FrmPicX"].ToString()), int.Parse(drBtn["FrmPicY"].ToString()));
            }
            Rectangle rect = SystemInformation.VirtualScreen;

            StaticFunctions.ShowGridControl(gridVInfo, dtShow, dtConst, out strFileds);
            StaticFunctions.SetGridViewStyleFormatCondition(gridVInfo, dtBtnsM);
            IsAddChildGv = this.drBtn["IsAddChildGv"].ToString() == "True";
            if (IsAddChildGv)
            {
                gvChild = StaticFunctions.ShowGridVChildGv("gridVCom", gridCInfo, dtShow, dtConst, out strFiledsInfo);
                StaticFunctions.SetGridViewStyleFormatCondition(gvChild, dtBtnsM);
            }

            blInitBound = true;
            #region GroupC
            GridViewEdit = gridVMain;
            List <Control> lisGcContrs = new List <Control>();
            int            iMaxHeight  = StaticFunctions.ShowTabItemBusAdd(dtTabs, dtGroupC, xtabItemInfo, xtabItemInfo.Name, string.Empty
                                                                           , lisGcContrs, dtShow, dtConst, GcOrdControls, GcOrdarrContrSeq, lstFiledsOrd);
            if (lisGcContrs.Count == 0)
            {
                splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel1;
            }
            else
            {
                splitContainerControl1.PanelVisibility  = SplitPanelVisibility.Both;
                splitContainerControl1.SplitterPosition = iMaxHeight + 50;
            }
            foreach (Control ctrl in lisGcContrs)
            {
                ctrl.Enter += new System.EventHandler(this.Txt_Enter);
                switch (ctrl.GetType().ToString())
                {
                case "DevExpress.XtraEditors.TextEdit":
                    SetControlEvent(ctrl);
                    break;

                case "DevExpress.XtraEditors.CheckEdit":
                    break;

                case "DevExpress.XtraEditors.LookUpEdit":
                    LookUpEdit dpl = ctrl as LookUpEdit;
                    dpl.Properties.QueryPopUp += new System.ComponentModel.CancelEventHandler(this.lookUpEdit_Properties_QueryPopUp);
                    dpl.Properties.Closed     += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.CheckedComboBoxEdit":
                    CheckedComboBoxEdit chkdpl = ctrl as CheckedComboBoxEdit;
                    chkdpl.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    break;

                case "DevExpress.XtraEditors.DateEdit":
                    break;

                case "ProduceManager.UcTxtPopup":
                    ProduceManager.UcTxtPopup ucp = ctrl as ProduceManager.UcTxtPopup;
                    ucp.onClosePopUp += new UcTxtPopup.ClosePopUp(ucp_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ucp, dtShow);
                    break;

                case "ProduceManager.UcTreeList":
                    ProduceManager.UcTreeList uct = ctrl as ProduceManager.UcTreeList;
                    uct.onClosePopUp += new UcTreeList.ClosePopUp(uct_onClosePopUp);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, uct, dtShow);
                    break;

                case "ExtendControl.ExtPopupTree":
                    ExtendControl.ExtPopupTree ept = ctrl as ExtendControl.ExtPopupTree;
                    ept.Properties.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(this.lookUpEdit_Properties_Closed);
                    StaticFunctions.BoundSpicalContr(dtContr, dsFormAdt, dsFormUkyndaAdt, ept, dtShow);
                    break;

                default:
                    break;
                }
            }
            #endregion
            blInitBound = false;
            xtabItemInfo_SelectedPageChanged(xtabItemInfo, new DevExpress.XtraTab.TabPageChangedEventArgs(null, xtabItemInfo.SelectedTabPage));
        }