protected void btnExportExcel_Click(object sender, EventArgs e) { if (!ValidInput()) { AppUtil.ClientAlert(Page, "กรุณาเลือกวันที่กดรับเลขรับแจ้งเริ่มต้น และ วันที่กดรับเลขรับแจ้งสิ้นสุด"); return; } //DataSet resultDs; //Coment by Pom 04/07/2016 - Warning variable is never used decimal teleTeam; string telesale; decimal.TryParse(cmbTelesalesTeam.SelectedValue, out teleTeam); telesale = cmbTelesales.SelectedValue; var filename = Path.GetTempPath() + "\\tmpexcel_051_" + Page.User.Identity.Name + ".xls";// Path.GetTempFileName(); var bz = new SlmScr051Biz(); if (bz.CreateExcel2(tdStartDate.DateValue, tdEndDate.DateValue, tdIncentiveStartDate.DateValue, tdIncentiveEndDate.DateValue, tdProtectStartDate.DateValue, tdProtectEndDate.DateValue, teleTeam, telesale, filename)) { ExportExcel(filename, "REPORT_PRIVILEGE_" + DateTime.Now.ToString("yyyyMMdd_HHmm") + ".xls"); } else { AppUtil.ClientAlert(this, bz.ErrorMessage); } }
protected void imbEdit_Click(object sender, ImageClickEventArgs e) { try { var branch = BranchBiz.GetBranch(((ImageButton)sender).CommandArgument); if (branch != null) { cbEdit.Checked = true; txtBranchCodePopup.Text = branch.BranchCode; txtBranchCodePopup.Enabled = false; txtBranchNamePopup.Text = branch.BranchName; cmbChannelPopup.SelectedIndex = cmbChannelPopup.Items.IndexOf(cmbChannelPopup.Items.FindByValue(branch.ChannelId)); txtWorkStartHourPopup.Text = branch.StartTimeHour; txtWorkStartMinPopup.Text = branch.StartTimeMinute; txtWorkEndHourPopup.Text = branch.EndTimeHour; txtWorkEndMinPopup.Text = branch.EndTimeMinute; rbActive.Checked = branch.Status == "Y" ? true : false; rbInActive.Checked = branch.Status == "Y" ? false : true; upPopup.Update(); mpePopup.Show(); } else { throw new Exception("ไม่พบรหัสสาขา " + ((ImageButton)sender).CommandArgument + " ในระบบ"); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
protected void btnDeselectAll_Click(object sender, EventArgs e) { try { lboxBranchAll.Items.AddRange(lboxBranchSelected.Items.OfType <ListItem>().ToArray()); List <ControlListData> list = lboxBranchAll.Items.OfType <ListItem>().OrderBy(p => p.Text).Select(p => new ControlListData { TextField = p.Text, ValueField = p.Value }).ToList(); BindListBox(lboxBranchAll, list); lblBranchAllTotal.Text = lboxBranchAll.Items.Count.ToString(); lboxBranchSelected.Items.Clear(); lblBranchSelectedTotal.Text = lboxBranchSelected.Items.Count.ToString(); //upPopup.Update(); upPopupBranchSection.Update(); mpePopup.Show(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "COC_SCR_006"); if (priData == null || priData.IsView != 1) { AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "COC_SCR_002.aspx"); return; } InitialControl(); SetDept(); if (Session[coc_staffsearchcondition] != null) { SetSerachCondition((StaffDataManagement)Session[coc_staffsearchcondition]); //Page Load กลับมาจากหน้าอื่น Session[coc_staffsearchcondition] = null; } } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
protected void btnAddBranch_Click(object sender, EventArgs e) { try { cbEdit.Checked = false; txtBranchCodePopup.Text = ""; txtBranchCodePopup.Enabled = true; txtBranchNamePopup.Text = ""; cmbChannelPopup.SelectedIndex = -1; txtWorkStartHourPopup.Text = ""; txtWorkStartMinPopup.Text = ""; txtWorkEndHourPopup.Text = ""; txtWorkEndMinPopup.Text = ""; rbActive.Checked = true; rbInActive.Checked = false; upPopup.Update(); mpePopup.Show(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
private bool ValidateEditConfigStaff() { if (cmbEditConditionField_Staff.SelectedItem.Value == "") { AppUtil.ClientAlert(Page, "กรุณาระบุข้อมูลให้ครบถ้วน ก่อนการบันทึก"); return(false); } if (txtEditSeq_Staff.Text.Trim() == "") { AppUtil.ClientAlert(Page, "กรุณาระบุข้อมูลให้ครบถ้วน ก่อนการบันทึก"); return(false); } else { int result; if (!int.TryParse(txtEditSeq_Staff.Text.Trim(), out result)) { AppUtil.ClientAlert(Page, "กรุณาระบุ sequence เป็นตัวเลขที่มากกว่าศูนย์เท่านั้น"); return(false); } if (result <= 0) { AppUtil.ClientAlert(Page, "กรุณาระบุ sequence เป็นตัวเลขที่มากกว่าศูนย์เท่านั้น"); return(false); } } return(true); }
protected void imbEdit_Click(object sender, ImageClickEventArgs e) { try { int index = Convert.ToInt32(((ImageButton)sender).CommandArgument); txtPositionId.Text = ((Label)gvResult.Rows[index].FindControl("lblPositionId")).Text.Trim(); txtPositionNameAbb.Text = ((Label)gvResult.Rows[index].FindControl("lblPositionNameAbb")).Text.Trim(); txtPositionNameEN.Text = ((Label)gvResult.Rows[index].FindControl("lblPositionNameEN")).Text.Trim(); txtPositionNameTH.Text = ((Label)gvResult.Rows[index].FindControl("lblPositionNameTH")).Text.Trim(); string status = ((Label)gvResult.Rows[index].FindControl("lblStatus")).Text.Trim(); rbActive.Checked = status == "Y" ? true : false; rbInActive.Checked = status == "Y" ? false : true; upPopup.Update(); mpePopup.Show(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void lbAdvanceSearch_Click(object sender, EventArgs e) { try { if (pnAdvanceSearch.Style["display"] == "" || pnAdvanceSearch.Style["display"] == "none") { lbAdvanceSearch.Text = "[-] <b>Advance Search</b>"; pnAdvanceSearch.Style["display"] = "block"; txtAdvanceSearch.Text = "Y"; } else { lbAdvanceSearch.Text = "[+] <b>Advance Search</b>"; pnAdvanceSearch.Style["display"] = "none"; txtAdvanceSearch.Text = "N"; } StaffBiz.SetCollapse(HttpContext.Current.User.Identity.Name, txtAdvanceSearch.Text.Trim() == "N" ? true : false); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
private void LoadDetailControl() { if (!String.IsNullOrEmpty(CampaignId)) { SlmScr010Biz bz = new SlmScr010Biz(); var ctl = bz.GetControlname(CampaignId, "E"); if (ctl != "") { ctlLead = (Lead_Detail_Master)LoadControl("~/Shared/" + ctl); } else { ctlLead = (Lead_Detail_Master)LoadControl("~/Shared/Lead_Detail_Default.ascx"); } if (ctlLead != null) { ctlLead.CommonData = ctlCommon.GetCommonData(); plcControl.Controls.Add(ctlLead); } else { AppUtil.ClientAlert(this, "Invalid Control Name, Please contact administrator"); } } }
protected void imbView_Click(object sender, EventArgs e) { try { int index = int.Parse(((ImageButton)sender).CommandArgument); Session[searchcondition] = GetSearchCondition(); string ticketId = ((Label)gvResult.Rows[index].FindControl("lblTicketId")).Text.Trim(); string campaignId = ((Label)gvResult.Rows[index].FindControl("lblCampaignId")).Text.Trim(); string productId = ((Label)gvResult.Rows[index].FindControl("lblProductId")).Text.Trim(); string type = new ConfigProductScreenBiz().GetFieldType(campaignId, productId, SLMConstant.ConfigProductScreen.ActionType.View); Session[SLMConstant.SessionName.CampaignId] = campaignId; Session[SLMConstant.SessionName.ProductId] = productId; Response.Redirect("SLM_SCR_004.aspx?ticketid=" + ticketId + "&type=" + type + "&backtype=1", false); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void gvResult_Sorting(object sender, GridViewSortEventArgs e) { try { if (SortExpressionProperty != e.SortExpression) //เมื่อเปลี่ยนคอลัมน์ในการ sort { SortDirectionProperty = SortDirection.Ascending; } else { if (SortDirectionProperty == SortDirection.Ascending) { SortDirectionProperty = SortDirection.Descending; } else { SortDirectionProperty = SortDirection.Ascending; } } SortExpressionProperty = e.SortExpression; DoSearchLeadData(0, SortExpressionProperty, SortDirectionProperty); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void gvResult_DataBound(object sender, EventArgs e) { try { ConfigBranchPrivilegeData data = ConfigBranchPrivilegeBiz.GetConfigBranchPrivilege(txtStaffBranchCode.Text.Trim()); if (data != null) { if (data.IsView != null && data.IsView.Value == false) { foreach (GridViewRow row in gvResult.Rows) { ((ImageButton)row.FindControl("imbView")).Visible = false; } } if (data.IsEdit != null && data.IsEdit.Value == false) { foreach (GridViewRow row in gvResult.Rows) { ((ImageButton)row.FindControl("imbEdit")).Visible = false; } } } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void Page_Load(object sender, EventArgs e) { //Response.Cache.SetCacheability(HttpCacheability.NoCache); //will not save the file to temp internet files like you mentioned. //Response.Cache.SetExpires(DateTime.Now.AddMinutes(-1)); //Response.Cache.SetNoStore(); //Prevents the browser from caching the ASPX page, will not save the request or the response to and from the server try { if (!VerifySession()) { Logout(); } if (!IsPostBack) { if (HttpContext.Current.User.Identity.IsAuthenticated) { DisplayUserFullname(); GetCurrentStatus(); //SetMenu(); } else { Response.Redirect(FormsAuthentication.LoginUrl); } } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
protected void PageSearchChange(object sender, EventArgs e) { try { if (!ValidInput()) { //AppUtil.ClientAlert(Page, "กรุณาเลือกวันที่กดรับเลขรับแจ้งเริ่มต้น และ วันที่กดรับเลขรับแจ้งสิ้นสุด"); return; } decimal teleTeam; string telesale; decimal.TryParse(cmbTelesalesTeam.SelectedValue, out teleTeam); telesale = cmbTelesales.SelectedValue; var biz = new SlmScr051Biz(); var resultList = biz.GetSearchResult2(tdStartDate.DateValue, tdEndDate.DateValue, tdIncentiveStartDate.DateValue, tdIncentiveEndDate.DateValue, tdProtectStartDate.DateValue, tdProtectEndDate.DateValue, teleTeam, telesale).OrderBy(r => r.slm_PremiumName).ToList(); if (sender == null) { BindGridview(pcTop, gvResult, resultList.ToArray(), 0); } else { BindGridview(pcTop, gvResult, resultList.ToArray(), pcTop.SelectedPageIndex); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; // _log.Debug(message); AppUtil.ClientAlert(Page, message); } upResult.Update(); }
protected void btnSavePopupAddConfigStaff_Click(object sender, EventArgs e) { try { if (ValidatePopupAddConfigStaff()) { AssignConditionStaffBiz biz = new AssignConditionStaffBiz(); if (biz.ValidateData(cmbAddProduct_Staff.SelectedItem.Value, decimal.Parse(cmbAddGrade_Staff.SelectedItem.Value), decimal.Parse(cmbAddAssignType_Staff.SelectedItem.Value), decimal.Parse(cmbAddTeamTeles_Staff.SelectedItem.Value))) { biz.InsertData(cmbAddProduct_Staff.SelectedItem.Value, cmbAddGrade_Staff.SelectedItem.Value, cmbAddAssignType_Staff.SelectedItem.Value, cmbAddTeamTeles_Staff.SelectedItem.Value, HttpContext.Current.User.Identity.Name.ToLower()); ClearPopupAddConfigStaff(); mpePopupAddConfigStaff.Hide(); DoSearchConfigStaff(0); AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย"); } else { AppUtil.ClientAlert(Page, biz.ErrorMessage); mpePopupAddConfigStaff.Show(); } } else { mpePopupAddConfigStaff.Show(); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void cmbActivityRightPopup_SelectedIndexChanged(object sender, EventArgs e) { try { if (cmbActivityRightPopup.SelectedItem.Value == "1") { lboxLeadStatusAll.Enabled = true; lboxLeadStatusSelected.Enabled = true; btnSelectAll.Enabled = true; btnSelect.Enabled = true; btnDeselect.Enabled = true; btnDeselectAll.Enabled = true; } else { DoDeSelectAll(); lboxLeadStatusAll.Enabled = false; lboxLeadStatusSelected.Enabled = false; btnSelectAll.Enabled = false; btnSelect.Enabled = false; btnDeselect.Enabled = false; btnDeselectAll.Enabled = false; alertLeadStatusSelected.Text = ""; } mpePopup.Show(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void btnEditConfigStaffSave_Click(object sender, EventArgs e) { try { if (ValidateEditConfigStaff()) { SortConditionStaffBiz biz = new SortConditionStaffBiz(); biz.InsertData(txtEditAssignConditionStaffId.Text, cmbEditConditionField_Staff.SelectedItem.Value, cmbEditSortBy_Staff.SelectedItem.Value, txtEditSeq_Staff.Text.Trim(), HttpContext.Current.User.Identity.Name.ToLower()); cmbEditConditionField_Staff.SelectedIndex = -1; cmbEditSortBy_Staff.SelectedIndex = -1; txtEditSeq_Staff.Text = ""; DoSearchEditConfigStaff(0); AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย"); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } finally { mpePopupEditConfigStaff.Show(); upEditConfigStaffButton_Inner.Update(); } }
protected void imbEdit_Click(object sender, ImageClickEventArgs e) { try { cbEdit.Checked = true; int index = Convert.ToInt32(((ImageButton)sender).CommandArgument); string holidayDate = ((Label)gvResult.Rows[index].FindControl("lblHolidayDate")).Text.Trim(); string holidayDesc = ((Label)gvResult.Rows[index].FindControl("lblHolidayDesc")).Text.Trim(); if (!string.IsNullOrEmpty(holidayDate)) { string[] obj = holidayDate.Split('/'); tdmHolidayDatePopup.DateValue = new DateTime(int.Parse(obj[2]), int.Parse(obj[1]), int.Parse(obj[0])); tdmHolidayDatePopup.Enabled = false; txtHolidayDescPopup.Text = holidayDesc; SetBranchForEdit(tdmHolidayDatePopup.DateValue.Year.ToString() + tdmHolidayDatePopup.DateValue.ToString("-MM-dd")); upPopup.Update(); mpePopup.Show(); } else { throw new Exception("ไม่พบวันหยุดที่ต้องการแก้ไข"); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (ValidateInput()) { if (txtPositionId.Text.Trim() != "") PositionBiz.UpdateData(int.Parse(txtPositionId.Text.Trim()), txtPositionNameAbb.Text.Trim(), txtPositionNameEN.Text.Trim(), txtPositionNameTH.Text.Trim(), rbActive.Checked, HttpContext.Current.User.Identity.Name); else PositionBiz.InsertData(txtPositionNameAbb.Text.Trim(), txtPositionNameEN.Text.Trim(), txtPositionNameTH.Text.Trim(), rbActive.Checked, HttpContext.Current.User.Identity.Name); AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย"); ClearPopupControl(); mpePopup.Hide(); DoSearchPosition(0); } else mpePopup.Show(); } catch (Exception ex) { mpePopup.Show(); string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void btnAddConfigCustomer_Click(object sender, EventArgs e) { try { cmbAddProduct_Cus.DataSource = ProductBiz.GetProductList(); cmbAddProduct_Cus.DataTextField = "TextField"; cmbAddProduct_Cus.DataValueField = "ValueField"; cmbAddProduct_Cus.DataBind(); cmbAddProduct_Cus.Items.Insert(0, new ListItem("", "")); //cmbAddCustomerGrade_Cus.DataSource = new CustomerGradeBiz().GetCustomerGradeList(); //cmbAddCustomerGrade_Cus.DataTextField = "TextField"; //cmbAddCustomerGrade_Cus.DataValueField = "ValueField"; //cmbAddCustomerGrade_Cus.DataBind(); //cmbAddCustomerGrade_Cus.Items.Insert(0, new ListItem("", "")); //cmbAddAssignType_Cus.DataSource = new AssignTypeBiz().GetAssignTypeList(); //cmbAddAssignType_Cus.DataTextField = "TextField"; //cmbAddAssignType_Cus.DataValueField = "ValueField"; //cmbAddAssignType_Cus.DataBind(); //cmbAddAssignType_Cus.Items.Insert(0, new ListItem("", "")); mpePopupAddConfigCustomer.Show(); upPopupAddConfigCustomer.Update(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
private bool ValidInput() { //bool criteriaSelected = false; //Comment By Pom 17/06/2559 - not used //if (cmbEndMonth.SelectedIndex == 0 || cmbMonth.SelectedIndex == 0 // || cmbStartMonth.SelectedIndex == 0 || cmbYear.SelectedIndex == 0) //{ // AppUtil.ClientAlert(Page, "เลือกปีคุ้มครองเริ่มต้น, ปีคุ้มครองสิ้นสุด, เดือนคุ้มครองเริ่มต้น, เดือนคุ้มครองสิ้นสุด"); // return false; //} //int startyear, startmonth, endyear, endmonth; //int.TryParse(cmbYear.SelectedValue, out startyear); //int.TryParse(cmbStartMonth.SelectedValue, out startmonth); //int.TryParse(cmbMonth.SelectedValue, out endyear); //int.TryParse(cmbEndMonth.SelectedValue, out endmonth); //DateTime startDate = new DateTime(startyear, startmonth, 1); //DateTime endDate = new DateTime(endyear, endmonth, 1); //if (startDate.AddMonths(7) < endDate) //{ // AppUtil.ClientAlert(Page, "ไม่สามารถเลือกปีเดือนคุ้มครอง มากกว่า 7 เดือนได้"); // return false; //} if (cmbYear.SelectedIndex == 0 || cmbMonth.SelectedIndex == 0) { AppUtil.ClientAlert(this, "กรุณาเลือกปีที่แจกงาน, เดือนที่หมดอายุ กธ."); return(false); } return(true); }
protected void cmbAddProduct_Cus_SelectedIndexChanged(object sender, EventArgs e) { try { if (cmbAddProduct_Cus.SelectedItem.Value != "") { cmbAddCustomerGrade_Cus.DataSource = new CustomerGradeBiz().GetCustomerGradeList("C", cmbAddProduct_Cus.SelectedItem.Value); cmbAddCustomerGrade_Cus.DataTextField = "TextField"; cmbAddCustomerGrade_Cus.DataValueField = "ValueField"; cmbAddCustomerGrade_Cus.DataBind(); cmbAddCustomerGrade_Cus.Items.Insert(0, new ListItem("", "")); cmbAddAssignType_Cus.Items.Clear(); } else { cmbAddCustomerGrade_Cus.Items.Clear(); cmbAddAssignType_Cus.Items.Clear(); } mpePopupAddConfigCustomer.Show(); upPopupAddConfigCustomer.Update(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (!ctlPrelead.ValidateData("")) { return; } SlmScr046Biz bz = new SlmScr046Biz(); var pl = ctlPrelead.GetData(); if (!bz.SavePrelead(pl, Page.User.Identity.Name)) { AppUtil.ClientAlert(this, bz.ErrorMessage); } else { AppUtil.ClientAlertAndRedirect(this, "บันทึกข้อมูลเรียบร้อย", "SLM_SCR_029.aspx?backtype=" + Request["backtype"]); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_030"); if (priData == null || priData.IsView != 1) { AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx"); return; } InitialControl(); DoSearchConfigCustomer(0); //Gridview Assign Config Customer DoSearchConfigStaff(0); //Gridview Assign Config Staff } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (ValidateInput()) { if (cbEdit.Checked) { BranchBiz.UpdateData(txtBranchCodePopup.Text.Trim(), txtBranchNamePopup.Text.Trim(), txtWorkStartHourPopup.Text.Trim(), txtWorkStartMinPopup.Text.Trim(), txtWorkEndHourPopup.Text.Trim(), txtWorkEndMinPopup.Text.Trim(), cmbChannelPopup.SelectedItem.Value, rbActive.Checked, HttpContext.Current.User.Identity.Name); } else { BranchBiz.InsertData(txtBranchCodePopup.Text.Trim(), txtBranchNamePopup.Text.Trim(), txtWorkStartHourPopup.Text.Trim(), txtWorkStartMinPopup.Text.Trim(), txtWorkEndHourPopup.Text.Trim(), txtWorkEndMinPopup.Text.Trim(), cmbChannelPopup.SelectedItem.Value, rbActive.Checked, HttpContext.Current.User.Identity.Name); } AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย"); ClearPopupControl(); mpePopup.Hide(); DoSearchBranch(0); } else { mpePopup.Show(); } } catch (Exception ex) { mpePopup.Show(); string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Debug(message); AppUtil.ClientAlert(Page, message); } }
protected void cmbAddGrade_Staff_SelectedIndexChanged(object sender, EventArgs e) { try { if (cmbAddGrade_Staff.SelectedItem.Value != "") { cmbAddAssignType_Staff.DataSource = new AssignTypeBiz().GetAssignTypeList("S", cmbAddProduct_Staff.SelectedItem.Value, decimal.Parse(cmbAddGrade_Staff.SelectedItem.Value)); cmbAddAssignType_Staff.DataTextField = "TextField"; cmbAddAssignType_Staff.DataValueField = "ValueField"; cmbAddAssignType_Staff.DataBind(); cmbAddAssignType_Staff.Items.Insert(0, new ListItem("", "")); } else { //เนื่องจากมีการ convert to decimal cmbAddAssignType_Staff.Items.Clear(); } mpePopupAddConfigStaff.Show(); upPopupAddConfigStaff.Update(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_024"); if (priData == null || priData.IsView != 1) { AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx"); return; } Page.Form.DefaultButton = btnSearch.UniqueID; InitialControl(); DoSearchAccessRightList(0); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
protected void imbEditConfigStaff_Click(object sender, EventArgs e) { try { cmbEditConditionField_Staff.DataSource = new ConditionFieldBiz().GetConditionFieldList("S"); //S=Staff cmbEditConditionField_Staff.DataTextField = "TextField"; cmbEditConditionField_Staff.DataValueField = "ValueField"; cmbEditConditionField_Staff.DataBind(); cmbEditConditionField_Staff.Items.Insert(0, new ListItem("", "")); int index = int.Parse(((ImageButton)sender).CommandArgument); txtEditProductName_Staff.Text = ((Label)gvAddConfigStaff.Rows[index].FindControl("lblProductName")).Text.Trim(); txtEditGradeName_Staff.Text = ((Label)gvAddConfigStaff.Rows[index].FindControl("lblGradeName")).Text.Trim(); txtEditAssignTypeName_Staff.Text = ((Label)gvAddConfigStaff.Rows[index].FindControl("lblAssignTypeName")).Text.Trim(); txtEditAssignConditionStaffId.Text = ((Label)gvAddConfigStaff.Rows[index].FindControl("lblAssignConditionStaffId")).Text.Trim(); txtEditTeamTeles_Staff.Text = ((Label)gvAddConfigStaff.Rows[index].FindControl("lblTeamTelesalesName")).Text.Trim(); DoSearchEditConfigStaff(0); mpePopupEditConfigStaff.Show(); upPopupEditConfigStaff.Update(); } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }
private bool ValidateData() { string err = ""; //if (txtDCode.Text.Trim() == "") err += (err == "" ? "" : ", ") + "Team Telesales Code"; //if (txtDName.Text.Trim() == "") err += (err == "" ? "" : ", ") + "ชื่อทีม Telesales"; //if (cmbDHeader.SelectedValue == "") err += (err == "" ? "" : ", ") + "หัวหน้าทีม"; if (cmbDBrand.SelectedIndex == 0) { err += (err == "" ? "" : ", ") + "ยี่ห้อรถ"; } if (cmbDModel.SelectedIndex == 0) { err += (err == "" ? "" : ", ") + "รุ่นรถ"; } if (cmbDType.SelectedIndex == 0) { err += (err == "" ? "" : ", ") + "ประเภทการใช้งาน"; } if (err != "") { AppUtil.ClientAlert(this, "กรุณากรอก " + err); return(false); } else { return(true); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_042"); if (priData == null || priData.IsView != 1) { AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx"); return; } ((Label)Page.Master.FindControl("lblTopic")).Text = "ข้อมูลบริษัทประกันภัย"; Page.Form.DefaultButton = btnSearch.UniqueID; InitialControl(); // DoSearchBranch(0); } } catch (Exception ex) { string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message; _log.Error(message); AppUtil.ClientAlert(Page, message); } }