Exemple #1
0
        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";

            grvWarehouse.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";
            gcolWarehouseCode.Caption    = Language.Equals("VN") ? "Mã kho hàng" : "Warehouse code";
            gcolWarehouseName.Caption    = Language.Equals("VN") ? "Tên kho hàng" : "Warehouse name";
            gcolWarehouseAddress.Caption = Language.Equals("VN") ? "Địa chỉ kho hàng" : "Warehouse address";
            gcolPhone.Caption            = Language.Equals("VN") ? "Số điện thoại" : "Phone";
            gcolRank.Caption             = Language.Equals("VN") ? "Thứ tự" : "Rank";
            gcolUsedString.Caption       = Language.Equals("VN") ? "Đang hoạt động?" : "Are active?";
            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";
            gcolStoreName.Caption        = Language.Equals("VN") ? "Cửa hàng" : "Store";

            busWarehouse  = new PRO_tblWarehouseBUS();
            busPermission = new SYS_tblPermissionBUS();
        }
Exemple #2
0
        public async void GetAllWarehouse(string store_id)
        {
            try
            {
                gridWarehouse.DataBindings.Clear();
                PRO_tblWarehouseDRO warehouses = await PRO_tblWarehouseBUS.GetAllWarehouses(CommonEngine.userInfo.UserID, ConfigEngine.Language, false, store_id, "", "", 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    = "18",
                    DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu kho hàng.", CommonEngine.userInfo.UserID),
                    DescriptionEN = string.Format("Account '{0}' downloaded successfully data of warehouses.", CommonEngine.userInfo.UserID)
                });

                if (!CommonEngine.CheckValidResponseItem(warehouses.ResponseItem))
                {
                    return;
                }
                gridWarehouse.DataSource = warehouses.WarehouseList != null ? warehouses.WarehouseList : null;
                barFooter.Visible        = (warehouses.WarehouseList != null && warehouses.WarehouseList.Count > 0) ? true : false;
                CommonEngine.LoadUserPermission("18", 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();
        }
Exemple #4
0
        private async void LoadWarehouseByStoreID(string store_id)
        {
            gluWarehouse.DataBindings.Clear();
            PRO_tblWarehouseDRO warehouses = await PRO_tblWarehouseBUS.GetAllWarehouses(CommonEngine.userInfo.UserID, ConfigEngine.Language, true, store_id, "", "", null);

            if (warehouses.ResponseItem.IsError)
            {
                CommonEngine.ShowHTTPErrorMessage(warehouses.ResponseItem);
                gluWarehouse.Properties.DataSource = null;
                return;
            }
            gluWarehouse.Properties.DataSource    = warehouses.WarehouseList;
            gluWarehouse.Properties.ValueMember   = "WarehouseID";
            gluWarehouse.Properties.DisplayMember = "FullWarehouseName";
        }
Exemple #5
0
        private async void btnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (curItem.Count > 0)
            {
                PRO_tblWarehouseDRO item = await PRO_tblWarehouseBUS.GetWarehouseItem(CommonEngine.userInfo.UserID, ConfigEngine.Language, curItem[0].WarehouseID);

                if (!CommonEngine.CheckValidResponseItem(item.ResponseItem))
                {
                    return;
                }

                if (item != null && item.WarehouseItem != null)
                {
                    CommonEngine.OpenInputForm(new uc_WarehouseDetail(this, item.WarehouseItem), new Size(410, 400), true);
                }
            }
        }
        private void Initialize()
        {
            string LanguageID = User.UserInfo.LanguageID;

            logDetail.Text    = LanguageID.Equals("VN") ? "Thông Tin Quầy Bán" : "Stall Information";
            lciStallCode.Text = LanguageID.Equals("VN") ? "Mã quầy:" : "Stall code:";
            lciVNName.Text    = LanguageID.Equals("VN") ? "Tên quầy VN:" : "VN Stall name:";
            lciENName.Text    = LanguageID.Equals("VN") ? "Tên quầy EN:" : "EN Stall name:";
            lciWarehouse.Text = LanguageID.Equals("VN") ? "Kho hàng:" : "Warehouse:";
            gluWarehouse.Properties.NullText = LanguageID.Equals("VN") ? "[Chọn kho hàng]" : "[Choose warehouse]";
            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";

            busStall      = new PRO_tblStallBUS();
            busWarehouse  = new PRO_tblWarehouseBUS();
            busPermission = new SYS_tblPermissionBUS();
            busWarehouse  = new PRO_tblWarehouseBUS();
            LoadWarehouse();
        }
Exemple #7
0
        private async Task DeleteWarehouse()
        {
            warehouse_code_list = "";
            warehouse_id_list   = "";
            foreach (int index in grvWarehouse.GetSelectedRows())
            {
                warehouse_code_list = string.Join("$", warehouse_code_list, grvWarehouse.GetRowCellDisplayText(index, gcolWarehouseCode));
                warehouse_id_list   = string.Join("$", warehouse_id_list, grvWarehouse.GetRowCellDisplayText(index, gcolWarehouseID));
            }

            if (warehouse_code_list.Length > 0)
            {
                warehouse_code_list = warehouse_code_list.Substring(1);
            }
            if (warehouse_id_list.Length > 0)
            {
                warehouse_id_list = warehouse_id_list.Substring(1);
            }

            PRO_tblWarehouseDRO result = new PRO_tblWarehouseDRO();

            result.ResponseItem.Message = "ready";
            if (!string.IsNullOrEmpty(warehouse_id_list))
            {
                try
                {
                    if (warehouse_id_list.Contains("$"))
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000012", ConfigEngine.Language).Replace("$Count$", warehouse_id_list.Split('$').Length.ToString())))
                        {
                            result = await PRO_tblWarehouseBUS.DeleteWarehouse(warehouse_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    = "18",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công những kho hàng có mã '{1}'.", CommonEngine.userInfo.UserID, warehouse_code_list.Replace("$", ", ")),
                                DescriptionEN = string.Format("Account '{0}' has deleted warehouses successfully with warehouse codes are '{1}'.", CommonEngine.userInfo.UserID, warehouse_code_list.Replace("$", ", "))
                            });
                        }
                    }
                    else
                    {
                        if (CommonEngine.ShowConfirmMessageAlert(LanguageEngine.GetMessageCaption("000005", ConfigEngine.Language)))
                        {
                            result = await PRO_tblWarehouseBUS.DeleteWarehouse(warehouse_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    = "18",
                                DescriptionVN = string.Format("Tài khoản '{0}' vừa xóa thành công kho hàng có mã '{1}'.", CommonEngine.userInfo.UserID, warehouse_code_list),
                                DescriptionEN = string.Format("Account '{0}' has deleted warehouse successfully with warehouse code is '{1}'.", CommonEngine.userInfo.UserID, warehouse_code_list)
                            });
                        }
                    }

                    if (!CommonEngine.CheckValidResponseItem(result.ResponseItem))
                    {
                        return;
                    }
                    if (!result.ResponseItem.Message.Equals("ready"))
                    {
                        if (string.IsNullOrEmpty(result.ResponseItem.Message))
                        {
                            GetAllWarehouse("");
                        }
                        else
                        {
                            CommonEngine.ShowMessage(result.ResponseItem.Message, 0);
                        }
                    }
                }
                catch (Exception ex)
                {
                    CommonEngine.ShowExceptionMessage(ex);
                }
            }
            else
            {
                CommonEngine.ShowMessage("000027", IMC.Helper.MessageType.Warning, true);
            }
        }