Пример #1
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "Seleccionar":
                if (selec)
                {
                    BLL.ClassGeneral.latitud  = latitud;
                    BLL.ClassGeneral.longitud = longitud;
                    BLL.ClassGeneral.listo    = true;

                    //alertControl1.Show(this, "Aviso", "Ubicacion Marcada", Properties.
                    this.Close();
                }
                else
                {
                    //alertControl1.Show(this, "Aviso", "Debe Seleccionar la Ubicacion", Properties.Resources.Cancel_32x32);
                }
                break;

            case "Cerrar":
                this.Close();
                break;
            }
        }
 private void windowsUIButtonPanelMain_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
     try
     {
         WindowsUIButton btn = e.Button as WindowsUIButton;
         if (btn.Caption != null && btn.Caption.Equals("Save And Close"))
         {
             if (EmployeeId == 0)
             {
                 employeeTableTableAdapter.InsertQuery(UserNameTextEdit.Text, PasswordTextEdit.Text, isActiveCheckEdit.Checked ? true : false, false, DateTime.Now, DateTime.Now, isAdminUser.Checked ? true : false);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
             else
             {
                 employeeTableTableAdapter.UpdateQuery(UserNameTextEdit.Text, PasswordTextEdit.Text, isActiveCheckEdit.Checked ? true : false, DateTime.Now, isAdminUser.Checked ? true : false, EmployeeId);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something Went wrong");
     }
 }
Пример #3
0
        private void windowsUIButtonPanel2_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            try
            {
                switch (btn.Tag.ToString())
                {
                case "luu":
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }
                    Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateTo", (bAddEditTo ? -1 : iIdTo), ID_XNLookUpEdit.EditValue, MS_TOTextEdit.EditValue, TEN_TOTextEdit.EditValue, TEN_TO_ANHTextEdit.EditValue, TEN_TO_HOATextEdit.EditValue, STT_TOTextEdit.EditValue, Commons.Modules.UserName).ToString();
                    this.DialogResult   = DialogResult.OK;
                    this.Close();
                    break;
                }

                case "huy":
                {
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                    break;
                }

                default: break;
                }
            }catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message.ToString());
            }
        }
Пример #4
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "Guardar y Salir":
                if (ubicacion1.LISTO)
                {
                    if (ubicacion1.ingreso())
                    {
                        alertControl1.Show(this, "Aviso", mensaje, Properties.Resources.Apply_32x32);
                    }
                    else
                    {
                        alertControl1.Show(this, "Aviso", "Error Al Guardar", Properties.Resources.Cancel_32x32);
                    }
                }
                else
                {
                    alertControl1.Show(this, "Aviso", "Faltan Campos Por Llenar", Properties.Resources.Cancel_32x32);
                }
                break;

            case "Limpiar":

                break;

            case "Cerrar":
                this.Close();
                break;
            }
        }
