Beispiel #1
0
        public async void GetAllLevel3(string level1_id = "", string level2_id = "")
        {
            try
            {
                gridLevel3.DataBindings.Clear();
                PRO_tblLevel3DRO level3s = await PRO_tblLevel3BUS.GetAllLevel3(CommonEngine.userInfo.UserID, ConfigEngine.Language, level1_id, level2_id, false, new DTO.Systems.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    = "22",
                    DescriptionVN = string.Format("Tài khoản '{0}' vừa tải thành công dữ liệu phân nhóm hàng.", CommonEngine.userInfo.UserID),
                    DescriptionEN = string.Format("Account '{0}' downloaded successfully data of product subgroup.", CommonEngine.userInfo.UserID)
                });

                if (!CommonEngine.CheckValidResponseItem(level3s.ResponseItem))
                {
                    return;
                }
                gridLevel3.DataSource = level3s.Level3List != null ? level3s.Level3List : null;
                barBottom.Visible     = (level3s.Level3List != null && level3s.Level3List.Count > 0) ? true : false;
                CommonEngine.LoadUserPermission("22", btnDelete, btnPrint, btnImport, btnExport);
            }
            catch (Exception ex)
            {
                CommonEngine.ShowExceptionMessage(ex);
            }
        }
Beispiel #2
0
        private async void btnUpdate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (curItem.Count > 0)
            {
                PRO_tblLevel3DRO item = await PRO_tblLevel3BUS.GetLevel3ByID(CommonEngine.userInfo.UserID, ConfigEngine.Language, curItem[0].Level3ID);

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

                if (item != null && item.Level3Item != null)
                {
                    CommonEngine.OpenInputForm(new uc_Level3Detail(this, item.Level3Item), new Size(450, 320), true);
                }
            }
        }
Beispiel #3
0
        private async Task <bool> SaveLevel3(bool isEdit)
        {
            CommonEngine.ShowWaitForm(this);
            PRO_tblLevel3DRO result = new PRO_tblLevel3DRO();

            try
            {
                result = await PRO_tblLevel3BUS.InsertUpdateLevel3(new PRO_tblLevel3DTO
                {
                    Level3ID        = isEdit ? txtLevel3ID.Text : "0",
                    Level3Code      = txtLevel3Code.Text.Trim(),
                    Level3ShortCode = txtLevel3ShortCode.Text.Trim(),
                    Level1ID        = gluLevel1.EditValue + "",
                    Level2ID        = gluLevel2.EditValue + "",
                    VNName          = txtVNName.Text.Trim(),
                    ENName          = txtENName.Text.Trim(),
                    Rank            = speRank.Text.Trim(),
                    Used            = chkUsed.Checked,
                    Note            = mmoNote.Text.Trim(),
                    Description     = mmoDescription.Text.Trim(),
                    Activity        = isEdit ? BaseConstant.COMMAND_UPDATE_EN : BaseConstant.COMMAND_INSERT_EN,
                    UserID          = CommonEngine.userInfo.UserID,
                    LanguageID      = ConfigEngine.Language
                }, 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    = "22",
                    DescriptionVN = string.Format("Tài khoản '{0}' vừa {1} thành công phân nhóm có mã phân nhóm là '{2}'.", CommonEngine.userInfo.UserID, isEdit ? "cập nhật" : "thêm mới", txtLevel3Code.Text),
                    DescriptionEN = string.Format("Account '{0}' has {1} product subgroup successfully with subgroup code is '{2}'.", CommonEngine.userInfo.UserID, isEdit ? "updated" : "inserted", txtLevel3Code.Text)
                });

                if (CommonEngine.CheckValidResponseItem(result.ResponseItem))
                {
                    if (!string.IsNullOrEmpty(result.ResponseItem.Message))
                    {
                        CommonEngine.CloseWaitForm();
                        CommonEngine.ShowMessage(result.ResponseItem.Message, 0);
                        txtLevel3Code.Focus();
                        return(false);
                    }
                    else if (parent_form != null)
                    {
                        parent_form.GetAllLevel3();
                    }
                }
                else
                {
                    CommonEngine.CloseWaitForm();
                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonEngine.ShowExceptionMessage(ex);
                return(false);
            }
            finally
            {
                CommonEngine.CloseWaitForm();
            }

            return(true);
        }