示例#1
0
 public void SetNumberField()
 {
     Fieldformat[] mFieldGroup = new Fieldformat[] { NumberFieldMain };
     for (int j = 0; j < mFieldGroup.Length; j++)
     {
         if (mFieldGroup[j].Fields == "" || mFieldGroup[j].Fields == null)
         {
             continue;
         }
         string[] mTemp      = mFieldGroup[j].Fields.Split(',');
         GCNum    mTableType = mFieldGroup[j].TableType;
         for (int i = 0; i < mTemp.Length; i++)
         {
             GetGV(mTableType).Columns[mTemp[i]].DisplayFormat.FormatType   = FormatType.Numeric;
             GetGV(mTableType).Columns[mTemp[i]].DisplayFormat.FormatString = "n0";
             if (mTableType == GCNum.GCN_Main)
             {
                 {
                     DevExpress.XtraEditors.TextEdit tbx = this.Controls.Find(mTemp[i], true).FirstOrDefault() as DevExpress.XtraEditors.TextEdit;
                     if (tbx != null)
                     {
                         tbx.Properties.DisplayFormat.FormatType   = FormatType.Numeric;
                         tbx.Properties.DisplayFormat.FormatString = "n0";
                     }
                 }
             }
         }
     }
 }
示例#2
0
        public void DateTimeToStr()
        {
            Fieldformat[] mFieldGroup = new Fieldformat[] { DateFieldMain, TimeFieldMain, DateFieldBody, TimeFieldBody };
            for (int j = 0; j < mFieldGroup.Length; j++)
            {
                if (mFieldGroup[j].Fields == "" || mFieldGroup[j].Fields == null)
                {
                    continue;
                }
                string[] mTemp      = mFieldGroup[j].Fields.Split(',');
                GCNum    mTableType = mFieldGroup[j].TableType;
                string   mDateType  = mFieldGroup[j].DateType;

                for (int i = 0; i < mTemp.Length; i++)
                {
                    if (mTableType == GCNum.GCN_Main)
                    {
                        {
                            DevExpress.XtraEditors.TextEdit tbx = this.Controls.Find(mTemp[i], true).FirstOrDefault() as DevExpress.XtraEditors.TextEdit;
                            if (tbx != null)
                            {
                                if (mDateType == "Date")
                                {
                                    tbx.Text = tbx.Text.Replace("/", "");
                                }
                                else if (mDateType == "Time")
                                {
                                    tbx.Text = tbx.Text.Replace(":", "");
                                }
                            }
                        }
                    }
                }
            }
        }
示例#3
0
 public override DevExpress.XtraGrid.Views.Grid.GridView GetGV(GCNum xGCNum)
 {
     switch (xGCNum)
     {
     case GCNum.GCN_Main:
         return(GV_Main);
     }
     return(null);
 }
示例#4
0
 public override DevExpress.XtraGrid.GridControl GetGC(GCNum xGCNum)
 {
     switch (xGCNum)
     {
     case GCNum.GCN_Main:
         return(GC_Main);
     }
     return(null);
 }
示例#5
0
 public void SetButtonEditField()
 {
     for (int i = 0; i < ButtonFieldListBody.Count; i++)
     {
         if (ButtonFieldListBody[i].Field == "" || ButtonFieldListBody[i].Field == null)
         {
             continue;
         }
         GCNum mTableType = ButtonFieldListBody[i].TableType;
         GV_Main.Columns[ButtonFieldListBody[i].Field].ColumnEdit = ButtonFieldListBody[i];
         F2FieldBody.Add(ButtonFieldListBody[i].Field);
     }
 }
示例#6
0
 public virtual void DBFillBy(GCNum xNum, string xStr)
 {
     switch (xNum)
     {
     case GCNum.GCN_Main:
         for (int i = GV_Main.Columns.Count - 1; i >= 0; i--)
         {
             if (VisibleListMain.ContainsKey(GV_Main.Columns[i].FieldName))
             {
                 GV_Main.Columns[i].VisibleIndex = VisibleListMain[GV_Main.Columns[i].FieldName];
             }
         }
         break;
     }
 }
