Ejemplo n.º 1
0
        private bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtOldPassword.Text))
            {
                depError.SetError(txtOldPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtOldPassword.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtNewPassword.Text))
            {
                depError.SetError(txtNewPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtNewPassword.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtConfirmPassword.Text))
            {
                depError.SetError(txtConfirmPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtConfirmPassword.Focus();
                return(false);
            }
            if (!txtNewPassword.Text.Equals(txtConfirmPassword.Text))
            {
                depError.SetError(txtConfirmPassword, LanguageEngine.GetMessageCaption("000014", ConfigEngine.Language));
                txtConfirmPassword.Focus();
                return(false);
            }
            if (!EncryptEngine.Encrypt(txtOldPassword.Text).Equals(CommonEngine.userInfo.Password))
            {
                depError.SetError(txtOldPassword, LanguageEngine.GetMessageCaption("000015", ConfigEngine.Language));
                txtOldPassword.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtProvinceCode.Text))
            {
                depError.SetError(txtProvinceCode, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtProvinceCode.Focus();
                return(false);
            }
            if (txtProvinceCode.Text.Contains(" "))
            {
                depError.SetError(txtProvinceCode, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtProvinceCode.Focus();
                return(false);
            }
            if (CommonEngine.CheckExistsUnicodeChar(txtProvinceCode.Text))
            {
                depError.SetError(txtProvinceCode, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtProvinceCode.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtVNName.Text.Trim()))
            {
                depError.SetError(txtVNName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtVNName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtENName.Text.Trim()))
            {
                depError.SetError(txtENName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtENName.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
 private void gluStore_EditValueChanged(object sender, EventArgs e)
 {
     if (gluStore.EditValue == null || gluStore.EditValue.Equals("0"))
     {
         depError.SetError(gluStore, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
     }
     else
     {
         LoadWarehouseByStoreID(gluStore.EditValue + "");
         depError.SetError(gluStore, null);
     }
 }
Ejemplo n.º 4
0
        private bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtLevel3Code.Text.Trim()))
            {
                depError.SetError(txtLevel3Code, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtLevel3Code.Focus();
                return(false);
            }
            else if (txtLevel3Code.Text.Contains(" "))
            {
                depError.SetError(txtLevel3Code, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtLevel3Code.Focus();
                return(false);
            }
            else if (CommonEngine.CheckExistsUnicodeChar(txtLevel3Code.Text.Trim()))
            {
                depError.SetError(txtLevel3Code, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtLevel3Code.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtLevel3ShortCode.Text.Trim()))
            {
                depError.SetError(txtLevel3ShortCode, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtLevel3ShortCode.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtVNName.Text.Trim()))
            {
                depError.SetError(txtVNName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtVNName.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtENName.Text.Trim()))
            {
                depError.SetError(txtENName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtENName.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(gluLevel1.EditValue + "") || gluLevel1.EditValue.Equals("0"))
            {
                depError.SetError(gluLevel1, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluLevel1.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(gluLevel2.EditValue + "") || gluLevel2.EditValue.Equals("0"))
            {
                depError.SetError(gluLevel2, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluLevel1.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 5
0
 private void txtPassword_EditValueChanged(object sender, EventArgs e)
 {
     if (txtPassword.Text.Contains(" "))
     {
         depError.SetError(txtPassword, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
     }
     else if (string.IsNullOrEmpty(txtPassword.Text))
     {
         depError.SetError(txtPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
     }
     else
     {
         depError.SetError(txtPassword, null);
     }
 }
Ejemplo n.º 6
0
 private void txtOldPassword_EditValueChanged(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtOldPassword.Text))
     {
         depError.SetError(txtOldPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
     }
     else if (!EncryptEngine.Encrypt(txtOldPassword.Text).Equals(CommonEngine.userInfo.Password))
     {
         depError.SetError(txtOldPassword, LanguageEngine.GetMessageCaption("000015", ConfigEngine.Language));
     }
     else
     {
         depError.SetError(txtOldPassword, null);
     }
 }
Ejemplo n.º 7
0
        private bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtStallCode.Text.Trim()))
            {
                depError.SetError(txtStallCode, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtStallCode.Focus();
                return(false);
            }
            if (txtStallCode.Text.Contains(" "))
            {
                depError.SetError(txtStallCode, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtStallCode.Focus();
                return(false);
            }
            if (CommonEngine.CheckExistsUnicodeChar(txtStallCode.Text))
            {
                depError.SetError(txtStallCode, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtStallCode.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtVNName.Text.Trim()))
            {
                depError.SetError(txtVNName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtVNName.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtENName.Text.Trim()))
            {
                depError.SetError(txtENName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtENName.Focus();
                return(false);
            }
            if (gluStore.EditValue == null || gluStore.EditValue.Equals("0"))
            {
                depError.SetError(gluStore, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluStore.Focus();
                return(false);
            }
            if (gluWarehouse.EditValue == null || gluWarehouse.EditValue.Equals("0"))
            {
                depError.SetError(gluWarehouse, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluWarehouse.Focus();
                return(false);
            }


            return(true);
        }
Ejemplo n.º 8
0
        private bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtStoreCode.Text.Trim()))
            {
                depError.SetError(txtStoreCode, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtStoreCode.Focus();
                return(false);
            }
            else if (txtStoreCode.Text.Contains(" "))
            {
                depError.SetError(txtStoreCode, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtStoreCode.Focus();
                return(false);
            }
            else if (CommonEngine.CheckExistsUnicodeChar(txtStoreCode.Text))
            {
                depError.SetError(txtStoreCode, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtStoreCode.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtShortCode.Text.Trim()))
            {
                depError.SetError(txtShortCode, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtShortCode.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtVNName.Text.Trim()))
            {
                depError.SetError(txtVNName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtVNName.Focus();
                return(false);
            }
            else if (string.IsNullOrEmpty(txtENName.Text.Trim()))
            {
                depError.SetError(txtENName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtENName.Focus();
                return(false);
            }
            else if (dteEndDate.EditValue != null && !CommonEngine.CompareDateEdit(dteBuildDate, dteEndDate, false))
            {
                depError.SetError(dteEndDate, LanguageEngine.GetMessageCaption("000025", ConfigEngine.Language));
                dteEndDate.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 9
0
 private void txtUsername_EditValueChanged(object sender, EventArgs e)
 {
     if (txtUsername.Text.Contains(" "))
     {
         depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
     }
     else if (string.IsNullOrEmpty(txtUsername.Text))
     {
         depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
     }
     else if (CommonEngine.CheckExistsUnicodeChar(txtUsername.Text))
     {
         depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
     }
     else
     {
         depError.SetError(txtUsername, null);
     }
 }
Ejemplo n.º 10
0
 private void txtEmail_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(txtEmail, !CommonEngine.CheckValidEmailAddress(txtEmail.Text) ? LanguageEngine.GetMessageCaption("000013", ConfigEngine.Language) : null);
 }
Ejemplo n.º 11
0
 private void gluEmployee_EditValueChanged(object sender, EventArgs e)
 {
     if (chkIsEmployee.Checked)
     {
         depError.SetError(gluEmployee, string.IsNullOrEmpty(gluEmployee.EditValue + "") ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
     }
     else
     {
         depError.SetError(gluEmployee, null);
     }
 }
Ejemplo n.º 12
0
 private void gluGroupUser_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(gluGroupUser, string.IsNullOrEmpty(gluGroupUser.EditValue + "") ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }
Ejemplo n.º 13
0
        private async Task SavePermission(TreeListNodes nodes, bool is_user)
        {
            List <SYS_tblPermissionDTO> permissionList = new List <SYS_tblPermissionDTO>();

            try
            {
                CommonEngine.ShowWaitForm(this);
                SYS_tblPermissionDRO result = new SYS_tblPermissionDRO();
                permissionList = GetAllPermission(nodes);

                foreach (var item in oldPermissionList)
                {
                    var _item = (from per in permissionList
                                 where per.ID == item.ID && per.FunctionID == item.FunctionID
                                 select per).FirstOrDefault();
                    if (_item != null)
                    {
                        if (_item.AllowInsert == item.AllowInsert && _item.AllowUpdate == item.AllowUpdate &&
                            _item.AllowDelete == item.AllowDelete && _item.AllowPrint == item.AllowPrint &&
                            _item.AllowImport == item.AllowImport && _item.AllowExport == item.AllowExport &&
                            _item.AllowAll == item.AllowAll && _item.AllowAccess == item.AllowAccess &&
                            _item.UserLevelID == item.UserLevelID && _item.Note == item.Note)
                        {
                            permissionList.Remove(_item);
                        }
                    }
                }

                string strMessage = LanguageEngine.GetMessageCaption("000024", ConfigEngine.Language).Replace("$Type$", is_user ? (ConfigEngine.Language.Equals("vi") ? "người dùng" : "user") : (ConfigEngine.Language.Equals("vi") ? "nhóm người dùng" : "group user")).Replace("$Name$", trlUser.FocusedNode.GetDisplayText(tlcName));

                result = await SYS_tblPermissionBUS.UpdatePermission(CommonEngine.userInfo.UserID, ConfigEngine.Language, permissionList, is_user, new SYS_tblActionLogDTO
                {
                    Activity      = BaseConstant.COMMAND_INSERT_EN,
                    UserID        = CommonEngine.userInfo.UserID,
                    LanguageID    = ConfigEngine.Language,
                    ActionEN      = BaseConstant.COMMAND_UPDATE_EN,
                    ActionVN      = BaseConstant.COMMAND_UPDATE_VI,
                    FunctionID    = "24",
                    DescriptionVN = strMessage.Replace("$IsError$", "thành công"),
                    DescriptionEN = strMessage.Replace("$IsError$", "successfully")
                });

                CommonEngine.CloseWaitForm();
                if (CommonEngine.CheckValidResponseItem(result.ResponseItem))
                {
                    if (string.IsNullOrEmpty(result.ResponseItem.Message))
                    {
                        CommonEngine.ShowMessage(strMessage.Replace("$IsError$", ConfigEngine.Language.Equals("vi") ? "thành công" : "successfully").Trim(), MessageType.Success);
                    }
                    else
                    {
                        CommonEngine.ShowMessage(strMessage.Replace("$IsError$", ConfigEngine.Language.Equals("vi") ? "thất bại" : "failed").Trim(), MessageType.Error);
                    }

                    await LoadPermission(trlUser.FocusedNode.GetDisplayText(tlcCode) + "", rootNode, trlUser.FocusedNode.Level == 0?false : true);
                }
                else
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                CommonEngine.ShowExceptionMessage(ex);
            }
        }
Ejemplo n.º 14
0
 private void gluLevel1_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(gluLevel1, (string.IsNullOrEmpty(gluLevel1.EditValue + "") || gluLevel1.EditValue.Equals("0")) ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
     if (gluLevel1.EditValue != null)
     {
         LoadLevel2(gluLevel1.EditValue + "");
     }
 }
Ejemplo n.º 15
0
 private void txtENName_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(txtENName, string.IsNullOrEmpty(txtENName.Text.Trim()) ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }
Ejemplo n.º 16
0
 private void dteUnlockDate_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(dteUnlockDate, (dteUnlockDate.EditValue != null && chkLocked.Checked && !CommonEngine.CompareDateEdit(dteLockDate, dteUnlockDate, false)) ? LanguageEngine.GetMessageCaption("000023", ConfigEngine.Language) : null);
 }
Ejemplo n.º 17
0
 private void txtFullName_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(txtFullName, (string.IsNullOrEmpty(txtFullName.Text) && !chkIsEmployee.Checked) ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }
Ejemplo n.º 18
0
 private void gluWarehouse_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(gluWarehouse, gluWarehouse.EditValue == null || gluWarehouse.EditValue.Equals("0") ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }
Ejemplo n.º 19
0
 private void txtNewPassword_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(txtNewPassword, string.IsNullOrEmpty(txtNewPassword.Text) ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }
Ejemplo n.º 20
0
        private async Task DeleteLevel2()
        {
            level2_code_list = "";
            level2_id_list   = "";

            foreach (int index in grvLevel2.GetSelectedRows())
            {
                if (index >= 0)
                {
                    level2_code_list = string.Join("$", level2_code_list, grvLevel2.GetRowCellDisplayText(index, gcolLevel2Code));
                    level2_id_list   = string.Join("$", level2_id_list, grvLevel2.GetRowCellDisplayText(index, gcolLevel2ID));
                }
            }

            if (level2_code_list.Length > 0)
            {
                level2_code_list = level2_code_list.Substring(1);
            }
            if (level2_id_list.Length > 0)
            {
                level2_id_list = level2_id_list.Substring(1);
            }

            if (!string.IsNullOrEmpty(level2_id_list))
            {
                PRO_tblLevel2DRO result = new PRO_tblLevel2DRO();
                result.ResponseItem.Message = "ready";
                try
                {
                    if (level2_id_list.Contains("$"))
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000012", ConfigEngine.Language).Replace("$Count$", level2_id_list.Split('$').Length.ToString())))
                        {
                            CommonEngine.ShowWaitForm(this);
                            result = await PRO_tblLevel2BUS.DeleteLevel2(CommonEngine.userInfo.Username, ConfigEngine.Language, level2_id_list, new SYS_tblActionLogDTO
                            {
                                Activity      = BaseConstant.COMMAND_INSERT_EN,
                                UserID        = CommonEngine.userInfo.UserID,
                                LanguageID    = ConfigEngine.Language,
                                ActionVN      = BaseConstant.COMMAND_DELETE_VI,
                                ActionEN      = BaseConstant.COMMAND_DELETE_EN,
                                FunctionID    = "21",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công những nhóm hàng có mã '{1}'.", CommonEngine.userInfo.UserID, level2_code_list.Replace("$", ", ")),
                                DescriptionEN = string.Format("Account '{0}' has deleted product groups successfully with group codes are '{1}'.", CommonEngine.userInfo.UserID, level2_code_list.Replace("$", ", "))
                            });
                        }
                    }
                    else
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000005", ConfigEngine.Language)))
                        {
                            CommonEngine.ShowWaitForm(this);
                            result = await PRO_tblLevel2BUS.DeleteLevel2(CommonEngine.userInfo.Username, ConfigEngine.Language, level2_id_list, new SYS_tblActionLogDTO
                            {
                                Activity      = BaseConstant.COMMAND_INSERT_EN,
                                UserID        = CommonEngine.userInfo.UserID,
                                LanguageID    = ConfigEngine.Language,
                                ActionVN      = BaseConstant.COMMAND_DELETE_VI,
                                ActionEN      = BaseConstant.COMMAND_DELETE_EN,
                                FunctionID    = "21",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công nhóm hàng có mã '{1}'.", CommonEngine.userInfo.UserID, level2_code_list),
                                DescriptionEN = string.Format("Account '{0}' has deleted product group successfully with group code is '{1}'.", CommonEngine.userInfo.UserID, level2_code_list)
                            });
                        }
                    }

                    if (!CommonEngine.CheckValidResponseItem(result.ResponseItem))
                    {
                        return;
                    }
                    if (!result.ResponseItem.Message.Equals("ready"))
                    {
                        if (string.IsNullOrEmpty(result.ResponseItem.Message))
                        {
                            GetAllLevel2();
                        }
                        else
                        {
                            CommonEngine.ShowMessage(result.ResponseItem.Message, 0);
                        }
                    }
                }
                catch (Exception ex)
                {
                    CommonEngine.ShowExceptionMessage(ex);
                }
                finally
                {
                    CommonEngine.CloseWaitForm();
                }
            }
            else
            {
                CommonEngine.ShowMessage(LanguageEngine.GetMessageCaption("000027", ConfigEngine.Language), MessageType.Error);
            }
        }
Ejemplo n.º 21
0
 private void dteToDate_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(dteToDate, (!CommonEngine.CompareDateEdit(dteEffectiveDate, dteToDate, false) && dteToDate.EditValue != null) ? LanguageEngine.GetMessageCaption("000022", ConfigEngine.Language) : null);
 }
Ejemplo n.º 22
0
        private async Task DeleteStall()
        {
            stall_code_list = "";
            stall_id_list   = "";
            foreach (int index in grvStall.GetSelectedRows())
            {
                stall_code_list = string.Join("$", stall_code_list, grvStall.GetRowCellDisplayText(index, gcolStallCode));
                stall_id_list   = string.Join("$", stall_id_list, grvStall.GetRowCellDisplayText(index, gcolStallID));
            }

            if (stall_code_list.Length > 0)
            {
                stall_code_list = stall_code_list.Substring(1);
            }
            if (stall_id_list.Length > 0)
            {
                stall_id_list = stall_id_list.Substring(1);
            }

            PRO_tblStallDRO result = new PRO_tblStallDRO();

            result.ResponseItem.Message = "ready";
            if (!string.IsNullOrEmpty(stall_id_list))
            {
                try
                {
                    if (stall_id_list.Contains("$"))
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000012", ConfigEngine.Language).Replace("$Count$", stall_id_list.Split('$').Length.ToString())))
                        {
                            CommonEngine.ShowWaitForm(this);
                            result = await PRO_tblStallBUS.DeleteStall(stall_id_list, CommonEngine.userInfo.Username, ConfigEngine.Language, new SYS_tblActionLogDTO
                            {
                                Activity      = BaseConstant.COMMAND_INSERT_EN,
                                UserID        = CommonEngine.userInfo.UserID,
                                LanguageID    = ConfigEngine.Language,
                                ActionVN      = BaseConstant.COMMAND_DELETE_VI,
                                ActionEN      = BaseConstant.COMMAND_DELETE_EN,
                                FunctionID    = "19",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công những quầy bán có mã '{1}'.", CommonEngine.userInfo.UserID, stall_code_list.Replace("$", ", ")),
                                DescriptionEN = string.Format("Account '{0}' has deleted stalls successfully with stall codes are '{1}'.", CommonEngine.userInfo.UserID, stall_code_list.Replace("$", ", "))
                            });
                        }
                    }
                    else
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000005", ConfigEngine.Language)))
                        {
                            CommonEngine.ShowWaitForm(this);
                            result = await PRO_tblStallBUS.DeleteStall(stall_id_list, CommonEngine.userInfo.Username, ConfigEngine.Language, new SYS_tblActionLogDTO
                            {
                                Activity      = BaseConstant.COMMAND_INSERT_EN,
                                UserID        = CommonEngine.userInfo.UserID,
                                LanguageID    = ConfigEngine.Language,
                                ActionVN      = BaseConstant.COMMAND_DELETE_VI,
                                ActionEN      = BaseConstant.COMMAND_DELETE_EN,
                                FunctionID    = "19",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công quầy bán có mã '{1}'.", CommonEngine.userInfo.UserID, stall_code_list),
                                DescriptionEN = string.Format("Account '{0}' has deleted stall successfully with stall code is '{1}'.", CommonEngine.userInfo.UserID, stall_code_list)
                            });
                        }
                    }

                    if (!CommonEngine.CheckValidResponseItem(result.ResponseItem))
                    {
                        return;
                    }
                    if (!result.ResponseItem.Message.Equals("ready"))
                    {
                        if (string.IsNullOrEmpty(result.ResponseItem.Message))
                        {
                            GetAllStall("", "");
                        }
                        else
                        {
                            CommonEngine.ShowMessage(result.ResponseItem.Message, 0);
                        }
                    }
                }
                catch (Exception ex)
                {
                    CommonEngine.ShowExceptionMessage(ex);
                }
                finally
                {
                    CommonEngine.CloseWaitForm();
                }
            }
            else
            {
                CommonEngine.ShowMessage("000027", IMC.Helper.MessageType.Warning, true);
            }
        }
Ejemplo n.º 23
0
        public bool CheckValidate()
        {
            if (string.IsNullOrEmpty(txtUsername.Text))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (txtUsername.Text.Contains(" "))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000004", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (CommonEngine.CheckExistsUnicodeChar(txtUsername.Text))
            {
                depError.SetError(txtUsername, LanguageEngine.GetMessageCaption("000021", ConfigEngine.Language));
                txtUsername.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                depError.SetError(txtPassword, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtPassword.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(gluGroupUser.EditValue + ""))
            {
                depError.SetError(gluGroupUser, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluGroupUser.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(txtFullName.Text) && !chkIsEmployee.Checked)
            {
                depError.SetError(txtFullName, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                txtFullName.Focus();
                return(false);
            }
            if (chkIsEmployee.Checked && string.IsNullOrEmpty(gluEmployee.EditValue + ""))
            {
                depError.SetError(gluEmployee, LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language));
                gluEmployee.Focus();
                return(false);
            }
            if (dteToDate.EditValue != null && !CommonEngine.CompareDateEdit(dteEffectiveDate, dteToDate, false))
            {
                depError.SetError(dteToDate, LanguageEngine.GetMessageCaption("000022", ConfigEngine.Language));
                dteToDate.Focus();
                return(false);
            }
            if (chkLocked.Checked && dteUnlockDate.EditValue != null && !CommonEngine.CompareDateEdit(dteLockDate, dteUnlockDate, false))
            {
                depError.SetError(dteUnlockDate, LanguageEngine.GetMessageCaption("000023", ConfigEngine.Language));
                dteUnlockDate.Focus();
                return(false);
            }
            if (!CommonEngine.CheckValidEmailAddress(txtEmail.Text.Trim()))
            {
                depError.SetError(txtEmail, LanguageEngine.GetMessageCaption("000013", ConfigEngine.Language));
                txtEmail.Focus();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 24
0
 private void gluProvince_EditValueChanged(object sender, EventArgs e)
 {
     depError.SetError(gluProvince, (string.IsNullOrEmpty(gluProvince.EditValue + "") || gluProvince.EditValue.Equals("0")) ? LanguageEngine.GetMessageCaption("000003", ConfigEngine.Language) : null);
 }