Пример #5
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "Guardar":
                if (usuario1.LISTO)
                {
                    bool ingreso = usuario1.ingreso();

                    if (ingreso)
                    {
                        alertControl1.Show(this, "Aviso", mensaje, Properties.Resources.Apply_32x32);
                        this.Close();
                    }
                    else
                    {
                        alertControl1.Show(this, "Aviso", "Error Al Guardar", Properties.Resources.Cancel_32x32);
                    }
                }
                break;

            case "Limpiar":
                usuario1.limpiar();
                break;

            case "Cerrar":
                this.Close();
                break;
            }
        }
 private void windowsUIButtonPanelMain_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
     try
     {
         WindowsUIButton btn = e.Button as WindowsUIButton;
         if (btn.Caption != null && btn.Caption.Equals("Save And Close"))
         {
             if (CustomerId == 0)
             {
                 customerTableTableAdapter.InsertQuery(CustomerNameTextEdit.Text, CustomerMobileTextEdit.Text, Convert.ToInt32(comboBox1.SelectedValue.ToString()), isActiveCheckEdit.Checked ? true : false, false, DateTime.Now, DateTime.Now);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
             else
             {
                 customerTableTableAdapter.UpdateQuery(CustomerNameTextEdit.Text, CustomerMobileTextEdit.Text, Convert.ToInt32(comboBox1.SelectedValue.ToString()), isActiveCheckEdit.Checked ? true : false, DateTime.Now, CustomerId);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something Went wrong");
     }
 }
Пример #7
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "them":
            {
                enableButon(false);
                Resettest();
                co = true;
                Enablecontrol(DefaultBoolean.False);
                break;
            }

            case "xoa":
            {
                break;
            }

            case "sua":
            {
                enableButon(false);
                co = false;
                Enablecontrol(DefaultBoolean.False);
                break;
            }

            case "luu":
            {
                if (!dxValidationProvider1.Validate())
                {
                    return;
                }
                Enablecontrol(DefaultBoolean.True);
                var s = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spGhiUser", grvNguoiDung.GetFocusedRowCellValue("ID_USER"), ID_NHOMComboBoxEdit.EditValue, ID_TOComboBoxEdit.EditValue, ID_CNSearchLookUpEdit.EditValue, USER_NAMETextEdit.EditValue, FULL_NAMETextEdit.EditValue, Commons.Modules.ObjSystems.Encrypt(PASSWORDTextEdit.EditValue.ToString(), true), DESCRIPTIONMemoExEdit.EditValue, USER_MAILTextEdit.EditValue, Convert.ToInt32(ACTIVECheckEdit.EditValue), Convert.ToBoolean(co));
                LoadUser(Convert.ToInt32(s));
                enableButon(true);
                break;
            }

            case "khongluu":
            {
                grvNguoiDung_FocusedRowChanged(null, null);
                Enablecontrol(DefaultBoolean.True);
                enableButon(true);
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }

            default:
                break;
            }
        }
Пример #8
0
        private void btnALL_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            try
            {
                WindowsUIButton btn = e.Button as WindowsUIButton;
                XtraUserControl ctl = new XtraUserControl();
                switch (btn.Tag.ToString())
                {
                case "luu":
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }
                    if (bKiemTrung())
                    {
                        return;
                    }
                    Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateLY_DO_VANG", (AddEdit ? -1 : Id),
                                                                  MS_LDVTextEdit.EditValue,
                                                                  TEN_LDVTextEdit.EditValue,
                                                                  TEN_LDV_ATextEdit.EditValue,
                                                                  TEN_LDV_HTextEdit.EditValue,
                                                                  ID_CHE_DOSearchLookUpEdit.EditValue,
                                                                  PHEPCheckEdit.EditValue,
                                                                  (PHAN_TRAM_TRO_CAPTextEdit.EditValue == null) ? 0 : PHAN_TRAM_TRO_CAPTextEdit.EditValue,
                                                                  TINH_BHXHCheckEdit.EditValue,
                                                                  KY_HIEUTextEdit.EditValue,
                                                                  TINH_LUONGCheckEdit.EditValue,
                                                                  (STT_LDVTextEdit.EditValue == null) ? 0 : STT_LDVTextEdit.EditValue).ToString();
                    if (AddEdit)
                    {
                        if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemThanhCongBanMuonThemTiep"), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            LoadTextNull();
                            return;
                        }
                    }
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                    break;
                }

                case "huy":
                {
                    this.Close();
                    break;
                }

                default: break;
                }
            }
            catch (Exception EX)
            {
                XtraMessageBox.Show(EX.Message.ToString());
            }
        }
Пример #9
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "themsua":
            {
                if (grvCongNhan.RowCount == 0)
                {
                    Commons.Modules.ObjSystems.msgChung(Commons.ThongBao.msgBanChuaChonDuLieu);
                    return;
                }
                Commons.Modules.ObjSystems.AddnewRow(grvNgungDongBHXH, true);
                enableButon(false);
                break;
            }

            case "xoa":
            {
                XoaNgungDongBHXH();
                break;
            }

            case "luu":
            {
                Validate();
                if (grvNgungDongBHXH.HasColumnErrors)
                {
                    return;
                }
                if (Savedata() == false)
                {
                    Commons.Modules.ObjSystems.msgChung(Commons.ThongBao.msgDuLieuDangSuDung);
                }
                enableButon(true);
                Commons.Modules.ObjSystems.DeleteAddRow(grvNgungDongBHXH);
                break;
            }

            case "khongluu":
            {
                Commons.Modules.ObjSystems.DeleteAddRow(grvNgungDongBHXH);
                LoadgrdNgungDongBHXH();
                enableButon(true);
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }
            }
        }
Пример #10
0
        private void windowButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "them":
            {
                LoadTreeMenu(true);
                enableButon(false);
                EnableControl(true);
                break;
            }

            case "luu":
            {
                enableButon(true);
                //tạo bảng tạm từ lưới
                try
                {
                    treeListMenu.PostEditor();
                    treeListMenu.RefreshDataSource();
                    Commons.Modules.ObjSystems.MCreateTableToDatatable(Commons.IConnections.CNStr, "tabMenu" + Commons.Modules.UserName, (DataTable)treeListMenu.DataSource, "");
                    string sSql = "DELETE  FROM dbo.NHOM_MENU WHERE ID_NHOM = " + Commons.Modules.sId + " INSERT INTO dbo.NHOM_MENU (ID_NHOM, ID_MENU, ID_PERMISION) SELECT " + Commons.Modules.sId + ", ID_MENU, ID_PERMISION FROM tabMenu" + Commons.Modules.UserName + " WHERE ISNULL(CHON,1) = 1 AND ID_MENU != -1";
                    SqlHelper.ExecuteNonQuery(Commons.IConnections.CNStr, CommandType.Text, sSql);
                    Commons.Modules.ObjSystems.XoaTable("tabMenu" + Commons.Modules.UserName);
                }
                catch
                {
                    XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemKhongThanhCong"), Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThongBao"), MessageBoxButtons.YesNo);
                }
                EnableControl(false);
                LoadTreeMenu(false);
                break;
            }

            case "khongluu":
            {
                LoadTreeMenu(false);
                enableButon(true);
                EnableControl(false);
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }

            default:
                break;
            }
        }
Пример #11
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "them":
            {
                enableButon(false);
                LoadTo(true);
                break;
            }

            case "xoa":
            {
                break;
            }

            case "sua":
            {
                enableButon(false);
                break;
            }

            case "luu":
            {
                grvTo.PostEditor();
                grvTo.UpdateCurrentRow();
                Commons.Modules.ObjSystems.MCreateTableToDatatable(Commons.IConnections.CNStr, "tabTo" + Commons.Modules.UserName, Commons.Modules.ObjSystems.ConvertDatatable(grdTo), "");
                string sSql = "DELETE dbo.NHOM_TO WHERE ID_NHOM = " + Convert.ToInt64(Commons.Modules.sId) + " INSERT INTO dbo.NHOM_TO ( ID_NHOM, ID_TO ) SELECT " + Convert.ToInt64(Commons.Modules.sId) + ",ID_TO FROM tabTo" + Commons.Modules.UserName + " WHERE CHON = 1";
                SqlHelper.ExecuteNonQuery(Commons.IConnections.CNStr, CommandType.Text, sSql);
                Commons.Modules.ObjSystems.XoaTable("tabTo" + Commons.Modules.UserName);
                LoadTo(false);
                enableButon(true);
                break;
            }

            case "khongluu":
            {
                LoadTo(false);
                enableButon(true);
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }

            default:
                break;
            }
        }
Пример #12
0
 //DevExpress.XtraBars.Docking2010.ButtonEventArgs button2;
 private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
     if (e.Button.Properties.GroupIndex == 1)
     {
         System.Environment.Exit(0);
     }
     else if (e.Button.Properties.GroupIndex == 0)
     {
         this.WindowState = FormWindowState.Minimized;
     }
     // this.notifyIcon1.Visible = true;
 }
Пример #13
0
 private void windowsUIButtonPanelMain_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
     try
     {
         WindowsUIButton btn = e.Button as WindowsUIButton;
         if (btn.Caption != null && btn.Caption.Equals("Save And Close"))
         {
             if (courierId == 0)
             {
                 string workingHours = WorkingHoursDateEdit.Time.ToShortTimeString() + " TO " + WorkingHoursDateEditTo.Time.ToShortTimeString();
                 courierTableTableAdapter.InsertQuery(CourierNameTextEdit.Text, ContactNumberTextEdit.Text, workingHours, isActiveCheckEdit.Checked ? true : false, false, DateTime.Now, DateTime.Now);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
             else
             {
                 string workingHours = WorkingHoursDateEdit.Time.ToShortTimeString() + " TO " + WorkingHoursDateEditTo.Time.ToShortTimeString();
                 courierTableTableAdapter.UpdateQuery(CourierNameTextEdit.Text, ContactNumberTextEdit.Text, workingHours, isActiveCheckEdit.Checked ? true : false, DateTime.Now, courierId);
                 ecourierDatabaseDataSet.AcceptChanges();
                 this.Close();
             }
         }
         else if (btn.Caption != null && btn.Caption.Equals("Save And New"))
         {
             if (courierId == 0)
             {
                 string workingHours = WorkingHoursDateEdit.Time.ToShortTimeString() + " TO " + WorkingHoursDateEditTo.Time.ToShortTimeString();
                 courierTableTableAdapter.InsertQuery(CourierNameTextEdit.Text, ContactNumberTextEdit.Text, workingHours, isActiveCheckEdit.Checked ? true : false, false, DateTime.Now, DateTime.Now);
                 ecourierDatabaseDataSet.AcceptChanges();
                 CourierNameTextEdit.Text    = "";
                 ContactNumberTextEdit.Text  = "";
                 isActiveCheckEdit.Checked   = false;
                 WorkingHoursDateEdit.Text   = null;
                 WorkingHoursDateEditTo.Text = null;
             }
             else
             {
                 string workingHours = WorkingHoursDateEdit.Time.ToShortTimeString() + " TO " + WorkingHoursDateEditTo.Time.ToShortTimeString();
                 courierTableTableAdapter.UpdateQuery(CourierNameTextEdit.Text, ContactNumberTextEdit.Text, workingHours, isActiveCheckEdit.Checked ? true : false, DateTime.Now, courierId);
                 ecourierDatabaseDataSet.AcceptChanges();
                 CourierNameTextEdit.Text    = "";
                 ContactNumberTextEdit.Text  = "";
                 isActiveCheckEdit.Checked   = false;
                 WorkingHoursDateEdit.Text   = null;
                 WorkingHoursDateEditTo.Text = null;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something Went wrong");
     }
 }
        void windowsUIButtonPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            switch (e.Button.Properties.Caption)
            {
            case "添加记录":
                m_addProductionPlanForm =
                    (m_addProductionPlanForm == null || m_addProductionPlanForm.IsDisposed) ? new AddForm4(this) : m_addProductionPlanForm;
                m_addProductionPlanForm.Show();
                break;

            case "批量导入":
                ImportExcel();
                Console.WriteLine("批量导入");
                break;

            case "删除":
                DeleteSelect();
                break;

            case "刷新":
                string batchNo = DateTime.Now.ToString("yyyyMMdd");
                productionPlans        = m_productionPlanDao.GetDataSourceList(batchNo);
                gridControl.DataSource = productionPlans;
                break;

            case "上移":
                MoveUp();
                break;

            case "下移":
                MoveDown();
                break;

            case "全部上件":
                if (MessageBox.Show("确认全部上件?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    e.Button.Properties.Enabled = false;
                    InstallAllWorkpiece();
                }
                break;

            case "漏读":
                if (MessageBox.Show("确认出现漏读?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    short result = opcClient.ReadDataFromOpcServer(m_xmlSettings.Count);
                    opcClient.WriteDataToOpcServer(m_xmlSettings.Count, (ushort)(result + 1));
                }
                break;
            }
        }
Пример #15
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "sua":
            {
                Bindingdata(true);
                enableButon(false);
                break;
            }

            case "xoa":
            {
                DeleteData();
                break;
            }

            case "luu":
            {
                SaveData();
                enableButon(true);
                Bindingdata(false);
                break;
            }

            case "khongluu":
            {
                enableButon(true);
                Bindingdata(false);
                break;
            }

            case "thoat":
            {
                if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgBanCoMuonThoatChuongtrinh"), Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTieuDeThoat"), MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                this.Close();
                break;
            }

            default:
                break;
            }
        }
Пример #16
0
        private void bgListNV_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "choose":
                ID_Choose         = textBox1.Text;
                this.DialogResult = DialogResult.OK;
                Close();
                break;

            case "close":
                this.Close();
                break;
            }
        }
Пример #17
0
        private void windowsUIButtonPanelMain_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;

            if (btn.Caption != null && btn.Caption.Equals("Save"))
            {
                //string workingHours = WorkingHoursDateEdit.Time.ToShortTimeString() + " TO " + WorkingHoursDateEditTo.Time.ToShortTimeString();
                pickuptableTableAdapter.InsertQuery(Pickup_Intersaction_nameTextEdit.Text, DateTime.Now, DateTime.Now, false, isActiveCheckEdit.Checked ? true : false);
                ecourierDatabaseDataSet.AcceptChanges();
                bindData();
                Pickup_Intersaction_nameTextEdit.Text = "";
                //this.Close();
            }
            else if (btn.Caption != null && btn.Caption.Equals("Update"))
            {
                if (pickupID != 0)
                {
                    pickuptableTableAdapter.UpdateQuery(Pickup_Intersaction_nameTextEdit.Text, DateTime.Now, isActiveCheckEdit.Checked ? true : false, pickupID);
                    ecourierDatabaseDataSet.AcceptChanges();
                    // this.Close();
                    Pickup_Intersaction_nameTextEdit.Text = "";
                    pickupID = 0;
                    bindData();
                }
                else
                {
                    MessageBox.Show("Select value to be updated");
                }
            }
            else if (btn.Caption != null && btn.Caption.Equals("Delete"))
            {
                if (pickupID != 0)
                {
                    pickuptableTableAdapter.DeleteQuery(DateTime.Now, true, pickupID);
                    ecourierDatabaseDataSet.AcceptChanges();
                    // this.Close();
                    Pickup_Intersaction_nameTextEdit.Text = "";
                    pickupID = 0;
                    bindData();
                }
                else
                {
                    MessageBox.Show("Select value to be updated");
                }
            }
        }
Пример #18
0
        private void btnWDUI_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            try
            {
                switch (btn.Tag.ToString())
                {
                case "luu":
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }
                    Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateQuocGia", (bAddEdit ? -1 : iId), MA_QGTextEdit.EditValue, TEN_QGTextEdit.EditValue, TEN_QG_ATextEdit.EditValue, TEN_QG_HTextEdit.EditValue).ToString();

                    if (bAddEdit)
                    {
                        if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemThanhCongBanMuonThemTiep"), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            LoadTextNull();
                            return;
                        }
                    }
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                    break;
                }

                case "huy":
                {
                    this.DialogResult = DialogResult.Cancel;
                    this.Close();
                    break;
                }

                default: break;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message.ToString());
            }
        }
