Exemplo n.º 1
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            try
            {
                if (!ctlCommon.ValidateData())
                {
                    AppUtil.ClientAlert(this, "ข้อมูลไม่ครบถ้วน");
                    return;
                }
                if (ctlCommon.CampaignID != "")
                {
                    CampaignId = ctlCommon.CampaignID;
                    LoadDetailControl();
                    ctlLead.SetControlMode(Lead_Detail_Master.CtlMode.New);
                    tbNext.Visible = false;
                    tbSave.Visible = true;
                    ctlCommon.SetEnableCampaign(false);

                    // copy lead
                    //if (Session["ticket_id"] != null)
                    if (hdfCopyTicket.Value.Trim() != "")
                    {
                        //var ticketId = Session["ticket_id"] as string;
                        var    lead = SlmScr010Biz.GetLeadData(hdfCopyTicket.Value);
                        string type = new ConfigProductScreenBiz().GetFieldType(lead.CampaignId, lead.ProductId, SLMConstant.ConfigProductScreen.ActionType.View);

                        // remove unsed data

                        // load data from old lead
                        ctlLead.LoadData(lead, true, type);
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }
Exemplo n.º 2
0
        public void GetLeadData(LeadData lead)
        {
            try
            {
                pnlLead.Visible = true;

                CampaignId = lead.CampaignId;
                ctlCommon.SetLeadData(lead);
                LoadDetailControl();
                ctlLead.LoadData(lead);
            }
            catch (Exception ex)
            {
                _log.Error(ex.InnerException != null ? ex.InnerException.Message : ex.Message);
            }
            finally
            {
                ctlCommon.SetControlMode(Lead_Detail_Master.CtlMode.View);
                ctlLead.SetControlMode(Lead_Detail_Master.CtlMode.View);
                SetAllView();
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    ((Label)Page.Master.FindControl("lblTopic")).Text = "แก้ไขข้อมูล Lead (Edit)";
                    Page.Form.DefaultButton = btnSave.UniqueID;

                    ctlCommon.SetControlMode(Lead_Detail_Master.CtlMode.Edit);

                    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;
                    }

                    if (!string.IsNullOrEmpty(Request["ticketid"]))
                    {
                        var      ticketid = Request["ticketid"];
                        LeadData lead     = SlmScr010Biz.GetLeadData(ticketid);
                        if (lead == null)
                        {
                            AppUtil.ClientAlertAndRedirect(Page, "ไม่พบ Ticket Id " + ticketid + " ในระบบ", "SLM_SCR_003.aspx");
                            return;
                        }


                        if (!CheckTicketCloseOrTicketCOC(lead))
                        {
                            return;
                        }

                        CampaignId = lead.CampaignId;
                        ctlCommon.SetLeadData(lead);
                        LoadDetailControl();
                        ctlLead.LoadData(lead);

                        //InitialControl();
                        //SetScript();
                    }
                    else
                    {
                        AppUtil.ClientAlertAndRedirect(Page, "Ticket Id not found", "SLM_SCR_003.aspx");
                        return;
                    }

                    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;
                    }

                    //Check สิทธิ์ภัทรในการเข้าใช้งาน
                    StaffData staff = StaffBiz.GetStaff(HttpContext.Current.User.Identity.Name);
                    ConfigBranchPrivilegeData data = ConfigBranchPrivilegeBiz.GetConfigBranchPrivilege(staff.BranchCode);
                    if (data != null)
                    {
                        if (data.IsEdit != null && data.IsEdit.Value == false)
                        {
                            AppUtil.ClientAlertAndRedirect(Page, "คุณไม่มีสิทธิ์เข้าใช้หน้าจอนี้", "SLM_SCR_003.aspx");
                            return;
                        }
                    }
                    //------------------------------------------------------------------------------------------------------
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error(message);
                AppUtil.ClientAlert(Page, message);
            }
        }