protected void Page_Load(object sender, EventArgs e)
    {
        Ucleftpanel1.Redirect = false;

        Ucmenucontrol2.RoleName = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleAlias;
        if (IsPostBack != true)
        {
            spcurdate.InnerText = DateTime.Now.ToString("dddd, dd MMMM, yyyy");

            var currentRole = (Roles)IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.GetSystemRoleId;
            Ucwelcomebox2.SetLinks(currentRole);
            OtherDAL otherDal         = new OtherDAL();
            string   strSystemVersion = otherDal.GetConfigurationValue("SystemVersion");

            HtmlAnchor anchor = (HtmlAnchor)Ucwelcomebox2.FindControl("lnkdashboard");

            SetLeftPanel(currentRole.ToString());
            SetRecentVisited(currentRole.ToString());
        }
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Flag to display the QA Bar or Not
            string strQaBar = string.Empty;
            var    otherDal = new OtherDAL();
            strQaBar = otherDal.GetConfigurationValue("DisplayBarOnQA");

            if (strQaBar != null && strQaBar != "")
            {
                divQAMain.InnerHtml = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(strQaBar, true);
                divQA.Style.Add(HtmlTextWriterStyle.Display, "block");
                divQA.Style.Add(HtmlTextWriterStyle.Visibility, "visible");
            }
            else
            {
                divQA.Style.Add(HtmlTextWriterStyle.Display, "none");
                divQA.Style.Add(HtmlTextWriterStyle.Visibility, "hidden");
            }
        }
    }
