Beispiel #1
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");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    //เก็บไว้ส่งไปที่ Adam, AolSummaryReport
                    StaffData staff = SlmScr003Biz.GetStaff(HttpContext.Current.User.Identity.Name);
                    txtEmpCode.Text     = staff.EmpCode;
                    txtStaffTypeId.Text = staff.StaffTypeId != null?staff.StaffTypeId.ToString() : "";

                    txtStaffTypeDesc.Text   = staff.StaffTypeDesc;
                    txtStaffId.Text         = staff.StaffId.ToString();
                    txtStaffBranchCode.Text = staff.BranchCode;


                    //Set AdvanceSearch
                    if (staff.Collapse == null || staff.Collapse == true)
                    {
                        lbAdvanceSearch.Text             = "[+] <b>Advance Search</b>";
                        pnAdvanceSearch.Style["display"] = "none";
                        txtAdvanceSearch.Text            = "N";
                    }
                    else
                    {
                        lbAdvanceSearch.Text             = "[-] <b>Advance Search</b>";
                        pnAdvanceSearch.Style["display"] = "block";
                        txtAdvanceSearch.Text            = "Y";
                    }

                    InitialControl();
                    if (Session[searchcondition] != null)
                    {
                        SetSerachCondition((SearchLeadCondition)Session[searchcondition]);  //Page Load กลับมาจากหน้าอื่น
                        Session[searchcondition] = null;
                    }
                    //else
                    //    DoSearchLeadData(0, string.Empty, SortDirection.Ascending);    //First Load ครั้งแรก
                    StaffData Staff = StaffBiz.GetDefaultSearch(HttpContext.Current.User.Identity.Name);

                    if (Staff != null)
                    {
                        ViewState["SearchDefault"] = Staff.DefaultSearch;
                    }
                }
            }
            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)
                {
                    _log.Debug(DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " " + (Request["ticketid"] != null ? Request["ticketid"] : (" PreleadId " + Request["preleadid"])) + " Begin Page_Load(SLM_SCR_070)");
                    Session.Remove(SLMConstant.SessionName.tabscreenlist);
                    Session.Remove(SLMConstant.SessionName.configscreen);

                    //เก็บไว้ส่งไปที่ Adam, AolSummaryReport
                    StaffData staff = SlmScr003Biz.GetStaff(HttpContext.Current.User.Identity.Name);
                    txtEmpCode.Text     = staff.EmpCode;
                    txtStaffTypeId.Text = staff.StaffTypeId != null?staff.StaffTypeId.ToString() : "";

                    txtStaffTypeDesc.Text   = staff.StaffTypeDesc;
                    txtStaffId.Text         = staff.StaffId.ToString();
                    txtStaffBranchCode.Text = staff.BranchCode;

                    //Set AdvanceSearch
                    if (staff.Collapse == null || staff.Collapse == true)
                    {
                        lbAdvanceSearch.Text             = "[+] <b>Advance Search</b>";
                        pnAdvanceSearch.Style["display"] = "none";
                        txtAdvanceSearch.Text            = "N";
                    }
                    else
                    {
                        lbAdvanceSearch.Text             = "[-] <b>Advance Search</b>";
                        pnAdvanceSearch.Style["display"] = "block";
                        txtAdvanceSearch.Text            = "Y";
                    }

                    InitialControl();
                    if (Session[searchcondition] != null)
                    {
                        SetSearchCondition((SearchLeadCondition)Session[searchcondition]);  //Page Load กลับมาจากหน้าอื่น
                        Session[searchcondition] = null;
                    }
                    _log.Debug(DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " " + (Request["ticketid"] != null ? Request["ticketid"] : (" PreleadId " + Request["preleadid"])) + " End Page_Load(SLM_SCR_070)");
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }