Beispiel #1
0
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            try
            {
                StaffData staffData = SlmMasterBiz.GetStaffData(Login1.UserName.Trim());

                if (staffData != null)
                //if (staffData != null && IsAuthenticated(Login1.UserName.Trim(), Login1.Password.Trim()))
                {
                    FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
                        1,
                        Login1.UserName.Trim(),
                        DateTime.Now,
                        DateTime.Now.AddMinutes(FormsAuthentication.Timeout.TotalMinutes),
                        Login1.RememberMeSet,
                        staffData.StaffNameTH + "|" + staffData.BranchName + "|" + (staffData.StaffTypeId != null ? staffData.StaffTypeId.Value.ToString() : ""),
                        FormsAuthentication.FormsCookiePath);

                    string encTicket = FormsAuthentication.Encrypt(ticket);
                    Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
                    //Response.Redirect(FormsAuthentication.GetRedirectUrl(Login1.UserName, Login1.RememberMeSet), false);

                    if (Login1.UserName == hddCsmUsername.Value)
                    {
                        Response.Redirect(Server.UrlDecode(hddReturnUrl.Value));
                    }
                    else if (Request["ticketid"] != null && Request["accflag"] == "email")
                    {
                        Response.Redirect("SLM_SCR_004.aspx?ticketid=" + Request["ticketid"] + "&type=" + Request["type"], false);
                    }
                    else
                    {
                        Response.Redirect(FormsAuthentication.DefaultUrl, false);
                    }
                }
                else
                {
                    ((TextBox)Login1.FindControl("Password")).Text = "";
                    _log.Error("Logon failure: unknown user name or bad password.");
                    AppUtil.ClientAlert(Page, "Logon failure: unknown user name or bad password.");
                }
            }
            catch (Exception ex)
            {
                ((TextBox)Login1.FindControl("Password")).Text = "";
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error("(" + Login1.UserName + ") " + message);
                _log.Debug("(" + Login1.UserName + ") ", ex);
                AppUtil.ClientAlert(Page, "Logon failure: unknown user name or bad password.");
            }
        }
        private void SetMenu()
        {
            try
            {
                var staffTypeId = SlmMasterBiz.GetStaffTypeId(HttpContext.Current.User.Identity.Name);
                if (staffTypeId != null)
                {
                    List <ScreenPrivilegeData> list = SlmMasterBiz.GetScreenPrivillegeList(Convert.ToInt32(staffTypeId));

                    menuUserMonitoring.Visible    = (list.Where(p => p.ScreenId == 4 && p.IsView == 1).Count() > 0);    //UserMonitoring
                    menuCampaignRecommend.Visible = (list.Where(p => p.ScreenId == 5 && p.IsView == 1).Count() > 0);    //แนะนำแคมเปญ
                    menuUserManagement.Visible    = (list.Where(p => p.ScreenId == 6 && p.IsView == 1).Count() > 0);    //UserManagement
                    menuNotice.Visible            = (list.Where(p => p.ScreenId == 20 && p.IsView == 1).Count() > 0);   //ข้อมูลประกาศ
                    menuPosition.Visible          = (list.Where(p => p.ScreenId == 21 && p.IsView == 1).Count() > 0);   //ข้อมูลตำแหน่ง
                    menuSLA.Visible               = (list.Where(p => p.ScreenId == 22 && p.IsView == 1).Count() > 0);   //ข้อมูล SLA
                    menuAssign.Visible            = (list.Where(p => p.ScreenId == 23 && p.IsView == 1).Count() > 0);   //ข้อมูล กำหนดค่าการจ่ายงาน
                    menuPrivilege.Visible         = (list.Where(p => p.ScreenId == 24 && p.IsView == 1).Count() > 0);   //ข้อมูล สิทธิ์การเข้าถึงข้อมูล
                    menuActivityPrivilege.Visible = (list.Where(p => p.ScreenId == 25 && p.IsView == 1).Count() > 0);   //ข้อมูล กำหนดเงื่อนไขการบันทึกผลการติดต่อ
                    menuBranchHoliday.Visible     = (list.Where(p => p.ScreenId == 26 && p.IsView == 1).Count() > 0);   //ข้อมูล กำหนดวันหยุดสาขา
                    menuBranch.Visible            = (list.Where(p => p.ScreenId == 27 && p.IsView == 1).Count() > 0);   //ข้อมูล ข้อมูลสาขา
                    menuLead.Visible              = (list.Where(p => p.ScreenId == 29 && p.IsView == 1).Count() > 0);   //ข้อมูล ค้นหา upload lead
                }
                else
                {
                    menuUserMonitoring.Visible    = false;
                    menuCampaignRecommend.Visible = false;
                    menuUserManagement.Visible    = false;
                    menuNotice.Visible            = false;
                    menuPosition.Visible          = false;
                    menuSLA.Visible               = false;
                    menuAssign.Visible            = false;
                    menuPrivilege.Visible         = false;
                    menuActivityPrivilege.Visible = false;
                    menuBranchHoliday.Visible     = false;
                    menuBranch.Visible            = false;
                    menuLead.Visible              = false;
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Debug(message);
            }
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             if (Request["campaignid"] != null)
             {
                 CampaignWSData campaign = SlmMasterBiz.GetCampaign(Request["campaignid"]);
                 if (campaign != null)
                 {
                     lblCampaignName.Text = campaign.CampaignName;
                     ltCampaignDesc.Text  = campaign.CampaignDetail;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         AppUtil.ClientAlert(Page, ex.Message);
     }
 }
Beispiel #4
0
        //private void SetMenu()
        //{
        //    try
        //    {
        //        var staffTypeId = SlmMasterBiz.GetStaffTypeId(HttpContext.Current.User.Identity.Name);
        //        if (staffTypeId != null)
        //        {
        //            List<ScreenPrivilegeData> list = SlmMasterBiz.GetScreenPrivillegeList(Convert.ToInt32(staffTypeId));

        //            menuUserMonitoring.Visible = (list.Where(p => p.ScreenId == 4 && p.IsView == 1).Count() > 0);       //UserMonitoring
        //            menuCampaignRecommend.Visible = (list.Where(p => p.ScreenId == 5 && p.IsView == 1).Count() > 0);    //แนะนำแคมเปญ
        //            menuUserManagement.Visible = (list.Where(p => p.ScreenId == 6 && p.IsView == 1).Count() > 0);       //UserManagement
        //            menuNotice.Visible = (list.Where(p => p.ScreenId == 20 && p.IsView == 1).Count() > 0);              //ข้อมูลประกาศ
        //            menuPosition.Visible = (list.Where(p => p.ScreenId == 21 && p.IsView == 1).Count() > 0);            //ข้อมูลตำแหน่ง
        //            menuSLA.Visible = (list.Where(p => p.ScreenId == 22 && p.IsView == 1).Count() > 0);                 //ข้อมูล SLA
        //            menuAssign.Visible = (list.Where(p => p.ScreenId == 23 && p.IsView == 1).Count() > 0);              //ข้อมูล กำหนดค่าการจ่ายงาน
        //            menuPrivilege.Visible = (list.Where(p => p.ScreenId == 24 && p.IsView == 1).Count() > 0);           //ข้อมูล สิทธิ์การเข้าถึงข้อมูล
        //            menuActivityPrivilege.Visible = (list.Where(p => p.ScreenId == 25 && p.IsView == 1).Count() > 0);   //ข้อมูล กำหนดเงื่อนไขการบันทึกผลการติดต่อ
        //            menuBranchHoliday.Visible = (list.Where(p => p.ScreenId == 26 && p.IsView == 1).Count() > 0);       //ข้อมูล กำหนดวันหยุดสาขา
        //            menuBranch.Visible = (list.Where(p => p.ScreenId == 27 && p.IsView == 1).Count() > 0);              //ข้อมูล ข้อมูลสาขา

        //            //OBT Phase
        //            menuSearchObt.Visible = (list.Where(p => p.ScreenId == 29 && p.IsView == 1).Count() > 0);           //ข้อมูล ค้นหา OBT
        //            menuConfigRule.Visible = (list.Where(p => p.ScreenId == 30 && p.IsView == 1).Count() > 0);          //กำหนดเงื่อนไขการจ่ายงาน OBT
        //            menuReceiveNo.Visible = (list.Where(p => p.ScreenId == 31 && p.IsView == 1).Count() > 0);           //จัดการข้อมูลเลขรับแจ้ง
        //            menuCheckRuleAssign.Visible = (list.Where(p => p.ScreenId == 32 && p.IsView == 1).Count() > 0);     //ตรวจสอบการจ่ายงาน
        //            menuPromotion.Visible = (list.Where(p => p.ScreenId == 33 && p.IsView == 1).Count() > 0);           //นำเข้าข้อมูลโปรโมชั่น
        //            menuImportProblem.Visible = (list.Where(p => p.ScreenId == 34 && p.IsView == 1).Count() > 0);       //นำเข้างานติดปัญหา
        //            menuBenefit.Visible = (list.Where(p => p.ScreenId == 35 && p.IsView == 1).Count() > 0);             //ข้อมูลผลประโยชน์
        //            menuScriptQA.Visible = (list.Where(p => p.ScreenId == 36 && p.IsView == 1).Count() > 0);            //Script QA
        //            menuUserMonitoringReInsurance.Visible = (list.Where(p => p.ScreenId == 37 && p.IsView == 1).Count() > 0);   //User Monitoring RenewInsurance
        //            menuTeamTelesales.Visible = (list.Where(p => p.ScreenId == 38 && p.IsView == 1).Count() > 0);
        //            menuCarType.Visible = (list.Where(p => p.ScreenId == 39 && p.IsView == 1).Count() > 0);
        //            menuNotifyPremium.Visible = (list.Where(p => p.ScreenId == 40 && p.IsView == 1).Count() > 0);       //นำเข้าข้อมูลแจ้งเบี้ย
        //            menuTelesalesPerformance.Visible = (list.Where(p => p.ScreenId == 41 && p.IsView == 1).Count() > 0);    //นำเข้าข้อมูลผลงาน Telesales
        //            menuInsurCom.Visible = (list.Where(p => p.ScreenId == 42 && p.IsView == 1).Count() > 0);            //ข้อมูลบริษัทประกันภัย
        //            menuPremium.Visible = (list.Where(p => p.ScreenId == 43 && p.IsView == 1).Count() > 0);             //ข้อมูล Premium
        //            menuReport.Visible = (list.Where(p => p.ScreenId == 44 && p.IsView == 1).Count() > 0);              //รายงาน
        //            menuRoleDiscount.Visible = (list.Where(p => p.ScreenId == 62 && p.IsView == 1).Count() > 0);
        //            menuPremiumCar.Visible = (list.Where(p => p.ScreenId == 63 && p.IsView == 1).Count() > 0);
        //        }
        //        else
        //        {
        //            menuUserMonitoring.Visible = false;
        //            menuCampaignRecommend.Visible = false;
        //            menuUserManagement.Visible = false;
        //            menuNotice.Visible = false;
        //            menuPosition.Visible = false;
        //            menuSLA.Visible = false;
        //            menuAssign.Visible = false;
        //            menuPrivilege.Visible = false;
        //            menuActivityPrivilege.Visible = false;
        //            menuBranchHoliday.Visible = false;
        //            menuBranch.Visible = false;

        //            //OBT Phase
        //            menuSearchObt.Visible = false;
        //            menuConfigRule.Visible = false;
        //            menuReceiveNo.Visible = false;
        //            menuCheckRuleAssign.Visible = false;
        //            menuPromotion.Visible = false;
        //            menuImportProblem.Visible = false;
        //            menuBenefit.Visible = false;
        //            menuScriptQA.Visible = false;
        //            menuUserMonitoringReInsurance.Visible = false;
        //            menuNotifyPremium.Visible = false;
        //            menuTelesalesPerformance.Visible = false;
        //            menuInsurCom.Visible = false;
        //            menuPremium.Visible = false;
        //            menuReport.Visible = false;
        //        }
        //    }
        //    catch(Exception ex)
        //    {
        //        string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
        //        _log.Error("SetMenu " + message);
        //        _log.Debug("SetMenu ", ex);
        //    }
        //}
        #endregion

        private void SetMenu()
        {
            try
            {
                var staffTypeId = txtStaffTypeId.Text.Trim();   //SlmMasterBiz.GetStaffTypeId(HttpContext.Current.User.Identity.Name);
                if (!string.IsNullOrWhiteSpace(staffTypeId))
                {
                    var list = SlmMasterBiz.GetScreenPrivillegeList(Convert.ToInt32(staffTypeId));

                    menuUserMonitoring.Visible    = list.Any(p => p.ScreenDesc == "SLM_SCR_006" && p.IsView == 1);      //UserMonitoring
                    menuCampaignRecommend.Visible = list.Any(p => p.ScreenDesc == "SLM_SCR_007" && p.IsView == 1);      //แนะนำแคมเปญ
                    menuUserManagement.Visible    = list.Any(p => p.ScreenDesc == "SLM_SCR_008" && p.IsView == 1);      //UserManagement
                    menuNotice.Visible            = list.Any(p => p.ScreenDesc == "SLM_SCR_021" && p.IsView == 1);      //ข้อมูลประกาศ
                    menuPosition.Visible          = list.Any(p => p.ScreenDesc == "SLM_SCR_026" && p.IsView == 1);      //ข้อมูลตำแหน่ง
                    menuSLA.Visible               = list.Any(p => p.ScreenDesc == "SLM_SCR_022" && p.IsView == 1);      //ข้อมูล SLA
                    menuAssign.Visible            = list.Any(p => p.ScreenDesc == "SLM_SCR_023" && p.IsView == 1);      //ข้อมูล กำหนดค่าการจ่ายงาน
                    menuPrivilege.Visible         = list.Any(p => p.ScreenDesc == "SLM_SCR_024" && p.IsView == 1);      //ข้อมูล สิทธิ์การเข้าถึงข้อมูล
                    menuActivityPrivilege.Visible = list.Any(p => p.ScreenDesc == "SLM_SCR_025" && p.IsView == 1);      //ข้อมูล กำหนดเงื่อนไขการบันทึกผลการติดต่อ
                    menuBranchHoliday.Visible     = list.Any(p => p.ScreenDesc == "SLM_SCR_027" && p.IsView == 1);      //ข้อมูล กำหนดวันหยุดสาขา
                    menuBranch.Visible            = list.Any(p => p.ScreenDesc == "SLM_SCR_028" && p.IsView == 1);      //ข้อมูล ข้อมูลสาขา

                    //OBT Phase
                    menuSearchObt.Visible                 = list.Any(p => p.ScreenDesc == "SLM_SCR_029" && p.IsView == 1); //ข้อมูล ค้นหา OBT
                    menuConfigRule.Visible                = list.Any(p => p.ScreenDesc == "SLM_SCR_030" && p.IsView == 1); //กำหนดเงื่อนไขการจ่ายงาน OBT
                    menuReceiveNo.Visible                 = list.Any(p => p.ScreenDesc == "SLM_SCR_031" && p.IsView == 1); //จัดการข้อมูลเลขรับแจ้ง
                    menuCheckRuleAssign.Visible           = list.Any(p => p.ScreenDesc == "SLM_SCR_032" && p.IsView == 1); //ตรวจสอบการจ่ายงาน
                    menuPromotion.Visible                 = list.Any(p => p.ScreenDesc == "SLM_SCR_033" && p.IsView == 1); //นำเข้าข้อมูลโปรโมชั่น
                    menuImportProblem.Visible             = list.Any(p => p.ScreenDesc == "SLM_SCR_034" && p.IsView == 1); //นำเข้างานติดปัญหา
                    menuBenefit.Visible                   = list.Any(p => p.ScreenDesc == "SLM_SCR_035" && p.IsView == 1); //ข้อมูลผลประโยชน์
                    menuScriptQA.Visible                  = list.Any(p => p.ScreenDesc == "SLM_SCR_036" && p.IsView == 1); //Script QA
                    menuUserMonitoringReInsurance.Visible = list.Any(p => p.ScreenDesc == "SLM_SCR_037" && p.IsView == 1); //User Monitoring RenewInsurance
                    menuTeamTelesales.Visible             = list.Any(p => p.ScreenDesc == "SLM_SCR_038" && p.IsView == 1);
                    menuCarType.Visible                   = list.Any(p => p.ScreenDesc == "SLM_SCR_039" && p.IsView == 1);
                    menuNotifyPremium.Visible             = list.Any(p => p.ScreenDesc == "SLM_SCR_040" && p.IsView == 1); //นำเข้าข้อมูลแจ้งเบี้ย
                    menuTelesalesPerformance.Visible      = list.Any(p => p.ScreenDesc == "SLM_SCR_041" && p.IsView == 1); //นำเข้าข้อมูลผลงาน Telesales
                    menuInsurCom.Visible                  = list.Any(p => p.ScreenDesc == "SLM_SCR_042" && p.IsView == 1); //ข้อมูลบริษัทประกันภัย
                    menuPremium.Visible                   = list.Any(p => p.ScreenDesc == "SLM_SCR_043" && p.IsView == 1); //ข้อมูล Premium
                    menuReport.Visible       = list.Any(p => p.ScreenDesc == "SLM_SCR_044" && p.IsView == 1);              //รายงาน
                    menuRoleDiscount.Visible = list.Any(p => p.ScreenDesc == "SLM_SCR_062" && p.IsView == 1);
                    menuPremiumCar.Visible   = list.Any(p => p.ScreenDesc == "SLM_SCR_063" && p.IsView == 1);
                    menuUploadLead.Visible   = list.Any(p => p.ScreenDesc == "SLM_SCR_055" && p.IsView == 1);           //Upload Lead
                    menuReassignLead.Visible = list.Any(p => p.ScreenDesc == "SLM_SCR_058" && p.IsView == 1);           //Re-Assign Lead
                }
                else
                {
                    menuUserMonitoring.Visible    = false;
                    menuCampaignRecommend.Visible = false;
                    menuUserManagement.Visible    = false;
                    menuNotice.Visible            = false;
                    menuPosition.Visible          = false;
                    menuSLA.Visible               = false;
                    menuAssign.Visible            = false;
                    menuPrivilege.Visible         = false;
                    menuActivityPrivilege.Visible = false;
                    menuBranchHoliday.Visible     = false;
                    menuBranch.Visible            = false;

                    //OBT Phase
                    menuSearchObt.Visible                 = false;
                    menuConfigRule.Visible                = false;
                    menuReceiveNo.Visible                 = false;
                    menuCheckRuleAssign.Visible           = false;
                    menuPromotion.Visible                 = false;
                    menuImportProblem.Visible             = false;
                    menuBenefit.Visible                   = false;
                    menuScriptQA.Visible                  = false;
                    menuUserMonitoringReInsurance.Visible = false;
                    menuTeamTelesales.Visible             = false;
                    menuCarType.Visible                   = false;
                    menuNotifyPremium.Visible             = false;
                    menuTelesalesPerformance.Visible      = false;
                    menuInsurCom.Visible                  = false;
                    menuPremium.Visible                   = false;
                    menuReport.Visible       = false;
                    menuRoleDiscount.Visible = false;
                    menuPremiumCar.Visible   = false;

                    menuUploadLead.Visible   = false;
                    menuReassignLead.Visible = false;
                }
            }
            catch (Exception ex)
            {
                string message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                _log.Error("SetMenu " + message);
                _log.Debug("SetMenu ", ex);
            }
        }