Exemple #3
0
    private void SearchEvent()
    {
        var otherDal = new OtherDAL();
        int distance = 0;


        if (!int.TryParse(otherDal.GetConfigurationValue("Eventdistance"), out distance))
        {
            distance = 0;
        }

        ViewState["SortExp"] = txtZip.Text == string.Empty ? "Name" : "Distance";


        var eventService = IoC.Resolve <IEventService>();

        List <EventHostViewData> eventHostViewData = eventService.GetEventHostViewData(ViewType.CustomerPortal, txtState.Text, txtCity.Text,
                                                                                       string.Empty, txtZip.Text, distance,
                                                                                       txtFrom.Text.Length > 0
                                                                   ? (DateTime?)Convert.ToDateTime(txtFrom.Text)
                                                                   : null,
                                                                                       txtTo.Text.Length > 0
                                                                   ? (DateTime?)Convert.ToDateTime(txtTo.Text)
                                                                   : null);


        var eventsDataTable = new DataTable();

        eventsDataTable.Columns.Add("Id");
        eventsDataTable.Columns.Add("Name");
        eventsDataTable.Columns.Add("Date");
        eventsDataTable.Columns.Add("Host");
        eventsDataTable.Columns.Add("Address");
        eventsDataTable.Columns.Add("Distance");
        eventsDataTable.Columns.Add("GoogleMap");
        eventsDataTable.Columns.Add("IsSlotsAvailable", typeof(bool));
        eventsDataTable.Columns.Add("IsNoSlotsAvailable", typeof(bool));
        eventsDataTable.Columns.Add("TempUnavailable", typeof(bool));
        eventsDataTable.Columns.Add("EventType");

        if (eventHostViewData != null)
        {
            foreach (var eventHost in eventHostViewData)
            {
                if (eventHostViewData.IndexOf(eventHost) > 9)
                {
                    break;
                }

                string strAddress = CommonCode.AddressMultiLine(eventHost.StreetAddressLine1, eventHost.StreetAddressLine2, eventHost.City, eventHost.State, eventHost.Zip);
                //string strGoogleMap = eventHost.StreetAddressLine1 + "," + eventHost.City + "," + eventHost.State + "," + eventHost.Zip;
                string strGoogleMap = CommonCode.GetGoogleMapAddress(eventHost.StreetAddressLine1, eventHost.City, eventHost.State, eventHost.Zip, eventHost.Latitude + "," + eventHost.Longitude, eventHost.UseLatitudeAndLongitudeForMapping);

                bool slotsAvailable   = true;
                bool noSlotsAvailable = true;
                bool tempUnavailable  = true;

                if (Convert.ToString(Enum.Parse(typeof(EventStatus), eventHost.EventStatus)).Equals("Suspended"))
                {
                    slotsAvailable   = false;
                    noSlotsAvailable = false;
                }
                else
                {
                    tempUnavailable = false;
                    if (eventHost.AvailableAppointmentSlots > 0)
                    {
                        noSlotsAvailable = false;
                    }
                    else
                    {
                        slotsAvailable = false;
                    }
                }

                eventsDataTable.Rows.Add(new object[] { eventHost.EventId, eventHost.Name,
                                                        Convert.ToDateTime(eventHost.EventDate).ToString("MM/dd/yyyy"),
                                                        eventHost.OrganizationName, strAddress, eventHost.DistanceFromZip,
                                                        strGoogleMap, slotsAvailable, noSlotsAvailable, tempUnavailable, eventHost.EventType });
            }
        }
        if (eventsDataTable.Rows.Count > 0)
        {
            ViewState["Event"] = eventsDataTable;
            dgEvent.DataSource = eventsDataTable;

            dgEvent.Visible = true;
            dgEvent.DataBind();
            dvSearchResult1.InnerText = "Total: ";
            dvSearchResult.InnerText  = eventsDataTable.Rows.Count + " Result found";
        }
        else
        {
            dgEvent.Visible          = false;
            dvSearchResult.InnerText = "No Result found";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "Call Center Rep Dashboard";
        var obj = (CallCenter_CallCenterMaster)this.Master;

        obj.settitle("Call Center Rep Dashboard");
        obj.SetBreadCrumbRoot = "<a href=\"/CallCenter/CallCenterRepDashboard/Index\">Dashboard</a>";

        if (!IsPostBack)
        {
            if (Request.UrlReferrer != null && (Request.UrlReferrer.LocalPath != Request.Url.LocalPath))
            {
                if (RegistrationFlow != null)
                {
                    RegistrationFlow.CallId = 0;
                }
            }
        }

        if (!IsPostBack)
        {
            chkOutBoundCall.Attributes.Add("onClick", "return CheckOutBoundCall();");
            ibtnStartCall.Enabled   = false;
            chkOutBoundCall.Enabled = false;

            if (Session["LastLoginTime"] != null && Session["LastLoginTime"].ToString().Trim() != "")
            {
                spLastLogin.InnerText = "Last login: "******"LastLoginTime"].ToString()).ToString("MMMM dd, yyyy, hh:mm tt");
            }
            else
            {
                divLastLogin.Visible = false;
            }

            txtIncomingPhLine.Focus();

            if (Request.QueryString["dn"] != null)
            {
                txtIncomingPhLine.Text = Request.QueryString["dn"];
            }

            if (Request.QueryString["cn"] != null)
            {
                txtCallersPhNumber.Text = Request.QueryString["cn"];
            }
            else if (Request.QueryString["amp;cn"] != null)
            {
                txtCallersPhNumber.Text = Request.QueryString["amp;cn"];
            }

            if (!string.IsNullOrWhiteSpace(txtCallersPhNumber.Text) && txtCallersPhNumber.Text.Length > 3 && txtCallersPhNumber.Text.IndexOf("000", 0, 3) >= 0)
            {
                var configurationSettingRe = IoC.Resolve <IConfigurationSettingRepository>();
                var areaCode = Convert.ToString(configurationSettingRe.GetConfigurationValue(ConfigurationSettingName.AreaCode));
                if (!string.IsNullOrWhiteSpace(areaCode))
                {
                    txtCallersPhNumber.Text = txtCallersPhNumber.Text.Replace(txtCallersPhNumber.Text, areaCode + txtCallersPhNumber.Text.Substring(3));
                }
            }


            if (IoC.Resolve <ISettings>().EnableCallPop)
            {
                ibtnStartCall.Enabled = true;
                ClientScript.RegisterStartupScript(typeof(string), "jscode_checkStartCall", "CheckOutBoundCall();", true);
                chkOutBoundCall.Enabled = true;
            }
            else if (txtIncomingPhLine.Text != "" && txtCallersPhNumber.Text != "")
            {
                ibtnStartCall.Enabled = true;
                ibtnStartCall.ToolTip = "";
            }
            else
            {
                ibtnStartCall.Enabled = true;
                ClientScript.RegisterStartupScript(typeof(string), "jscode_checkStartCall", "CheckOutBoundCall();", true);
                chkOutBoundCall.Enabled = true;

                ibtnStartCall.ToolTip = "Please select Checkbox to start call.";
            }

            var callcenterDal = new CallCenterDAL();

            List <EScript> scripts = callcenterDal.GetScript(callcenterDal.GetScriptType("Welcome Script", 2)[0].ScriptTypeID.ToString(), 4);

            scripts[0].ScriptText = scripts[0].ScriptText.Replace("<<Your Name>>", IoC.Resolve <ISessionContext>().UserSession.FullName);
            //spWelcomeScript.InnerText = scripts[0].ScriptText;
            // to check if the existing call is in progress

            if (ExisitingCallId > 0)
            {
                hfCallStartTime.Value = new CallCenterCallRepository().GetCallStarttime(ExisitingCallId);
                ScriptManager.RegisterStartupScript(this.Page, typeof(Int32), "JS",
                                                    "<script language='javascript'>var hfCallStartTime= document.getElementById('" +
                                                    hfCallStartTime.ClientID + "'); Call();  </script>", false);
            }
            else if (Request.QueryString["dn"] != null && (Request.QueryString["cn"] != null || Request.QueryString["amp;cn"] != null))
            {
                StartCallAutomatically = true;
            }

            // Get Dashboard Referesh Time From DB
            var otherDal = new OtherDAL();
            hidRefereshTime.Value = otherDal.GetConfigurationValue("CCRepDashBoardRefereshTime");
        }
        else
        {
            if (Request.Params["__EVENTTARGET"] != null && Request.Params["__EVENTTARGET"] == "setCallStartTime")
            {
                //Doing Nothing
            }
        }
        BindDropDownControls();
    }