예제 #1
0
        public async void GetAllStall(string store_id, string warehouse_id)
        {
            try
            {
                gridStall.DataBindings.Clear();
                PRO_tblStallDRO stalls = await PRO_tblStallBUS.GetAllStall(CommonEngine.userInfo.UserID, ConfigEngine.Language, false, store_id, warehouse_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    = "19",
                    DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu quầy bán.", CommonEngine.userInfo.UserID),
                    DescriptionEN = string.Format("Account '{0}' downloaded successfully data of stalls.", CommonEngine.userInfo.UserID)
                });

                if (!CommonEngine.CheckValidResponseItem(stalls.ResponseItem))
                {
                    return;
                }
                gridStall.DataSource = stalls.StallList != null ? stalls.StallList : null;
                barFooter.Visible    = (stalls.StallList != null && stalls.StallList.Count > 0) ? true : false;
                CommonEngine.LoadUserPermission("19", btnDelete, btnPrint, btnImport, btnExport);
            }
            catch (Exception ex)
            {
                CommonEngine.ShowExceptionMessage(ex);
            }
        }
예제 #2
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";

            grvStall.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";
            gcolStallCode.Caption     = Language.Equals("VN") ? "Mã quầy bán" : "Stall code";
            gcolStallName.Caption     = Language.Equals("VN") ? "Tên quầy bán" : "Stall name";
            gcolStoreName.Caption     = Language.Equals("VN") ? "Cửa hàng" : "Store";
            gcolWarehouseName.Caption = Language.Equals("VN") ? "Kho hàng" : "Warehouse";
            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";

            busStall      = new PRO_tblStallBUS();
            busPermission = new SYS_tblPermissionBUS();
        }
예제 #3
0
        private async void btnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (curItem.Count > 0)
            {
                PRO_tblStallDRO item = await PRO_tblStallBUS.GetStallItem(CommonEngine.userInfo.UserID, ConfigEngine.Language, curItem[0].StallID);

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

                if (item != null && item.StallItem != null)
                {
                    CommonEngine.OpenInputForm(new uc_StallDetail(this, item.StallItem), new Size(395, 300), true);
                }
            }
        }
예제 #4
0
        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();
        }
예제 #5
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);
            }
        }