Beispiel #1
0
 protected void PageSearchChange(object sender, EventArgs e)
 {
     try
     {
         var pageControl = (SLM.Application.Shared.GridviewPageController)sender;
         if (!string.IsNullOrEmpty(hdfUploadLeadId.Value))
         {
             UploadLeadBiz biz     = new UploadLeadBiz();
             var           allData = biz.GetUploadListById(int.Parse(hdfUploadLeadId.Value));
             if (allData != null)
             {
                 BindGridview(pageControl, allData.LeadDataList.ToArray(), pageControl.SelectedPageIndex);
             }
             else
             {
                 AppUtil.ClientAlertAndRedirect(Page, string.Format("ไม่พบข้อมูลการ Upload Lead, UploadId={0}", hdfUploadLeadId.Value), SearchPage);
                 return;
             }
         }
         else
         {
             AppUtil.ClientAlertAndRedirect(Page, "UploadId not found", SearchPage);
             return;
         }
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Error(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "COC_SCR_010");
             if (priData == null || priData.IsView != 1)
             {
                 AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "COC_SCR_002.aspx");
                 return;
             }
             else
             {
                 InitialControl();
             }
         }
     }
     catch (Exception ex)
     {
         string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
         _log.Debug(message);
         AppUtil.ClientAlert(Page, message);
     }
 }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        private void confirm()
        {
            DataSet resultDs;
            int     lot = 0;

            int.TryParse(Request["lot"], out lot);
            SlmScr032Biz biz = new SlmScr032Biz();

            List <SlmScr032SearchResult> successList = biz.GetSuccessList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, cmbTelesalesTeam.SelectedValue, cmbOwnerSearch.SelectedValue, out resultDs);

            List <SlmScr032SearchResult> dedupList = biz.GetDedubList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);

            List <SlmScr032SearchResult> blacklistList = biz.GetBlackListList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);

            List <SlmScr032SearchResult> exceptionalList = biz.GetExceptionalList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);


            if (biz.UpdateDelegateList(lot, successList, dedupList, blacklistList, exceptionalList, HttpContext.Current.User.Identity.Name.ToLower()))
            {
                AppUtil.ClientAlertAndRedirect(this, "Confirm ข้อมูลการจ่ายงานแล้ว", ResolveUrl("~/SLM_SCR_047.aspx"));
            }
            else
            {
                AppUtil.ClientAlert(this, biz.ErrorMessage);
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ((Label)Page.Master.FindControl("lblTopic")).Text = "แก้ไขข้อมูล Lead (Edit)";

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

                    if (Request["ticketid"] != null && Request["ticketid"].ToString().Trim() != string.Empty)
                    {
                        CheckTicketIdPrivilege(Request["ticketid"].ToString().Trim());
                    }
                    else
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "Ticket Id not found", "SLM_SCR_003.aspx");
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                AppUtil.ClientAlert(Page, ex.InnerException != null ? ex.InnerException.Message : ex.Message);
            }
        }
        private void CheckTicketIdPrivilege(string ticketId)
        {
            if (!RoleBiz.GetTicketIdPrivilege(ticketId, HttpContext.Current.User.Identity.Name, SlmScr003Biz.GetStaffType(HttpContext.Current.User.Identity.Name)))
            {
                string message             = "ข้อมูลผู้มุ่งหวังรายนี้ ท่านไม่มีสิทธิในการมองเห็น";
                LeadOwnerDelegateData data = SlmScr011Biz.GetOwnerAndDelegateName(ticketId);
                if (data != null)
                {
                    if (!string.IsNullOrEmpty(data.OwnerName) && !string.IsNullOrEmpty(data.DelegateName))
                    {
                        message += " ณ ปัจจุบันผู้เป็นเจ้าของ คือ " + data.OwnerName.ToString().Trim() + " และ Delegate คือ " + data.DelegateName.ToString().Trim();
                    }
                    else if (!string.IsNullOrEmpty(data.OwnerName))
                    {
                        message += " ณ ปัจจุบันผู้เป็นเจ้าของ คือ " + data.OwnerName.ToString().Trim();
                    }
                    else if (!string.IsNullOrEmpty(data.DelegateName))
                    {
                        message += " ณ ปัจจุบัน Delegate คือ " + data.DelegateName.ToString().Trim();
                    }
                }
                else
                {
                    message = "ไม่พบ Ticket Id " + Request["ticketid"].ToString() + " ในระบบ";
                }

                AppUtil.ClientAlertAndRedirect(Page, message, "SLM_SCR_003.aspx");
            }
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    Session.Remove(SLMConstant.SessionName.tabscreenlist);
                    Session.Remove(SLMConstant.SessionName.configscreen);

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

                    if (string.IsNullOrEmpty(Request["backtype"]))
                    {
                        Session.Remove("followupsearchcondition");
                        Session.Remove("inboundsearchcondition");
                    }
                    InitialData();
                    tabMain.ActiveTabIndex = Request["backtype"] == "3" ? 1 : 0;
                }
            }
            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_008");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "COC_SCR_002.aspx");
                        return;
                    }

                    txtTeamList.Text = AppUtil.GetRecursiveTeam(HttpContext.Current.User.Identity.Name);
                    //tdAssignDateFrom.DateValue = DateTime.Now;
                    //tdAssignDateTo.DateValue = DateTime.Now;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                _log.Debug(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_047");
                    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;
                    pcTop.SetVisible               = false;
                    tdmTransferDateEnd.DateValue   = DateTime.Now;
                    tdmTransferDateStart.DateValue = DateTime.Now;
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_034");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    ((Label)Page.Master.FindControl("lblTopic")).Text = "นำเข้างานติดปัญหา";
                    Page.Form.Attributes.Add("enctype", "multipart/form-data");

                    Page.Form.DefaultButton = btnSearch.UniqueID;

                    cmbInsComImport.DataSource = SlmScr034Biz.GetImportInsComListData();
                    cmbInsComImport.DataBind();

                    cmbInsComSearch.DataSource = SlmScr034Biz.GetSearchInsComListData();
                    cmbInsComSearch.DataBind();

                    cmbFileNameSearch.DataSource = SlmScr034Biz.GetSearchFileNameListData();
                    cmbFileNameSearch.DataBind();
                }
            }
            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);
            }
        }
Beispiel #12
0
        protected void btnAttachDocYes_Click(object sender, EventArgs e)
        {
            try
            {
                btnAttachDocYes.Enabled = false;
                btnAttachDocNo.Enabled  = false;

                string type = new ConfigProductScreenBiz().GetFieldType(lblResultTicketId.Text.Trim(), SLMConstant.ConfigProductScreen.ActionType.View);

                if (cbResultHasAdamsUrl.Checked)
                {
                    LeadDataForAdam leadData = SlmScr003Biz.GetLeadDataForAdam(lblResultTicketId.Text.Trim());
                    StaffData       staff    = SlmScr003Biz.GetStaff(HttpContext.Current.User.Identity.Name);

                    string script = AppUtil.GetCallAdamScript(leadData, HttpContext.Current.User.Identity.Name, (staff.EmpCode != null ? staff.EmpCode : ""), true, type);

                    ScriptManager.RegisterClientScriptBlock(Page, GetType(), "calladam", script, true);
                }
                else
                {
                    Response.Redirect("SLM_SCR_004.aspx?ticketid=" + lblResultTicketId.Text.Trim() + "&type=" + type);
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlertAndRedirect(Page, message, "SLM_SCR_003.aspx");
            }
        }
Beispiel #13
0
        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);
            }
        }
Beispiel #14
0
        private bool CheckTicketIdPrivilege(string ticketId)
        {
            decimal?staffTypeId   = StaffBiz.GetStaffType(HttpContext.Current.User.Identity.Name);
            string  staff_type_id = staffTypeId != null?staffTypeId.Value.ToString() : "";

            string username = HttpContext.Current.User.Identity.Name;

            if (!RoleBiz.CheckTicketIdPrivilege(ticketId, username, AppUtil.GetRecursiveStaff(username), AppUtil.GetRecursiveTeam(username), staff_type_id))
            {
                string message       = "ข้อมูลผู้มุ่งหวังรายนี้ ท่านไม่มีสิทธิในการมองเห็น";
                string lastOwnerName = LeadBiz.GetLastOwnerName(ticketId);

                if (!string.IsNullOrEmpty(lastOwnerName))
                {
                    message += " ณ ปัจจุบันผู้เป็นเจ้าของ คือ " + lastOwnerName.ToString().Trim();
                }

                AppUtil.ClientAlertAndRedirect(Page, message, "COC_SCR_002.aspx");
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #15
0
        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);
            }
        }
Beispiel #16
0
        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);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateData())
                {
                    RankingData data = new RankingData();
                    data.coc_Name = txtName.Text;

                    if (hidRankingId.Value == "")
                    {
                        int rankingId = RankingBiz.AddRanking(data, (List <RankingCampaignData>)ViewState["Campaign"], (List <RankingDealerData>)ViewState["Dealer"], HttpContext.Current.User.Identity.Name);

                        Session[ss_rankingid] = rankingId;
                    }
                    else
                    {
                        RankingBiz.EditRanking(data, null, null, HttpContext.Current.User.Identity.Name);
                    }
                    AppUtil.ClientAlertAndRedirect(Page, "บันทึกข้อมูล Ranking สำเร็จ", "COC_SCR_101.aspx");
                }
                else
                {
                    AppUtil.ClientAlert(Page, "กรุณาระบุข้อมูลให้ครบถ้วน");
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ((Label)Page.Master.FindControl("lblTopic")).Text = "Upload Lead Management";

                ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_102");
                if (priData == null || priData.IsView != 1)
                {
                    AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_102.aspx");
                    return;
                }

                gvError.Visible    = false;
                gvResult.Visible   = false;
                pcTopError.Visible = false;
                pcTop.Visible      = false;
                initControl();
            }
            else
            {
                vtxtFileName.Text     = "";
                lblAlertCampaign.Text = "";
            }
        }
