private void Initialize() { string Language = User.UserInfo.LanguageID; btnInsert.Caption = (Language.Equals("VN")) ? "Thêm" : "Insert"; btnUpdate.Caption = (Language.Equals("VN")) ? "Cập Nhật" : "Update"; btnDelete.Caption = (Language.Equals("VN")) ? "Xóa" : "Delete"; btnPrint.Caption = (Language.Equals("VN")) ? "In" : "Print"; btnReload.Caption = (Language.Equals("VN")) ? "Tải Lại" : "Reload"; btnImport.Caption = (Language.Equals("VN")) ? "Nhập" : "Import"; btnExport.Caption = (Language.Equals("VN")) ? "Xuất" : "Export"; btnClose.Caption = (Language.Equals("VN")) ? "Đóng" : "Close"; grvStore.GroupPanelText = (Language.Equals("VN")) ? "Kéo một tiêu đề cột vào đây để nhóm theo cột đó" : "Drag a column header here to group by that column"; gcolStoreCode.Caption = Language.Equals("VN") ? "Mã cửa hàng" : "Store code"; gcolShortCode.Caption = Language.Equals("VN") ? "Mã nội bộ" : "Internal code"; gcolStoreName.Caption = Language.Equals("VN") ? "Tên cửa hàng" : "Store name"; gcolStoreAddress.Caption = Language.Equals("VN") ? "Địa chỉ cửa hàng" : "Store address"; gcolBuildDate.Caption = Language.Equals("VN") ? "Ngày thành lập" : "Date of establishment"; gcolPhone.Caption = Language.Equals("VN") ? "Số điện thoại" : "Phone"; gcolTaxCode.Caption = Language.Equals("VN") ? "Mã số thuế" : "Tax code"; gcolRank.Caption = Language.Equals("VN") ? "Thứ tự" : "Rank"; gcolRepresentatives.Caption = Language.Equals("VN") ? "Người đại diện" : "Representative"; gcolUsedString.Caption = Language.Equals("VN") ? "Đang hoạt động?" : "Are active?"; gcolIsRootString.Caption = Language.Equals("VN") ? "Cửa hàng chính?" : "Is primary store?"; gcolNote.Caption = Language.Equals("VN") ? "Ghi chú" : "Note"; gcolProvinceName.Caption = Language.Equals("VN") ? "Tỉnh thành" : "Province name"; gcolDistrictName.Caption = Language.Equals("VN") ? "Quận huyện" : "Distict name"; busStore = new PRO_tblStoreBUS(); busPermission = new SYS_tblPermissionBUS(); }
public async void GetAllStore() { try { gridStore.DataBindings.Clear(); PRO_tblStoreDRO stores = await PRO_tblStoreBUS.GetAllStores(CommonEngine.userInfo.UserID, ConfigEngine.Language, false, new SYS_tblActionLogDTO { Activity = BaseConstant.COMMAND_INSERT_EN, UserID = CommonEngine.userInfo.UserID, LanguageID = ConfigEngine.Language, ActionEN = BaseConstant.COMMAND_LOAD_ALL_DATA_EN, ActionVN = BaseConstant.COMMAND_LOAD_ALL_DATA_VI, FunctionID = "13", DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu cửa hàng.", CommonEngine.userInfo.UserID), DescriptionEN = string.Format("Account '{0}' downloaded successfully data of stores.", CommonEngine.userInfo.UserID) }); if (!CommonEngine.CheckValidResponseItem(stores.ResponseItem)) { return; } gridStore.DataSource = stores.StoreList != null ? stores.StoreList : null; barFooter.Visible = (stores.StoreList != null && stores.StoreList.Count > 0) ? true : false; CommonEngine.LoadUserPermission("13", btnDelete, btnPrint, btnImport, btnExport); } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); } }
private void Initialize() { string LanguageID = User.UserInfo.LanguageID; logDetail.Text = LanguageID.Equals("VN") ? "Thông Tin Kho Hàng" : "Warehouse Information"; lciWarehouseCode.Text = LanguageID.Equals("VN") ? "Mã kho hàng:" : "Warehouse code:"; lciVNName.Text = LanguageID.Equals("VN") ? "Tên kho hàng VN:" : "VN Warehouse name:"; lciENName.Text = LanguageID.Equals("VN") ? "Tên kho hàng EN:" : "EN Warehouse name:"; lciStore.Text = LanguageID.Equals("VN") ? "Cửa hàng:" : "Store:"; gluStore.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn cửa hàng]" : "[Choose store]"; lciAddressVN.Text = LanguageID.Equals("VN") ? "Địa chỉ VN:" : "VN Address:"; lciAddressEN.Text = LanguageID.Equals("VN") ? "Địa chỉ EN:" : "EN Address:"; lciProvince.Text = LanguageID.Equals("VN") ? "Tỉnh thành:" : "Province:"; lciDistrict.Text = LanguageID.Equals("VN") ? "Quận huyện:" : "District:"; gluProvince.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn tỉnh thành]" : "[Choose province]"; gluDistrict.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn quận huyện]" : "[Choose district]"; lciPhone.Text = LanguageID.Equals("VN") ? "Số điện thoại:" : "Phone:"; lciFax.Text = LanguageID.Equals("VN") ? "Fax:" : "Fax:"; lciRank.Text = LanguageID.Equals("VN") ? "Thứ tự:" : "Rank:"; chkUsed.Text = LanguageID.Equals("VN") ? "Đang hoạt động?" : "Are active?"; lciNote.Text = LanguageID.Equals("VN") ? "Ghi chú:" : "Note:"; btnSaveClose.Text = (LanguageID.Equals("VN")) ? "Lưu && Đóng" : "Save && Close"; btnSaveInsert.Text = (LanguageID.Equals("VN")) ? "Lưu && Thêm" : "Save && Insert"; btnCancel.Text = (LanguageID.Equals("VN")) ? "Hủy Bỏ" : "Cancel"; busProvince = new PRO_tblProvinceBUS(); busDistrict = new PRO_tblDistrictBUS(); busStore = new PRO_tblStoreBUS(); busPermission = new SYS_tblPermissionBUS(); busWarehouse = new PRO_tblWarehouseBUS(); LoadStore(); LoadProvince(); }
private async void LoadStore() { gluStore.DataBindings.Clear(); PRO_tblStoreDRO stores = await PRO_tblStoreBUS.GetAllStores(CommonEngine.userInfo.UserID, ConfigEngine.Language, true, null); if (stores.ResponseItem.IsError) { CommonEngine.ShowHTTPErrorMessage(stores.ResponseItem); gluStore.Properties.DataSource = null; return; } gluStore.Properties.DataSource = stores.StoreList; gluStore.Properties.ValueMember = "StoreID"; gluStore.Properties.DisplayMember = "FullStoreName"; }
private async void btnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (curItem.Count > 0) { PRO_tblStoreDRO item = await PRO_tblStoreBUS.GetStoreItem(CommonEngine.userInfo.UserID, ConfigEngine.Language, curItem[0].StoreID); if (!CommonEngine.CheckValidResponseItem(item.ResponseItem)) { return; } if (item != null && item.StoreItem != null) { CommonEngine.OpenInputForm(new uc_StoreDetail(this, item.StoreItem), new Size(660, 400), true); } } }
private void Initialize() { string LanguageID = User.UserInfo.LanguageID; logDetail.Text = LanguageID.Equals("VN") ? "Thông Tin Cửa Hàng" : "Store Information"; lciStoreCode.Text = LanguageID.Equals("VN") ? "Mã cửa hàng:" : "Store code:"; lciShortCode.Text = LanguageID.Equals("VN") ? "Mã nội bộ:" : "Internal code:"; lciVNName.Text = LanguageID.Equals("VN") ? "Tên cửa hàng VN:" : "VN Store name:"; lciENName.Text = LanguageID.Equals("VN") ? "Tên cửa hàng EN:" : "EN Store name:"; picPhoto.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn ảnh logo]" : "[Choose logo picture]"; lciBuildDate.Text = LanguageID.Equals("VN") ? "Ngày thành lập:" : "Date of establishment:"; lciEndDate.Text = LanguageID.Equals("VN") ? "Ngày ngừng hoạt động:" : "Date of decommissioned:"; lciAddressVN.Text = LanguageID.Equals("VN") ? "Địa chỉ VN:" : "VN Address:"; lciAddressEN.Text = LanguageID.Equals("VN") ? "Địa chỉ EN:" : "EN Address:"; lciProvince.Text = LanguageID.Equals("VN") ? "Tỉnh thành:" : "Province:"; lciDistrict.Text = LanguageID.Equals("VN") ? "Quận huyện:" : "District:"; gluProvince.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn tỉnh thành]" : "[Choose province]"; gluDistrict.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn quận huyện]" : "[Choose district]"; lciPhone.Text = LanguageID.Equals("VN") ? "Số điện thoại:" : "Phone:"; lciFax.Text = LanguageID.Equals("VN") ? "Fax:" : "Fax:"; lciTaxCode.Text = LanguageID.Equals("VN") ? "Mã số thuế:" : "Tax code:"; lciRank.Text = LanguageID.Equals("VN") ? "Thứ tự:" : "Rank:"; lciRepresentives.Text = LanguageID.Equals("VN") ? "Người đại diện:" : "Representative:"; chkIsRoot.Text = LanguageID.Equals("VN") ? "Là cửa hàng chính?" : "Is the primary store?"; chkUsed.Text = LanguageID.Equals("VN") ? "Đang hoạt động?" : "Are active?"; lciNote.Text = LanguageID.Equals("VN") ? "Ghi chú:" : "Note:"; btnSaveClose.Text = (LanguageID.Equals("VN")) ? "Lưu && Đóng" : "Save && Close"; btnSaveInsert.Text = (LanguageID.Equals("VN")) ? "Lưu && Thêm" : "Save && Insert"; btnCancel.Text = (LanguageID.Equals("VN")) ? "Hủy Bỏ" : "Cancel"; dteBuildDate.EditValue = DateTime.Now; busProvince = new PRO_tblProvinceBUS(); busDistrict = new PRO_tblDistrictBUS(); busPermission = new SYS_tblPermissionBUS(); busStore = new PRO_tblStoreBUS(); LoadProvince(); }
private async Task <bool> SaveStore(bool isEdit) { CommonEngine.ShowWaitForm(this.ParentForm); string file_name = ""; PRO_tblStoreDRO result = new PRO_tblStoreDRO(); try { if (!string.IsNullOrEmpty(new_file_path)) { Bitmap image = (Bitmap)Bitmap.FromFile(new_file_path); file_name = await iPOS.BUS.Tools.OBJ_FileBUS.UploadImageFile(image, "Stores"); } result = await PRO_tblStoreBUS.InsertUpdateStore(new PRO_tblStoreDTO { StoreID = isEdit ? txtStoreID.Text : "0", StoreCode = txtStoreCode.Text, ShortCode = txtShortCode.Text, VNName = txtVNName.Text, ENName = txtENName.Text, BuildDate = dteBuildDate.EditValue != null ? dteBuildDate.DateTime : (DateTime?)null, EndDate = dteEndDate.EditValue != null ? dteEndDate.DateTime : (DateTime?)null, AddressEN = txtAddressEN.Text, AddressVN = txtAddressVN.Text, ProvinceID = gluProvince.EditValue + "", DistrictID = gluDistrict.EditValue + "", Phone = txtPhone.Text, Fax = txtFax.Text, TaxCode = txtTaxCode.Text, Rank = speRank.EditValue != null ? Convert.ToInt32(speRank.EditValue) : (Int32?)null, Representatives = txtRepresentives.Text, IsRoot = chkIsRoot.Checked, Used = chkUsed.Checked, Note = mmoNote.Text, Photo = file_name, UserID = CommonEngine.userInfo.UserID, LanguageID = ConfigEngine.Language, Activity = isEdit ? BaseConstant.COMMAND_UPDATE_EN : BaseConstant.COMMAND_INSERT_EN }, new DTO.Systems.SYS_tblActionLogDTO { Activity = BaseConstant.COMMAND_INSERT_EN, UserID = CommonEngine.userInfo.UserID, LanguageID = ConfigEngine.Language, ActionEN = isEdit ? BaseConstant.COMMAND_UPDATE_EN : BaseConstant.COMMAND_INSERT_EN, ActionVN = isEdit ? BaseConstant.COMMAND_UPDATE_VI : BaseConstant.COMMAND_INSERT_VI, FunctionID = "13", DescriptionVN = string.Format("Tài khoản '{0}' vừa {1} thành công cửa hàng có mã cửa hàng là '{2}'.", CommonEngine.userInfo.UserID, isEdit ? "cập nhật" : "thêm mới", txtStoreCode.Text), DescriptionEN = string.Format("Account '{0}' has {1} store successfully with store code is '{2}'.", CommonEngine.userInfo.UserID, isEdit ? "updated" : "inserted", txtStoreCode.Text) }); if (CommonEngine.CheckValidResponseItem(result.ResponseItem)) { if (!string.IsNullOrEmpty(result.ResponseItem.Message)) { CommonEngine.CloseWaitForm(); CommonEngine.ShowMessage(result.ResponseItem.Message, 0); txtStoreCode.Focus(); return(false); } else if (parent_form != null) { parent_form.GetAllStore(); } } else { CommonEngine.CloseWaitForm(); return(false); } } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); return(false); } finally { CommonEngine.CloseWaitForm(); } return(true); }
private async Task DeleteStore() { store_code_list = ""; store_id_list = ""; foreach (int index in grvStore.GetSelectedRows()) { store_code_list = string.Join("$", store_code_list, grvStore.GetRowCellDisplayText(index, gcolStoreCode)); store_id_list = string.Join("$", store_id_list, grvStore.GetRowCellDisplayText(index, gcolStoreID)); } if (store_code_list.Length > 0) { store_code_list = store_code_list.Substring(1); } if (store_id_list.Length > 0) { store_id_list = store_id_list.Substring(1); } PRO_tblStoreDRO result = new PRO_tblStoreDRO(); result.ResponseItem.Message = "ready"; if (!string.IsNullOrEmpty(store_id_list)) { try { if (store_id_list.Contains("$")) { if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000012", ConfigEngine.Language).Replace("$Count$", store_id_list.Split('$').Length.ToString()))) { CommonEngine.ShowWaitForm(this); result = await PRO_tblStoreBUS.DeleteStore(CommonEngine.userInfo.Username, ConfigEngine.Language, store_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 = "13", DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công những cửa hàng có mã '{1}'.", CommonEngine.userInfo.UserID, store_code_list.Replace("$", ", ")), DescriptionEN = string.Format("Account '{0}' has deleted stores successfully with store codes are '{1}'.", CommonEngine.userInfo.UserID, store_code_list.Replace("$", ", ")) }); } } else { if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000005", ConfigEngine.Language))) { CommonEngine.ShowWaitForm(this); result = await PRO_tblStoreBUS.DeleteStore(CommonEngine.userInfo.Username, ConfigEngine.Language, store_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 = "13", DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công cửa hàng có mã '{1}'.", CommonEngine.userInfo.UserID, store_code_list), DescriptionEN = string.Format("Account '{0}' has deleted store successfully with store code is '{1}'.", CommonEngine.userInfo.UserID, store_code_list) }); } } if (result.ResponseItem.IsError) { CommonEngine.ShowHTTPErrorMessage(result.ResponseItem); return; } if (!result.ResponseItem.Message.Equals("ready")) { if (string.IsNullOrEmpty(result.ResponseItem.Message)) { GetAllStore(); } else { CommonEngine.ShowMessage(result.ResponseItem.Message, 0); } } } catch (Exception ex) { CommonEngine.ShowExceptionMessage(ex); } } else { CommonEngine.ShowMessage("000027", IMC.Helper.MessageType.Warning, true); } }