Exemplo n.º 1
0
        protected virtual bool BarButtonNew_Click()
        {
            if (EnumPermission.Edit == StatusUse || EnumPermission.New == StatusUse)
            {
                if (CheckEmty(ControlCheckEmty))
                {
                    DelMessageBox.DelMessageBoxOk(StringMessage.CompelInput);
                    return(false);
                }
                if (EnumPermission.New == StatusUse)
                {
                    if (CheckExitValue(ControlCheckExit))
                    {
                        DelMessageBox.DelMessageBoxOk(StringMessage.InfomationExistsObject);
                        return(false);
                    }
                    VoucherID = functionsGUIService.GetGUID();

                    string tableNameHeader = ("Header" + ModelName + VoucherID.Replace("-", "")).ToUpper();
                    string tableNameDetail = ("Detail" + ModelName + VoucherID.Replace("-", "")).ToUpper();

                    if (CreateTableHeaderTemp(TableHeader, tableNameHeader))
                    {
                        if (functionsGUIService.InsertIntoTable(LoadListControlAndField(groHeader), tableNameHeader, "VoucherID", VoucherID))
                        {
                            if (CreateTableHeaderTemp(TableDetail, tableNameDetail, GetlistColumnTableDetail(grvDetail)))
                            {
                                if (functionsGUIService.dataBase.bulkcopy(((DataTable)grcDetai.DataSource), tableNameDetail, GetlistColumnTableDetail(grvDetail).ToArray()))
                                {
                                    functionsGUIService.dataBase.ExecuteProcedure("PROPOSTVOUCHER", new string[] { "model", "VoucherID" }, new string[] { ModelName, VoucherID });
                                }
                            }
                        }
                    }

                    LoadData();
                }
                else
                if (EnumPermission.Edit == StatusUse)
                {
                    if (CheckExitValue(ControlCheckExit))
                    {
                        DelMessageBox.DelMessageBoxOk(StringMessage.InfomationExistsObject);
                        return(false);
                    }
                    functionsGUIService.UpdateTable(LoadListControlAndField(groHeader), TableHeader, "VoucherID", VoucherID);
                    LoadData();
                }
            }
            else
            {
                SetNullControl(groHeader);
                ((Control)DeveloverControlsFocus).Focus();
            }
            return(true);
        }
Exemplo n.º 2
0
 private void ExitApplications()
 {
     if (MdiChildren.Length > 0)
     {
         if (DelMessageBox.DelMessageBoxYN(StringMessage.QuestionResetApplication) == DialogResult.Yes)
         {
             Application.Exit();
         }
     }
     else
     {
         Application.Exit();
     }
 }
Exemplo n.º 3
0
 private void _010800_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (MdiChildren.Length > 0)
     {
         if (DelMessageBox.DelMessageBoxYN(StringMessage.QuestionResetApplication) == DialogResult.Yes)
         {
             Application.Restart();
         }
     }
     else
     {
         Application.Restart();
     }
 }
Exemplo n.º 4
0
        protected virtual bool BarButtonDelete_Click()
        {
            if (DelMessageBox.DelMessageBoxYN(StringMessage.QuestionDelete, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                DeleteVoucher();
                SetNullControl(groHeader);
                LoadData();
                if (grvSearch.RowCount > 0)
                {
                    VoucherID = grvSearch.GetRowCellValue(0, "VoucherID")?.ToString();
                }
            }

            return(true);
        }
Exemplo n.º 5
0
 protected override void OnClosing(CancelEventArgs e)
 {
     if (MdiChildren.Length > 0)
     {
         if (DelMessageBox.DelMessageBoxYN(StringMessage.QuestionResetApplication) == DialogResult.Yes)
         {
             new WriteHistory().EndSession();
         }
         else
         {
             e.Cancel = true;
         }
     }
     else
     {
         new WriteHistory().EndSession(); Application.Exit();
     }
 }
Exemplo n.º 6
0
        protected virtual bool LoadColorControlNotEmty(IDeveloverControl[] develoverControls)
        {
            try
            {
                foreach (IDeveloverControl develoverControl in develoverControls)
                {
                    ((Control)develoverControl).BackColor = DeveloverOptions.ControlRequiedInputBackColor;
                    ((Control)develoverControl).ForeColor = DeveloverOptions.ControlRequiedInputForeColor;
                }

                return(true);
            }
            catch (Exception ex)
            {
                DelMessageBox.DelMessageBoxError("Error:" + ex.Message);
                return(false);
            }
        }
Exemplo n.º 7
0
        protected virtual bool BarButtonDelete_Click()
        {
            SetStatus("Đang xóa");
            if (DelMessageBox.DelMessageBoxYN(StringMessage.QuestionDelete, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
            {
                functionsGUIService.DeleteRowTable(Table, NameFieldCodePrimary, CodePrimary);
                SetNullControl(gro_general);
                LoadData();
                if (grv_search.RowCount > 0)
                {
                    CodePrimary = grv_search.GetRowCellValue(0, NameFieldCodePrimary)?.ToString();
                }
                SetStatus("Xóa thành công");
            }

            SetStatus("Hủy xóa");
            return(true);
        }
Exemplo n.º 8
0
        protected virtual bool BarButtonNew_Click()
        {
            if (EnumPermission.Edit == StatusUse || EnumPermission.New == StatusUse)
            {
                if (CheckEmty(ControlCheckEmty))
                {
                    DelMessageBox.DelMessageBoxOk(StringMessage.CompelInput);
                    return(false);
                }
                if (EnumPermission.New == StatusUse)
                {
                    if (CheckDuplicate(ControlCheckDuplicate, Table, NameFieldCodePrimary))
                    {
                        DelMessageBox.DelMessageBoxOk(StringMessage.InfomationExistsObject);
                        return(false);
                    }
                    CodePrimary = functionsGUIService.GetGUID();

                    functionsGUIService.InsertIntoTable(LoadListControlAndField(gro_general), Table, NameFieldCodePrimary, CodePrimary);
                    LoadData();
                }
                else
                if (EnumPermission.Edit == StatusUse)
                {
                    if (CheckDuplicate(ControlCheckDuplicate, Table, NameFieldCodePrimary, CodePrimary))
                    {
                        DelMessageBox.DelMessageBoxOk(StringMessage.InfomationExistsObject);
                        return(false);
                    }
                    functionsGUIService.UpdateTable(LoadListControlAndField(gro_general), Table, NameFieldCodePrimary, CodePrimary);
                    LoadData();
                }

                SetStatus("Lưu thành công");
            }
            else
            {
                SetStatus("Đang thêm mới");
                SetNullControl(gro_general);
                ((Control)DeveloverControlsFocus).Focus();
            }
            return(true);
        }
Exemplo n.º 9
0
        private void _010200_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (DeveloverOptions.StatusLogins.StatusLogin)
            {
                if (MdiChildren.Length > 0)
                {
                    DialogResult dialogResult = DelMessageBox.DelMessageBoxYNC("Hiện có phiếu đang mở bạn có muốn thoát?", MessageBoxDefaultButton.Button1);
                    if (dialogResult == DialogResult.Yes)
                    {
                        for (int i = 0; i < MdiChildren.Length; i++)
                        {
                            IDeveloverFormChild f = (IDeveloverFormChild)MdiChildren[0];
                            f.Close();
                            i--;
                        }
                    }
                }
                DeveloverOptions.StatusLogins.StatusLogin = false;

                new WriteHistory().EndSession();
                login.ShowDialog();
            }
        }