Пример #19
0
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            try
            {
                WindowsUIButton btn = e.Button as WindowsUIButton;
                XtraUserControl ctl = new XtraUserControl();
                switch (btn.Tag.ToString())
                {
                case "luu":
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }

                    Commons.Modules.sId =
                        SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateDonVi", (bAddEditDV ? -1 : iIdDV), ItemForMSDV.Control.Text, ItemForTEN_DON_VI.Control.Text, ItemForTEN_DON_VI_A.Control.Text, ItemForTEN_DON_VI_H.Control.Text, ItemForTEN_NGAN.Control.Text, ItemForDIA_CHI.Control.Text, Convert.ToBoolean(MAC_DINHCheckEdit.EditValue), ItemForCHU_QUAN.Control.Text, ItemForDIEN_THOAI.Control.Text, ItemForFAX.Control.Text, ItemForMS_BHYT.Control.Text, ItemForMS_BHXH.Control.Text, ItemForSO_TAI_KHOAN.Control.Text, ItemForTEN_NGAN_HANG.Control.Text, ItemForKY_HIEU.Control.Text, ItemForNGUOI_DAI_DIEN.Control.Text, ItemForCHUC_VU.Control.Text, ItemForSO_HS.Control.Text, ItemForSTT_DV.Control.Text).ToString();

                    if (bAddEditDV)
                    {
                        if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgThemThanhCongBanMuonThemTiep"), "", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            LoadTextNull();
                            return;
                        }
                    }
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                    break;
                }

                case "huy":
                {
                    this.Close();
                    break;
                }

                default: break;
                }
            }
            catch (Exception EX)
            {
                XtraMessageBox.Show(EX.Message.ToString());
            }
        }
        private void windowsUIButtonPanel1_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "back":
                this.Close();
                break;

            case "ok":
                Ok();
                break;

            default:
                break;
            }
        }
Пример #21
0
        /// <summary>
        /// 右上方按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void buttonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string topic = (e.Button.Properties.Tag as string);

            var       des = desc.ContainsKey(topic) ? desc[topic] : "";
            PageGroup pg  = new PageGroup();

            pg.Parent  = tileContainer;
            pg.Caption = topic;
            GroupDetailPage pageGroup = new GroupDetailPage(topic, des);

            pageGroup.Tag = pg;//保存当前分组所在页面的容器
            var doc = windowsUIView.AddDocument(pageGroup);

            pg.Items.Add(doc as Document);
            windowsUIView.ContentContainers.Add(pg);
            windowsUIView.ActivateContainer(pg);
        }
Пример #22
0
 void panelContainer1_CustomButtonChecked(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
     if (e.Button == panelContainer1.CustomHeaderButtons[4])
     {
         (panelContainer1.ActiveChild.ControlContainer.Controls[0] as MemoEdit).Properties.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
     }
     if (e.Button == panelContainer1.CustomHeaderButtons[3])
     {
         (panelContainer1.ActiveChild.ControlContainer.Controls[0] as MemoEdit).Properties.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
     }
     if (e.Button == panelContainer1.CustomHeaderButtons[2])
     {
         (panelContainer1.ActiveChild.ControlContainer.Controls[0] as MemoEdit).Properties.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
     }
     if (e.Button == panelContainer1.CustomHeaderButtons[1])
     {
         panelContainer1.Visibility = DockVisibility.AutoHide;
     }
 }
Пример #23
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "In":
            {
                InDuLieu();
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }
            }
        }
        private void windowsUIButtonPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "refresh":
                BookLending_Load(sender, e);
                break;

            case "close":
                bookLending.Hide();
                break;

            case "return":
                Return(sender, e);
                BookLending_Load(sender, e);
                break;

            default:
                break;
            }
        }
Пример #25
0
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "luu":
            {
                ChangePassWord();
                break;
            }

            case "thoat":
            {
                this.Close();
                break;
            }

            default:
                break;
            }
        }
Пример #26
0
        private void windowButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "resetpass":
            {
                frmChangePass change = new frmChangePass(grvListUser.GetFocusedRowCellValue("USER_NAME").ToString());
                change.ShowDialog();
                break;
            }

            case "thoat":
            {
                Commons.Modules.ObjSystems.GotoHome(this);
                break;
            }

            default:
                break;
            }
        }