Beispiel #19
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List <string> results = new List <string>();

            try
            {
                if (ValidateInput())
                {
                    string noticeFolder = AppConstant.NoticeFolder;
                    if (string.IsNullOrEmpty(noticeFolder))
                    {
                        throw new Exception("ไม่พบ NoticeFolder(ข้อมูลประกาศ) ใน File Config");
                    }

                    string physicalPath = Server.MapPath(noticeFolder);

                    results = NoticeBiz.InsertData(txtTopic.Text.Trim(), physicalPath, noticeFolder, fuImage.FileName, fuImage.PostedFile.ContentLength,
                                                   fuAttachFile.FileName, (fuAttachFile.PostedFile != null ? fuAttachFile.PostedFile.ContentLength : 0), rbActive.Checked, HttpContext.Current.User.Identity.Name);

                    string mainFolder = Path.Combine(physicalPath, results[0]); //results[0] = noticeId
                    if (!Directory.Exists(mainFolder))
                    {
                        Directory.CreateDirectory(mainFolder);
                    }

                    if (fuImage.HasFile && !string.IsNullOrEmpty(results[1]))
                    {
                        fuImage.SaveAs(results[1]);
                    }

                    if (fuAttachFile.HasFile && !string.IsNullOrEmpty(results[2]))
                    {
                        fuAttachFile.SaveAs(results[2]);
                    }

                    //ClearPopupControl();
                    //DoSearchNotice(0);
                    //AppUtil.ClientAlert(Page, "บันทึกข้อมูลเรียบร้อย");

                    AppUtil.ClientAlertAndRedirect(Page, "บันทึกข้อมูลเรียบร้อย", "SLM_SCR_021.aspx");
                }
                else
                {
                    mpePopup.Show();
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);

                if (results.Count > 0 && !string.IsNullOrEmpty(results[0]))
                {
                    NoticeBiz.DeleteData(int.Parse(results[0]));
                }

                AppUtil.ClientAlert(Page, message);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateData())
                {
                    StaffDataManagement data = new StaffDataManagement();
                    data.Username      = txtUserName.Text.Trim();
                    data.EmpCode       = txtEmpCode.Text.Trim();
                    data.MarketingCode = txtMarketingCode.Text.Trim();
                    data.StaffNameTH   = txtStaffNameTH.Text.Trim();
                    data.TelNo         = txtTellNo.Text.Trim();
                    data.StaffEmail    = txtStaffEmail.Text.Trim();
                    data.PositionId    = cmbPosition.SelectedItem.Value;
                    data.StaffTypeId   = decimal.Parse(cmbStaffType.SelectedItem.Value);
                    data.Team          = txtTeam.Text.Trim();
                    data.BranchCode    = cmbBranchCode.SelectedItem.Value;
                    if (cmbHeadStaffId.Items.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(cmbHeadStaffId.SelectedItem.Value))
                        {
                            data.HeadStaffId = int.Parse(cmbHeadStaffId.SelectedItem.Value);
                        }
                    }
                    if (cmbDepartment.Items.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(cmbDepartment.SelectedItem.Value))
                        {
                            data.DepartmentId = int.Parse(cmbDepartment.SelectedItem.Value);
                        }
                    }
                    if (cmbCocTeam.Items.Count > 0)
                    {
                        if (!string.IsNullOrEmpty(cmbCocTeam.SelectedItem.Value))
                        {
                            data.CocTeam = cmbCocTeam.SelectedItem.Value;
                        }
                    }

                    string staffId = StaffBiz.InsertStaff(data, HttpContext.Current.User.Identity.Name);
                    Session[coc_staffid] = staffId;
                    AppUtil.ClientAlertAndRedirect(Page, "บันทึกข้อมูลเจ้าหน้าที่สำเร็จ", "COC_SCR_007.aspx");
                }
                else
                {
                    AppUtil.ClientAlert(Page, "กรุณาระบุข้อมูลให้ครบถ้วน");
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_056");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    InitialControl();
                    if (!string.IsNullOrEmpty(Request["uploadleadid"]))
                    {
                        ((Label)Page.Master.FindControl("lblTopic")).Text = "Upload Lead Management (Edit)";
                        hdfUploadLeadId.Value = Request["uploadleadid"];

                        if (!CheckPrivilege(hdfUploadLeadId.Value))
                        {
                            WriteLogFile(hdfUploadLeadId.Value, ErrorMessage);
                            AppUtil.ClientAlertAndRedirect(Page, ErrorMessage, (RedirectToView ? GetViewPageUrl(hdfUploadLeadId.Value) : SearchPage));
                            return;
                        }

                        if (!LoadLead(hdfUploadLeadId.Value))
                        {
                            WriteLogFile(hdfUploadLeadId.Value, ErrorMessage);

                            if (RedirectToSearch)
                            {
                                AppUtil.ClientAlertAndRedirect(Page, ErrorMessage, SearchPage);
                                return;
                            }
                            else
                            {
                                AppUtil.ClientAlert(Page, ErrorMessage);
                            }
                        }
                    }
                    else
                    {
                        ((Label)Page.Master.FindControl("lblTopic")).Text = "Upload Lead Management";
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_018");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    if (Session[ss_staffid] != null)
                    {
                        txtStaffId.Text = Session[ss_staffid].ToString();
                        InitialControl();
                        LoadStaffData();
                        //GetCampaignData();
                        tabOwner.Username = txtUsername.Text.Trim();
                        tabOwner.Update();

                        tabDelegate.Username = txtUsername.Text.Trim();
                        tabDelegate.Update();

                        tabOwnerSr.Username = txtUsername.Text.Trim();
                        tabOwnerSr.Update();

                        tabDelegateSr.Username = txtUsername.Text.Trim();
                        tabDelegateSr.Update();

                        tabOwner.GetOwnerList();       // << อันนี้
                        tabDelegate.GetDelegateList(); // << อันนี้

                        tabOwnerSr.GetOwnerList();
                        tabDelegateSr.GetDelegateList();
                        //SetDept();
                    }
                    else
                    {
                        if (txtStaffId.Text.Trim() == string.Empty)
                        {
                            AppUtil.ClientAlertAndRedirect(Page, "Staff Id not found", "SLM_SCR_017.aspx");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_032");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    int lot = 0;
                    int.TryParse(Request["lot"], out lot);

                    initControl();

                    if (lot <= 0)
                    {
                        tabMain.Visible = false;
                        upNoLot.Visible = true;
                        pcNoLot_PageChange(null, null);
                        btnReject.Visible = false;
                        btnSavePopupChangeOwner.Visible = false;
                        btnExportExcel.Visible          = false;
                        btnConfirm.Visible = false;
                    }
                    else
                    {
                        SlmScr032Biz biz = new SlmScr032Biz();
                        if (!biz.CheckAccess(lot))
                        {
                            AppUtil.ClientAlertAndRedirect(Page, biz.ErrorMessage, "SLM_SCR_047.aspx");
                            return;
                        }

                        tabMain.Visible = true;
                        upNoLot.Visible = false;
                    }
                    pcSuccess_PageChange(null, null);
                    pcDedup_PageChange(null, null);
                    pcBlacklist_PageChange(null, null);
                    pcExceptional_PageChange(null, null);
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_041");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    ((Label)Page.Master.FindControl("lblTopic")).Text = "นำเข้าข้อมูลผลงาน Telesales";
                    int yr = DateTime.Now.Year;
                    cmbYear.Items.Clear();
                    cmbYearStart.Items.Clear();
                    cmbYearEnd.Items.Clear();

                    cmbYear.Items.Add(new ListItem()
                    {
                        Text = "กรุณาระบุปี", Value = "0"
                    });
                    cmbYearStart.Items.Add(new ListItem()
                    {
                        Text = "ทั้งหมด", Value = "0"
                    });
                    cmbYearEnd.Items.Add(new ListItem()
                    {
                        Text = "ทั้งหมด", Value = "0"
                    });

                    for (int i = yr; i > yr - 10; i--)
                    {
                        cmbYear.Items.Add(i.ToString());
                        cmbYearStart.Items.Add(i.ToString());
                        cmbYearEnd.Items.Add(i.ToString());
                    }

                    //disable all controls;
                    SetActiveInActiveSearchCriteria(true);
                    //Default Search
                    pnlResult.Visible = true;
                    doGetList(0);
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "COC_SCR_003");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "COC_SCR_002.aspx");
                        return;
                    }

                    if (Request["ticketid"] != null && Request["ticketid"].ToString().Trim() != string.Empty)
                    {
                        txtTicketID.Text = Request["ticketid"].ToString();

                        if (!CheckTicketIdPrivilege(txtTicketID.Text.Trim()))
                        {
                            return;
                        }

                        ((Label)Page.Master.FindControl("lblTopic")).Text = "แสดงข้อมูล Lead: " + txtTicketID.Text.Trim() + " (View)";

                        StaffData staff = StaffBiz.GetStaffInfo(HttpContext.Current.User.Identity.Name);
                        if (staff != null)
                        {
                            txtUserLoginChannelId.Text = staff.ChannelId;
                        }

                        GetLeadData();
                        tabExistingLead.GetExistingLeadList(txtCitizenId.Text.Trim(), txtTelNo1.Text.Trim());
                        tabExistingProduct.GetExistingProductList(txtCitizenId.Text.Trim());
                        tabOwnerLogging.GetOwnerLogingList(txtTicketID.Text.Trim());
                        tabPhoneCallHistory.InitialControl(lead);
                        tabNoteHistory.InitialControl(lead);
                        upTabMain.Update();
                    }
                    else
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "Ticket Id not found", "COC_SCR_002.aspx");
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);
                AppUtil.ClientAlertAndRedirect(Page, message, "COC_SCR_002.aspx");
            }
        }
