Пример #1
0
        private void SetData(kkslm_ms_discount ds)
        {
            AppUtil.BuildCombo(cmbDRole, SlmScr062Biz.GetStaffTypeData(true, ds.slm_StaffTypeId.Value), "กรุณาระบุ");
            hdfID.Value = ds.slm_Discount_Id.ToString();
            AppUtil.SetComboValue(cmbDRole, ds.slm_StaffTypeId.ToString());
            rdoInsuranceType.SelectedIndex = rdoInsuranceType.Items.IndexOf(rdoInsuranceType.Items.FindByValue(ds.slm_InsuranceTypeCode));
            #region Add by First 21/11/2559
            rdoInsuranceType.Enabled = false;
            #endregion


            if (ds.slm_DiscountPercent > 0)
            {
                rdoDiscount.SelectedIndex = 0;
                txtDDiscountValue.Text    = ds.slm_DiscountPercent.Value.ToString();
            }
            else if (ds.slm_DiscountBath > 0)
            {
                rdoDiscount.SelectedIndex = 1;
                txtDDiscountValue.Text    = ds.slm_DiscountBath.Value.ToString();
            }
            else
            {
                rdoDiscount.SelectedIndex = 0;
                txtDDiscountValue.Text    = "0";
            }
            rdoDStatus.SelectedIndex = rdoDStatus.Items.IndexOf(rdoDStatus.Items.FindByValue(ds.is_Deleted.ToString()));
            cmbDRole.Enabled         = false;
            updModal.Update();
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
                if (!ValidateData())
                {
                    zPopDetail.Show(); return;
                }

                var          ts = GetData();
                SlmScr062Biz bz = new SlmScr062Biz();
                if (!bz.SaveData(ts, Page.User.Identity.Name))
                {
                    zPopDetail.Show();
                    AppUtil.ClientAlert(this, bz.ErrorMessage);
                }
                else
                {
                    zPopDetail.Hide();
                    LoadDataList(gvResult.PageIndex);
                }
            }
            catch (Exception ex)
            {
                AppUtil.ClientAlert(this, ex.InnerException == null ? ex.Message : ex.InnerException.Message);
                _log.Error(ex.InnerException == null ? ex.Message : ex.InnerException.Message);
            }
        }
Пример #3
0
        protected void imbAction_Click(object sender, ImageClickEventArgs e)
        {
            var          id = SLMUtil.SafeInt(((ImageButton)sender).CommandArgument);
            SlmScr062Biz bz = new SlmScr062Biz();
            var          ds = bz.GetDetail(id);

            if (ds != null)
            {
                SetData(ds);
                zPopDetail.Show();
            }
        }
Пример #4
0
 private void ClearData()
 {
     AppUtil.BuildCombo(cmbDRole, SlmScr062Biz.GetStaffTypeData(true, 0), "กรุณาระบุ");
     hdfID.Value                    = "";
     cmbDRole.SelectedIndex         = -1;
     rdoInsuranceType.SelectedIndex = -1;
     rdoInsuranceType.Enabled       = true;
     rdoDiscount.SelectedIndex      = 0;
     txtDDiscountValue.Text         = "";
     rdoDStatus.SelectedIndex       = 0;
     cmbDRole.Enabled               = true;
     rdoInsuranceType.Enabled       = true;
     updModal.Update();
 }
Пример #5
0
 private void LoadDataList(int pageIdx)
 {
     try
     {
         SlmScr062Biz biz = new SlmScr062Biz();
         var          lst = biz.GetDataList(SLMUtil.SafeInt(cmbSRole.SelectedValue), chkSPolicy.Checked, chkSAct.Checked, cmbSStatus.SelectedValue);// biz.GetDataList(txtTeamCode.Text, txtTeamName.Text, cmbTeamHeader.SelectedValue, cmbStatus.SelectedValue);
         BindGridview(pcTop, lst, pageIdx);
         pcTop.Visible    = gvResult.PageCount > 0;
         gvResult.Visible = true;
         upResult.Update();
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Пример #6
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            AppUtil.SetNumbericCharacter(txtDDiscountValue);
            ((Label)Page.Master.FindControl("lblTopic")).Text = "ข้อมูลกำหนดส่วนลดตาม Role";
            Page.Form.DefaultButton = btnSearch.UniqueID;

            ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_062");

            if (priData == null || priData.IsView != 1)
            {
                AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
            }

            AppUtil.BuildCombo(cmbSRole, SlmScr062Biz.GetStaffTypeData(false, 0), "ทั้งหมด");

            _log = LogManager.GetLogger(this.GetType());
        }