Пример #27
0
        //ejemplo para el menu
        //es un evento BottonClick
        //no el click
        private void windowsUIButtonPanel2_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            string tag = ((WindowsUIButton)e.Button).Tag.ToString();

            switch (tag)
            {
            case "Guardar":


                break;

            case "Guardar y Salir":

                break;

            case "Limpiar":

                break;

            case "Salir":
                this.Close();
                break;
            }
        }
Пример #28
0
        private void btnALL_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            try
            {
                WindowsUIButton btn = e.Button as WindowsUIButton;
                XtraUserControl ctl = new XtraUserControl();
                switch (btn.Tag.ToString())
                {
                case "luu":
                {
                    if (!dxValidationProvider1.Validate())
                    {
                        return;
                    }
                    Commons.Modules.sId = SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spUpdateCHUC_VU", (bAddEditCV ? -1 : iIdCV),
                                                                  MS_CVTextEdit.EditValue, TEN_CVTextEdit.EditValue, TEN_CV_ATextEdit.EditValue,
                                                                  TEN_CV_HTextEdit.EditValue, ID_LOAI_CVSearchLookUpEdit.EditValue, STT_IN_CVTextEdit.EditValue).ToString();
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                    break;
                }

                case "huy":
                {
                    this.Close();
                    break;
                }

                default: break;
                }
            }
            catch (Exception EX)
            {
                XtraMessageBox.Show(EX.Message.ToString());
            }
        }
Пример #29
0
 private void windowsUIButtonPanel_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
 {
 }
Пример #30
0
        //sự kiện các nút xử lí
        private void windowsUIButton_ButtonClick(object sender, DevExpress.XtraBars.Docking2010.ButtonEventArgs e)
        {
            WindowsUIButton btn = e.Button as WindowsUIButton;
            XtraUserControl ctl = new XtraUserControl();

            switch (btn.Tag.ToString())
            {
            case "them":
            {
                Bindingdata(true);
                cothem = true;
                enableButon(false);
                break;
            }

            case "sua":
            {
                if (grvGiaDinh.RowCount == 0)
                {
                    return;
                }
                cothem = false;
                enableButon(false);
                break;
            }

            case "xoa":
            {
                if (grvGiaDinh.RowCount == 0)
                {
                    return;
                }
                DeleteData();
                break;
            }

            case "luu":
            {
                DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule conditionValidationRule1 = new DevExpress.XtraEditors.DXErrorProvider.ConditionValidationRule();
                conditionValidationRule1.ConditionOperator = DevExpress.XtraEditors.DXErrorProvider.ConditionOperator.IsNotBlank;
                conditionValidationRule1.ErrorText         = "This value is not valid";
                conditionValidationRule1.ErrorType         = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical;

                if (rdo_CongTy.SelectedIndex == 1)
                {
                    dxValidationProvider1.SetValidationRule(this.HO_TENTextEdit, conditionValidationRule1);
                    dxValidationProvider1.RemoveControlError(this.HO_TENLookupEdit);
                }
                else
                {
                    dxValidationProvider1.SetValidationRule(this.HO_TENLookupEdit, conditionValidationRule1);
                    dxValidationProvider1.RemoveControlError(this.HO_TENTextEdit);
                }
                if (!dxValidationProvider1.Validate())
                {
                    return;
                }
                SaveData();
                enableButon(true);
                break;
            }

            case "khongluu":
            {
                enableButon(true);
                if (grvGiaDinh.RowCount == 1)
                {
                    Bindingdata(false);
                }
                dxValidationProvider1.Validate();
                break;
            }

            case "thoat":
            {
                if (XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgBanCoMuonThoatChuongtrinh"), Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTieuDeThoat"), MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                this.Close();
                break;
            }

            default:
                break;
            }
        }