Beispiel #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    CampaignId = "";
                    ((Label)Page.Master.FindControl("lblTopic")).Text = "เพิ่มข้อมูล Lead (Add)";

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


                    //รับค่า Seaaion มากจากหน้า viewlead, ปุ่ม คัดลอกข้อมูลผู้มุ่งหวัง
                    if (Session["ticket_id"] != null)
                    {
                        hdfCopyTicket.Value = Session["ticket_id"] as string;
                        Session.Remove("ticket_id");

                        // load default data
                        //var ticketid = Session["ticket_id"] as string;
                        //LeadData lead = SlmScr010Biz.GetLeadData(ticketid);
                        // Session["ticket_id"] = null;
                        LeadData lead = SlmScr010Biz.GetLeadData(hdfCopyTicket.Value);
                        lead.Delegate        = "";
                        lead.Delegate_Branch = "";
                        lead.Delegate_Flag   = 0;

                        if (lead != null)
                        {
                            //CampaignId = lead.CampaignId;
                            ctlCommon.SetLeadData(lead, true, true);

                            //LoadDetailControl();
                            //ctlLead.LoadData(lead);
                        }
                    }
                    ctlCommon.SetControlMode(Lead_Detail_Master.CtlMode.New);
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #27
0
        /// <summary>
        /// ปุ่ม Download ทำงานในกรณี Edit เท่านั้น โดย download ข้อมูลที่อยู่ใน DB แล้ว Export ออกเป็น excel
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDownload_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(hdfUploadLeadId.Value))
                {
                    UploadLeadBiz biz     = new UploadLeadBiz();
                    var           allData = biz.GetUploadListById(int.Parse(hdfUploadLeadId.Value));
                    if (allData != null && allData.LeadDataList != null)
                    {
                        //ExportExcelOpenXml(allData);
                        ExportExcel(allData);
                        return;
                    }
                    else
                    {
                        WriteLogFile(hdfUploadLeadId.Value, biz.ErrorMessage);

                        if (biz.RedirectToSearch)
                        {
                            PrepareRedirectPage();
                            AppUtil.ClientAlertAndRedirect(Page, biz.ErrorMessage, SearchPage);
                            return;
                        }
                        else
                        {
                            AppUtil.ClientAlert(Page, biz.ErrorMessage);
                            return;
                        }
                    }
                }
                else
                {
                    PrepareRedirectPage();
                    WriteLogFile("None", "Upload Id not found");
                    AppUtil.ClientAlertAndRedirect(Page, "Upload Id not found", SearchPage);
                    return;
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Beispiel #28
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ((Label)Page.Master.FindControl("lblTopic")).Text = "ข้อมูลกำหนดรถ Premium";
            Page.Form.DefaultButton = btnSearch.UniqueID;

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

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

            AppUtil.BuildCombo(cmbDBrand, SlmScr063Biz.GetBrandData(), "กรุณาระบุ");

            _log = LogManager.GetLogger(this.GetType());
        }
