Beispiel #1
0
        public virtual void BtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (FGridStatu == GridStatu.gsEdit || FGridStatu == GridStatu.gsAdd)
            {
                //CheckMainField();
                if (!CheckRequiredField())
                {
                    return;
                }
                DateTimeToStr();
                GV_Main.PostEditor();
                if (DBUpdate(GCNum.GCN_Main))
                {
                    if (FGridStatu == GridStatu.gsAdd)
                    {
                        GV_Main.FocusedRowHandle = GV_Main.RowCount - 1;
                    }

                    FGridStatu = GridStatu.gsBrowse;

                    for (int i = 0; i < MainControls.Count; i++)
                    {
                        MainControls[i].Enabled             = true;
                        MainControls[i].Properties.ReadOnly = true;
                    }

                    BtnNew.Enabled       = true;
                    BtnQuery.Enabled     = true;
                    BtnEdit.Enabled      = true;
                    BtnDel.Enabled       = true;
                    BtnFirst.Enabled     = true;
                    BtnPrior.Enabled     = true;
                    BtnNext.Enabled      = true;
                    BtnLast.Enabled      = true;
                    BtnSave.Enabled      = false;
                    BtnCancel.Enabled    = false;
                    btnAutoWidth.Enabled = true;
                    IsCheckRequired      = true;
                    TabControlMain.Focus();
                }
            }
        }