示例#7
0
 public void WidthColumns(GCNum xNum, Dictionary <string, int> FDic)
 {
     DevExpress.XtraGrid.Views.Grid.GridView gv = GetGV(xNum);
     for (int i = 0; i < FDic.Count; i++)
     {
         KeyValuePair <string, int> dic = FDic.ElementAt(i);
         for (int j = 0; j < gv.Columns.Count; j++)
         {
             if (dic.Key == gv.Columns[j].FieldName)
             {
                 gv.Columns[j].Width = dic.Value;
                 break;
             }
         }
     }
 }
示例#8
0
        public void SetDateTimeField()
        {
            Fieldformat[] mFieldGroup = new Fieldformat[] { DateFieldMain, TimeFieldMain };
            for (int j = 0; j < mFieldGroup.Length; j++)
            {
                if (mFieldGroup[j].Fields == "" || mFieldGroup[j].Fields == null)
                {
                    continue;
                }
                string[] mTemp      = mFieldGroup[j].Fields.Split(',');
                GCNum    mTableType = mFieldGroup[j].TableType;
                string   mDateType  = mFieldGroup[j].DateType;

                for (int i = 0; i < mTemp.Length; i++)
                {
                    using (RepositoryItemTextEdit edit = new RepositoryItemTextEdit())
                    {
                        GetGV(mTableType).Columns[mTemp[i]].ColumnEdit = edit;
                        edit.DisplayFormat.FormatType   = FormatType.Custom;
                        edit.DisplayFormat.FormatString = mDateType;
                        edit.DisplayFormat.Format       = new CustomFormatter();
                    }

                    if (mTableType == GCNum.GCN_Main)
                    {
                        {
                            DevExpress.XtraEditors.TextEdit tbx = this.Controls.Find(mTemp[i], true).FirstOrDefault() as DevExpress.XtraEditors.TextEdit;
                            if (tbx != null)
                            {
                                tbx.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
                                if (mDateType == "Date")
                                {
                                    tbx.Properties.Mask.EditMask = "yyyy/MM/dd";
                                }
                                else if (mDateType == "Time")
                                {
                                    tbx.Properties.Mask.EditMask = "HH:mm";
                                }
                                tbx.Properties.DisplayFormat.FormatType   = FormatType.Custom;
                                tbx.Properties.DisplayFormat.FormatString = mDateType;
                                tbx.Properties.DisplayFormat.Format       = new CustomFormatter();
                            }
                        }
                    }
                }
            }
        }
示例#9
0
 public void SetPassWordEditField()
 {
     Fieldformat[] mFieldGroup = new Fieldformat[] { PassWordFieldMain };
     for (int j = 0; j < mFieldGroup.Length; j++)
     {
         if (mFieldGroup[j].Fields == "" || mFieldGroup[j].Fields == null)
         {
             continue;
         }
         string[] mTemp      = mFieldGroup[j].Fields.Split(',');
         GCNum    mTableType = mFieldGroup[j].TableType;
         for (int i = 0; i < mTemp.Length; i++)
         {
             using (RepositoryItemTextEdit edit = new RepositoryItemTextEdit())
             {
                 GetGV(mTableType).Columns[mTemp[i]].ColumnEdit = edit;
                 edit.PasswordChar = '*';
             }
         }
     }
 }
示例#10
0
 public void SetCheckEditField()
 {
     Fieldformat[] mFieldGroup = new Fieldformat[] { CheckFieldMain };
     for (int j = 0; j < mFieldGroup.Length; j++)
     {
         if (mFieldGroup[j].Fields == "" || mFieldGroup[j].Fields == null)
         {
             continue;
         }
         string[] mTemp      = mFieldGroup[j].Fields.Split(',');
         GCNum    mTableType = mFieldGroup[j].TableType;
         for (int i = 0; i < mTemp.Length; i++)
         {
             using (RepositoryItemCheckEdit edit = new RepositoryItemCheckEdit())
             {
                 GetGV(mTableType).Columns[mTemp[i]].ColumnEdit = edit;
                 edit.ValueChecked   = "Y";
                 edit.ValueUnchecked = "N";
             }
         }
     }
 }
示例#11
0
 public virtual bool DBUpdate(GCNum xNum)
 {
     return(true);
 }