Beispiel #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ScreenPrivilegeData priData = RoleBiz.GetScreenPrivilege(HttpContext.Current.User.Identity.Name, "SLM_SCR_057");
                    if (priData == null || priData.IsView != 1)
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                        return;
                    }

                    if (!string.IsNullOrEmpty(Request["uploadleadid"]))
                    {
                        InitialControl();
                        hdfUploadLeadId.Value = Request["uploadleadid"];

                        if (!LoadLead(hdfUploadLeadId.Value))
                        {
                            WriteLogFile(hdfUploadLeadId.Value, ErrorMessage);
                            if (RedirectToSearch)
                            {
                                AppUtil.ClientAlertAndRedirect(Page, ErrorMessage, SearchPage);
                                return;
                            }
                            else
                            {
                                AppUtil.ClientAlert(Page, ErrorMessage);
                            }
                        }
                    }
                    else
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "ไม่พบข้อมูล Upload ID", SearchPage);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlertAndRedirect(Page, message, SearchPage);
            }
        }
Beispiel #30
0
        private void reject()
        {
            int lot = 0;

            int.TryParse(Request["lot"], out lot);
            SlmScr032Biz biz = new SlmScr032Biz();

            List <SlmScr032SearchResult> successList = null;// ไม่ใช้แล้ว biz.GetSuccessList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, cmbTelesalesTeam.SelectedValue, cmbOwnerSearch.SelectedValue, out resultDs);

            //Dedup==================================================================
            SaveCheckedDedup();

            List <decimal> dedupTempId       = new List <decimal>();
            var            dedup_checkedlist = DedupCheckedList;

            dedup_checkedlist.ForEach(p => {
                if (p.Value)
                {
                    dedupTempId.Add(decimal.Parse(p.Key));
                }
            });

            //Blacklist==================================================================
            SaveCheckedBlacklist();

            List <decimal> blacklistTempId = new List <decimal>();
            var            bl_checkedlist  = BlacklistCheckedList;

            bl_checkedlist.ForEach(p => {
                if (p.Value)
                {
                    blacklistTempId.Add(decimal.Parse(p.Key));
                }
            });

            List <SlmScr032SearchResult> exceptionalList = null;  //ไม่ใช่แล้ว biz.GetExceptionalList(lot, txtFirstname.Text.Trim(), txtLastname.Text.Trim(), cmbCardType.SelectedValue, txtCitizenId.Text.Trim(), cmbCampaign.SelectedValue, tdmTransferDate.DateValue, out resultDs);

            if (biz.RejectDelegateList(lot, successList, dedupTempId, blacklistTempId, exceptionalList, HttpContext.Current.User.Identity.Name.ToLower()))
            {
                AppUtil.ClientAlertAndRedirect(this, "Reject ข้อมูลการจ่ายงานแล้ว", ResolveUrl("~/SLM_SCR_047.aspx"));
            }
            else
            {
                AppUtil.ClientAlert(this, biz.ErrorMessage);
            }
        }