Exemplo n.º 1
0
        protected void imbEdit_Click(object sender, ImageClickEventArgs e)
        {
            decimal id;

            if (decimal.TryParse(((ImageButton)sender).CommandArgument, out id))
            {
                _InsuredCompany    = ObtScr019Biz.GetEditInsuredData(id);
                txtCodeAdd.Enabled = false;
            }
        }
Exemplo n.º 2
0
 protected void cmbAmphur_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         cmbTambol.DataSource = ObtScr019Biz.GetTambolData(cmbProvince.SelectedValue, cmbAmphur.SelectedValue, false);
         cmbTambol.DataBind();
         cmbTambol.Items.Insert(0, new ListItem("", "-1"));
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Exemplo n.º 3
0
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         var list = ObtScr019Biz.GetSearchInsuredData(cmbProductSearch.SelectedValue, txtCodeSearch.Text, txtNameSearch.Text, cmbTypeSearch.SelectedValue == "-1" ? "" : cmbTypeSearch.SelectedValue);
         BindGridview(pcTop, list.ToArray(), pcTop.SelectedPageIndex);
         txtCodeAdd.Enabled = true;
         // upResult.Update();
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Exemplo n.º 4
0
 protected void PageSearchChange(object sender, EventArgs e)
 {
     try
     {
         //var pageControl = (SLM.Application.Shared.GridviewPageController)sender;
         //DoSearchLeadData(pageControl.SelectedPageIndex, SortExpressionProperty, SortDirectionProperty);
         var list = ObtScr019Biz.GetSearchInsuredData(cmbProductSearch.SelectedValue, txtCodeSearch.Text, txtNameSearch.Text, cmbTypeSearch.SelectedValue == "-1" ? "" : cmbTypeSearch.SelectedValue);
         BindGridview(pcTop, list.ToArray(), pcTop.SelectedPageIndex);
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Exemplo n.º 5
0
 private void InitialControl()
 {
     AppUtil.SetNotThaiCharacter(txtNameEn);
     AppUtil.SetNotEnglishCharacter(txtNameTh);
     AppUtil.SetNumbericCharacter(txtTaxCode);
     AppUtil.SetNumbericCharacter(txtPostcode);
     cmbProductAdd.DataSource = ProductBiz.GetProductList();
     cmbProductAdd.DataBind();
     cmbProductSearch.DataSource = ProductBiz.GetProductList();
     cmbProductSearch.DataBind();
     cmbProvince.DataSource = ObtScr019Biz.GetProvinceData();
     cmbProvince.DataBind();
     cmbProvince.Items.Insert(0, new ListItem("", "-1"));
     cmbProvince_SelectedIndexChanged(null, null);
     rdActive.Checked   = true;
     rdNoActive.Checked = false;
 }
Exemplo n.º 6
0
 protected void btnPopupDoImportExcel_Click(object sender, EventArgs e)
 {
     try
     {
         if (ObtScr019Biz.IsDuplicateComCode(_InsuredCompany.CompanyId, _InsuredCompany.InsuredCode, _InsuredCompany.ProductId) && _InsuredCompany.CompanyId < 0)
         {
             //AppUtil.ClientAlert(Page, "ไม่สามารถบันทึกข้อมูลได้ เนื่องจากข้อมูลรหัสบริษัทประกันซ้ำกับในระบบ");
             lblError.Text = "ไม่สามารถบันทึกข้อมูลได้ เนื่องจากข้อมูลรหัสบริษัทประกันซ้ำกับในระบบ";
             mpePopupReceiveNo.Show();
             mpePopupError.Show();
             upError.Update();
         }
         else if (ObtScr019Biz.IsDuplicateComName(_InsuredCompany.CompanyId, _InsuredCompany.InsuredNameTh, _InsuredCompany.ProductId))
         {
             // AppUtil.ClientAlert(Page, "ไม่สามารถบันทึกข้อมูลได้ เนื่องจากข้อมูลชื่อบริษัทประกันซ้ำกับในระบบ");
             lblError.Text = "ไม่สามารถบันทึกข้อมูลได้ เนื่องจากข้อมูลชื่อบริษัทประกันซ้ำกับในระบบ";
             mpePopupReceiveNo.Show();
             mpePopupError.Show();
             upError.Update();
         }
         else if (ObtScr019Biz.IsDuplicateAbbName(_InsuredCompany.CompanyId, _InsuredCompany.InsuredAbbreviation))
         {
             lblError.Text = "ไม่สามารถบันทึกข้อมูลได้ เนื่องจากชื่อย่อซ้ำกับในระบบ";
             mpePopupReceiveNo.Show();
             mpePopupError.Show();
             upError.Update();
         }
         else
         {
             ObtScr019Biz.SaveInsuredData(_InsuredCompany);
             AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย");
             // ScriptManager.RegisterClientScriptBlock(Page, GetType(), "clearform", "clearForm();", true);
             InitialControl();
             btnSearch_Click(null, null);
         }
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }