Esempio n. 1
0
    public List <string> GetEmployeeForFranchisorByPrefixTextAndContextKey(string prefixText, string contextKey)
    {
        List <string> items         = new List <string>();
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> objFFUser = franchiseeDAL.GetEmployeeForFranchisor(prefixText, Convert.ToInt32(contextKey), 4);

        try
        {
            string struser  = string.Empty;
            string strshell = string.Empty;
            string strrole  = string.Empty;

            foreach (Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser objUser in objFFUser)
            {
                struser  = objUser.FranchiseeUser.User.FirstName + " " + objUser.FranchiseeUser.User.LastName + "[" + objUser.FranchiseeUser.User.UserID + "]";
                strrole  = objUser.RoleType + "[" + objUser.RoleID + "]";
                strshell = objUser.Franchisee.Name + "[" + objUser.Franchisee.FranchiseeID + "]";



                items.Add(struser + " as " + strrole + " in " + strshell);
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }

        return(items);
    }
Esempio n. 2
0
    public string[] GetEmployeeForFranchisor(string prefixText, int count, string contextKey)
    {
        //GetEmployeeForFranchisor
        List <string> items = new List <string>();
        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService objService = new HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService();
        // remove services references
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.EFranchiseeFranchiseeUser[] objFFUser = objService.GetEmployeeForFranchisor(prefixText, Convert.ToInt32(contextKey), true);
        List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> objFFUser = franchiseeDAL.GetEmployeeForFranchisor(prefixText, Convert.ToInt32(contextKey), 4);

        try
        {
            string struser  = string.Empty;
            string strshell = string.Empty;
            string strrole  = string.Empty;

            foreach (Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser objUser in objFFUser)
            {
                struser  = objUser.FranchiseeUser.User.FirstName + " " + objUser.FranchiseeUser.User.LastName + "[" + objUser.FranchiseeUser.User.UserID + "]";
                strrole  = objUser.RoleType + "[" + objUser.RoleID + "]";
                strshell = objUser.Franchisee.Name + "[" + objUser.Franchisee.FranchiseeID + "]";



                items.Add(struser + " as " + strrole + " in " + strshell);
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }

        return(items.ToArray());
    }
Esempio n. 3
0
    public string[] GetSalesRepForFranchisee(string prefixText, int count, string contextKey)
    {
        List <string> items           = new List <string>();
        long          intFranchiseeID = 0;

        if (contextKey != null && contextKey != "")
        {
            intFranchiseeID = Convert.ToInt64(contextKey);
        }

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService objService = new HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService();
        // remove services references
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.EUser[] objEUser = objService.GetSalesRepForFranchisee(prefixText, intFranchiseeID, true, 0, true);
        List <Falcon.Entity.Other.EUser> objEUser = franchiseeDAL.GetSalesRepForFranchisee(prefixText, intFranchiseeID, 0);

        try
        {
            string struser = string.Empty;
            IOrganizationRoleUserRepository orgRoleUserRepository = new OrganizationRoleUserRepository();

            foreach (Falcon.Entity.Other.EUser objUser in objEUser)
            {
                var orgRoleUser = orgRoleUserRepository.GetOrganizationRoleUser(objUser.UserID, Falcon.App.Core.Enum.Roles.SalesRep, intFranchiseeID);
                struser = objUser.FirstName + " [" + orgRoleUser.Id.ToString() + "]";
                items.Add(struser);
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }
        return(items.ToArray());
    }
Esempio n. 4
0
    public string[] GetSalesRepForFranchisee_nonSSL(string prefixText, int count, string contextKey)
    {
        List <string> items           = new List <string>();
        int           intFranchiseeID = 0;

        if (contextKey != null && contextKey != "")
        {
            intFranchiseeID = Convert.ToInt32(contextKey);
        }

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService objService = new HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService();
        // remove services references
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.EUser[] objEUser = objService.GetSalesRepForFranchisee(prefixText, intFranchiseeID, true, 0, true);
        List <Falcon.Entity.Other.EUser> objEUser = franchiseeDAL.GetSalesRepForFranchisee(prefixText, intFranchiseeID, 0);

        try
        {
            string struser = string.Empty;


            foreach (Falcon.Entity.Other.EUser objUser in objEUser)
            {
                struser = objUser.FirstName + " [" + objUser.UserID.ToString() + "]";
                items.Add(struser);
            }
        }
        catch (Exception ex)
        {
            items.Add(ex.Message);
        }
        return(items.ToArray());
    }
Esempio n. 5
0
    private void GetContactFranchisee()
    {
        List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> franchiseefranchiseeuser = null;
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        // format phone no.
        CommonCode objCommonCode = new CommonCode();

        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        var currentOrgRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole;

        if (currentOrgRole.CheckRole((long)Roles.SalesRep))
        {
            franchiseefranchiseeuser = franchiseeDAL.ContactFranchisee(currentSession.CurrentOrganizationRole.OrganizationId.ToString(), 2);
        }
        else
        {
            franchiseefranchiseeuser = franchiseeDAL.ContactFranchisee(string.Empty, 0);
        }

        DataTable dtFranchiseeUser = new DataTable();

        dtFranchiseeUser.Columns.Add("FranhiseeFranchiseeUserID");
        dtFranchiseeUser.Columns.Add("Name");
        dtFranchiseeUser.Columns.Add("Address");
        dtFranchiseeUser.Columns.Add("Phone");
        dtFranchiseeUser.Columns.Add("Email");

        if (franchiseefranchiseeuser != null)
        {
            for (int icount = 0; icount < franchiseefranchiseeuser.Count; icount++)
            {
                string Name    = CommonClass.FormatName(franchiseefranchiseeuser[icount].FranchiseeUser.User.FirstName, "", franchiseefranchiseeuser[icount].FranchiseeUser.User.LastName);
                string Address = CommonClass.FormatAddress(franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Address1, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Address2, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.City, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.State, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Country, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Zip);
                dtFranchiseeUser.Rows.Add(new object[] { franchiseefranchiseeuser[icount].FranchiseeFranchiseeUserID, Name, Address, objCommonCode.FormatPhoneNumberGet(franchiseefranchiseeuser[icount].FranchiseeUser.User.PhoneOffice), franchiseefranchiseeuser[icount].FranchiseeUser.User.EMail1 });
            }
        }

        if ((SortDirection)ViewState["SortContactFranchisee"] == SortDirection.Descending)
        {
            dtFranchiseeUser.DefaultView.Sort = "name desc";
        }
        else
        {
            dtFranchiseeUser.DefaultView.Sort = "name asc";
        }

        dtFranchiseeUser = dtFranchiseeUser.DefaultView.ToTable();

        gridcontactfranchisee.DataSource = dtFranchiseeUser;
        ViewState["DSGRID"] = dtFranchiseeUser;
        gridcontactfranchisee.DataBind();
    }
Esempio n. 6
0
        public static EFranchiseeUser GetFranchiseeUser(UserSessionModel objSession)
        {
            var franchiseeDAL = new FranchiseeDAL();
            List <EFranchiseeUser> franchiseeUserList = franchiseeDAL.GetFranchiseeUser(objSession.UserId.ToString(), objSession.UserId, Roles.FranchiseeAdmin.ToString(), 1);

            if (franchiseeUserList != null && franchiseeUserList.Count > 0)
            {
                return(franchiseeUserList[0]);
            }
            return(null);
        }
Esempio n. 7
0
    protected void btnupdatedown_Click(object sender, EventArgs e)
    {
        string strfolderpath = "/Images/TestUpload/";
        // Loop through each Image control
        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        EFranchiseeUser franchiseeuser = OrganizationUser.GetFranchiseeUser(currentSession);

        string strtemp = string.Empty;

        strtemp = ucmyphoto.SaveImage(strfolderpath + "MyPic" + DateTime.Now.ToString("yyyyMMddhhmmss"));

        if (strtemp != string.Empty)
        {
            franchiseeuser.MyPicture = "~" + strtemp;
        }

        strtemp = ucteamphoto.SaveImage(strfolderpath + "TeamPic" + DateTime.Now.ToString("yyyyMMddhhmmss"));
        if (strtemp != string.Empty)
        {
            franchiseeuser.TeamPicture = "~" + strtemp;
        }

        for (Int16 icount = 0; icount < 12; icount++)
        {
            UCCommon_ucphotopanel Ucphotopanel1 = (UCCommon_ucphotopanel)grdphotoother.Rows[icount].FindControl("Ucphotopanel1");
            strtemp = Ucphotopanel1.SaveImage(strfolderpath + icount + DateTime.Now.ToString("yyyyMMddhhmmss"));

            if (strtemp != string.Empty)
            {
                franchiseeuser.OtherPictures[icount] = "~" + strtemp;
            }
        }

        var usershellmodulerole1 = new Falcon.Entity.User.EUserShellModuleRole();

        usershellmodulerole1.RoleID  = currentSession.CurrentOrganizationRole.RoleId.ToString();
        usershellmodulerole1.ShellID = currentSession.CurrentOrganizationRole.OrganizationId.ToString();
        usershellmodulerole1.UserID  = currentSession.UserId.ToString();

        var franchiseeDal = new FranchiseeDAL();

        long returnresult = franchiseeDal.SaveFranchiseeUserImages(franchiseeuser, Convert.ToInt32(EOperationMode.Update), usershellmodulerole1.UserID, usershellmodulerole1.ShellID, usershellmodulerole1.RoleID);

        if (returnresult == 0)
        {
            returnresult = 9999991;
        }

        System.Text.StringBuilder strJSCloseWindow = new System.Text.StringBuilder();
        strJSCloseWindow.Append(" <script language = 'Javascript'>window.close(); </script>");
        ClientScript.RegisterStartupScript(typeof(string), "JSCode", strJSCloseWindow.ToString());
    }
Esempio n. 8
0
    public Int64 UpdateAdvocateSalesManagerTeam_nonSSL(Int64 intAdvocateSalesManagerId, Int64 intSalesrepId, Boolean bolStatus)
    {
        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService objFFUserService = new HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService();
        // remove service references
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        Int64 retrurnvalue = new Int64();

        //objFFUserService.UpdateAdvocateSalesManagerTeam(intAdvocateSalesManagerId, true, intSalesrepId, true, bolStatus, true, out  retrurnvalue, out temp);
        franchiseeDAL.UpdateAdvocateSalesManagerTeam(intAdvocateSalesManagerId, intSalesrepId, bolStatus);
        return(retrurnvalue);
    }
Esempio n. 9
0
    public string[] GetMatchingFranchiseeUserList(string prefixText, int count, string contextKey)
    {
        List <string> items = new List <string>();

        FranchiseeDAL franchiseeDal = new FranchiseeDAL();

        Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser[] objFfu = franchiseeDal.GetMatchingFranchiseeUserList(prefixText, 1, Convert.ToInt32(contextKey)).ToArray();

        foreach (Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser objEffu in objFfu)
        {
            items.Add(objEffu.FranchiseeUser.User.FirstName + " [ID:" + objEffu.FranchiseeFranchiseeUserID + "]");
        }
        return(items.ToArray());
    }
Esempio n. 10
0
    public List <string> GetSalesRepForFranchisorByPrefixText(string prefixText)
    {
        FranchiseeDAL franchiseeDal = new FranchiseeDAL();

        return(franchiseeDal.GetEmployeeForFranchisor(prefixText, 0, 5)
               .Select <EFranchiseeFranchiseeUser, string>(franchiseeUser =>
        {
            string user = franchiseeUser.FranchiseeUser.User.FirstName + " " + franchiseeUser.FranchiseeUser.User.LastName + "[" + franchiseeUser.FranchiseeFranchiseeUserID.ToString() + "]";
            string role = franchiseeUser.RoleType;
            string shell = franchiseeUser.Franchisee.Name + "[" + franchiseeUser.Franchisee.FranchiseeID + "]";

            return user + " as " + role + " in " + shell;
        }).ToList <string>());
    }
Esempio n. 11
0
    private void BindSalesRepOnTerritory()
    {
        long franchiseeId = 0;

        var userSession = IoC.Resolve <ISessionContext>().UserSession;

        if (userSession.CurrentOrganizationRole.CheckRole((long)Roles.SalesRep))
        {
            var franchiseeDAL = new FranchiseeDAL();
            var franchisee    = franchiseeDAL.GetAllSalesRepOnTerritory(userSession.CurrentOrganizationRole.OrganizationRoleUserId);

            if (franchisee.Count > 0)
            {
                _assignedTo.Items.Add(new ListItem("ALL", "0"));
                foreach (EFranchiseeFranchiseeUser t in franchisee)
                {
                    _assignedTo.Items.Add(new ListItem(t.FranchiseeUser.User.FirstName + " " + t.FranchiseeUser.User.LastName, t.FranchiseeFranchiseeUserID.ToString()));
                }
            }
            else
            {
                franchiseeId = userSession.CurrentOrganizationRole.OrganizationId;

                _assignedTo.Items.Add(new ListItem("ALL", "0"));
                try
                {
                    ISalesRepresentativeRepository _salesRepresentativeRepository = new SalesRepresentativeRepository();
                    List <SalesRepresentative>     salesRepresentatives           = _salesRepresentativeRepository.
                                                                                    GetSalesRepresentativesForFranchisee(franchiseeId).OrderBy(sr => sr.Name.FullName).ToList();
                    for (int count = 0; count < salesRepresentatives.Count; count++)
                    {
                        _assignedTo.Items.Add(new ListItem(salesRepresentatives[count].Name.FullName, salesRepresentatives[count].SalesRepresentativeId.ToString()));
                    }
                }
                catch
                { }
            }
            _spnAssignedTo.Style.Add(HtmlTextWriterStyle.Display, "block");
        }
        else
        {
            // Hide drop down
            _spnAssignedTo.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
    }
Esempio n. 12
0
    public string[] GetMatchingFranchiseeUserListSalesRep(string prefixText, int count, string contextKey)
    {
        List <string> items = new List <string>();
        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService objFFUService = new HealthYes.Web.UI.FranchiseeFranchiseeUserService.FranchiseeFranchiseeUserService();
        // remove service references
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        //HealthYes.Web.UI.FranchiseeFranchiseeUserService.EFranchiseeFranchiseeUser[] objFFU = objFFUService.GetMatchingFranchiseeUserListSalesRep(prefixText, Convert.ToInt32(contextKey), true);
        List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> objFFU = franchiseeDAL.GetMatchingFranchiseeUserList(prefixText, 0, Convert.ToInt32(contextKey));



        foreach (Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser objEFFU in objFFU)
        {
            items.Add(objEFFU.FranchiseeUser.User.FirstName + " [ID:" + objEFFU.FranchiseeFranchiseeUserID + "]");
        }
        return(items.ToArray());
    }
    /// <summary>
    /// Fills all the drop down with values from db
    /// </summary>
    private void GetAllDropDownInfo()
    {
        //FranchiseeFranchiseeUserService objservice = new FranchiseeFranchiseeUserService();

        List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> arrfranchiseeuser;

        var franchiseeDal = new FranchiseeDAL();

        arrfranchiseeuser = franchiseeDal.GetFranchiseeEmployeeByName("", 0, 6);

        for (int icount = 0; icount < arrfranchiseeuser.Count; icount++)
        {
            string techname = arrfranchiseeuser[icount].FranchiseeUser.User.FirstName;
            techname += arrfranchiseeuser[icount].FranchiseeUser.User.MiddleName.Length > 0 ? " " + arrfranchiseeuser[icount].FranchiseeUser.User.MiddleName : "";
            techname += arrfranchiseeuser[icount].FranchiseeUser.User.LastName.Length > 0 ? " " + arrfranchiseeuser[icount].FranchiseeUser.User.LastName : "";
            ddluploadedby.Items.Add(new ListItem(techname, arrfranchiseeuser[icount].FranchiseeFranchiseeUserID.ToString()));
        }

        ddluploadedby.Items.Insert(0, new ListItem("Select Technician", "0"));
    }
Esempio n. 14
0
    /// <summary>
    /// Get the list of sales rep of the
    /// advocate sales manager franchisee
    /// </summary>
    private void getTeamForAdvocateSalesManager()
    {
        // format phone no.
        CommonCode objCommonCode = new CommonCode();

        //FranchiseeFranchiseeUserService objFFService = new FranchiseeFranchiseeUserService();
        // Removed Franchisee Service
        FranchiseeDAL franchiseeDAL = new FranchiseeDAL();

        List <EFranchiseeFranchiseeUser> objFFUser = null;

        //objFFUser = objFFService.GetTeamForAdvocateSalesManager(1, true, intAdvocateSalesManagerId, true);
        objFFUser = franchiseeDAL.GetTeamForAdvocateSalesManager(1, intAdvocateSalesManagerId);

        DataTable dtSalesTeam = new DataTable();

        dtSalesTeam.Columns.Add("Sr");
        dtSalesTeam.Columns.Add("FranchiseeFranchiseeUserID");
        dtSalesTeam.Columns.Add("Name");
        dtSalesTeam.Columns.Add("Phone");
        dtSalesTeam.Columns.Add("Email");
        dtSalesTeam.Columns.Add("FranchiseeID");
        dtSalesTeam.Columns.Add("ManagerID");
        dtSalesTeam.Columns.Add("ManagerName");
        dtSalesTeam.Columns.Add("Status");
        Falcon.Entity.Other.EUser objuser;

        if (objFFUser != null)
        {
            for (int icount = 0; icount < objFFUser.Count; icount++)
            {
                string strName;
                objuser = objFFUser[icount].FranchiseeUser.User;

                strName = CommonClass.FormatName(objuser.FirstName, objuser.MiddleName, objuser.LastName);

                string strStatus;

                if (objFFUser[icount].AdvocateSalesManagerID == 0)
                {
                    strStatus = "<a href='#'  onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",true)'>Add</a> ";
                }
                else if (objFFUser[icount].AdvocateSalesManagerID == intAdvocateSalesManagerId)
                {
                    strStatus = "<a href='#'  onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",false)'>Remove</a> ";
                }
                else
                {
                    strStatus = objFFUser[icount].AdvocateSalesManager;
                }

                if ((objFFUser[icount].FranchiseeUser.User.PhoneHome == "") || (objFFUser[icount].FranchiseeUser.User.PhoneHome == string.Empty))
                {
                    objFFUser[icount].FranchiseeUser.User.PhoneHome = "N/A";
                }
                else
                {
                    objFFUser[icount].FranchiseeUser.User.PhoneHome = objCommonCode.FormatPhoneNumberGet(objFFUser[icount].FranchiseeUser.User.PhoneHome);
                }
                if ((objFFUser[icount].FranchiseeUser.User.EMail1 == "") || (objFFUser[icount].FranchiseeUser.User.EMail1 == string.Empty))
                {
                    objFFUser[icount].FranchiseeUser.User.EMail1 = "N/A";
                }
                dtSalesTeam.Rows.Add(new object[] { icount + 1, objFFUser[icount].FranchiseeFranchiseeUserID,
                                                    strName, objFFUser[icount].FranchiseeUser.User.PhoneHome, objFFUser[icount].FranchiseeUser.User.EMail1, objFFUser[icount].Franchisee.FranchiseeID, objFFUser[icount].AdvocateSalesManagerID, objFFUser[icount].AdvocateSalesManager, strStatus });
            }
        }


        grdTeam.DataSource  = dtSalesTeam;
        ViewState["DSGRID"] = dtSalesTeam;
        grdTeam.DataBind();
    }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Int16 pagenumber = 1;
                Int16 pagesize   = 10;
                Int64 salesrepid = 0;

                Int16 viewmode    = 0;
                Int16 relatedmode = 0;

                string relatedkeyword = "";
                string keyword = "";
                string datefrom, dateto;
                datefrom = ""; dateto = "";

                if (Request.QueryString["PageNumber"] != null)
                {
                    pagenumber = Convert.ToInt16(Request.QueryString["PageNumber"]);
                }
                if (Request.QueryString["PageSize"] != null)
                {
                    pagesize = Convert.ToInt16(Request.QueryString["PageSize"]);
                }
                if (Request.QueryString["SalesRepID"] != null)
                {
                    salesrepid = Convert.ToInt64(Request.QueryString["SalesRepID"]);
                }

                if (Request.QueryString["DateFrom"] != null)
                {
                    datefrom = Request.QueryString["DateFrom"];
                }
                if (Request.QueryString["DateTo"] != null)
                {
                    dateto = Request.QueryString["DateTo"];
                }

                if (Request.QueryString["ViewMode"] != null)
                {
                    if (Request.QueryString["ViewMode"].ToUpper() == "ALL")
                    {
                        viewmode = 0;
                    }
                    else if (Request.QueryString["ViewMode"].ToUpper() == "PROSPECT")
                    {
                        viewmode = 1;
                    }
                    else if (Request.QueryString["ViewMode"].ToUpper() == "HOST")
                    {
                        viewmode = 2;
                    }
                    else if (Request.QueryString["ViewMode"].ToUpper() == "EVENT")
                    {
                        viewmode = 3;
                    }
                }
                if (Request.QueryString["RelatedMode"] != null)
                {
                    if (Request.QueryString["RelatedMode"].ToUpper() == "PROSPECT")
                    {
                        relatedmode = 1;
                    }
                    else if (Request.QueryString["RelatedMode"].ToUpper() == "HOST")
                    {
                        relatedmode = 2;
                    }
                    else if (Request.QueryString["RelatedMode"].ToUpper() == "CONTACT")
                    {
                        relatedmode = 3;
                    }
                    else if (Request.QueryString["RelatedMode"].ToUpper() == "EVENT")
                    {
                        relatedmode = 4;
                    }
                }
                if (Request.QueryString["RelatedKeyword"] != null)
                {
                    relatedkeyword = Request.QueryString["RelatedKeyword"];
                }


                if (Request.QueryString["Keyword"] != null)
                {
                    keyword = Request.QueryString["Keyword"];
                }

                //FranchiseeService objservice = new HealthYes.Web.UI.FranchiseeService.FranchiseeService();
                FranchiseeDAL franchiseeDAL = new FranchiseeDAL();
                List <ESalesRepMyActivity> arrsalesrepmyactivity = null;

                long totalrecords;

                if (Request.QueryString["SearchMode"] != null)
                {
                    arrsalesrepmyactivity = franchiseeDAL.GetSalesRepMyActivityInfo(salesrepid, pagenumber, pagesize, datefrom, dateto, relatedkeyword, relatedmode, keyword, true, viewmode, out totalrecords, 1);
                }
                else
                {
                    arrsalesrepmyactivity = franchiseeDAL.GetSalesRepMyActivityInfo(salesrepid, pagenumber, pagesize, "", "", "", 0, "", false, viewmode, out totalrecords, 1);
                }

                if (arrsalesrepmyactivity != null)
                {
                    FillGridforMyActivity(arrsalesrepmyactivity);
                    string pagingstring = ImplementPaging(pagenumber, pagesize, totalrecords);

                    HtmlForm Formnew = this.Page.Form;
                    Formnew.Controls.Clear();
                    Formnew.Controls.Add(grdMyActivities);

                    System.Text.StringBuilder sb       = new System.Text.StringBuilder();
                    HtmlTextWriter            htWriter = new HtmlTextWriter(new System.IO.StringWriter(sb));

                    Formnew.RenderControl(htWriter);

                    string strRenderedHTML = sb.ToString();
                    int    startindex      = strRenderedHTML.IndexOf("<table");
                    int    endindex        = strRenderedHTML.IndexOf("</table>");
                    int    length          = (endindex - startindex) + 8;
                    strRenderedHTML = strRenderedHTML.Substring(startindex, length);

                    strRenderedHTML = "<div style='float: left; width: 746px'>" + strRenderedHTML + "</div>";

                    Response.Write(strRenderedHTML + pagingstring + "<p class=\"blueboxbotbg_cl\"><img src=\"/App/Images/specer.gif\" width=\"746\" height=\"5\" /></p>");
                }
                else
                {
                    Response.Write("<div id=\"divNoRecords\" style=\"float: left; width: 714px; display: block; padding: 10px 10px 10px 20px; border: solid 1px #DFEEF5;\"><div class=\"divnoitemfound1_custdbrd\"><p class=\"divnoitemtxt_custdbrd\"><span class=\"orngbold18_default\">No Record Found</span></p></div></div>");
                }
                //else
                //{
                //    HtmlForm Formnew = this.Page.Form;
                //    Formnew.Controls.Clear();

                //    activityMessage.ShowErrorMessage("No Records Found.");
                //    activityDiv.Style.Add(HtmlTextWriterStyle.Display, "block");

                //    Formnew = this.Page.Form;
                //    Formnew.Controls.Clear();
                //    Formnew.Controls.Add(activityDiv);

                //    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                //    HtmlTextWriter htWriter = new HtmlTextWriter(new System.IO.StringWriter(sb));
                //    Formnew.RenderControl(htWriter);

                //    string strRenderedHTML = sb.ToString();
                //    int startindex = strRenderedHTML.IndexOf("<div id=\"activityDiv\"");
                //    int endindex = strRenderedHTML.IndexOf("</div>");
                //    int length = (endindex - startindex) + 6;
                //    strRenderedHTML = strRenderedHTML.Substring(startindex, length);

                //    Response.Write(strRenderedHTML);
                //}
            }
            catch (Exception ex)
            {
                //Response.Write("<span style='float:left; padding:5px; font-size:14px'> <b> Some Error occured, data could not be loaded. </b> </span>");
                Response.Write("<span style='float:left; padding:5px; font-size:14px'> <b> " + ex.Message + "</b> </span>");
            }
            finally
            {
                Response.End();
            }
        }
Esempio n. 16
0
    /// <summary>
    /// Binds all dropdown (Status,Type and SalesRep)
    /// </summary>
    private void BindDropDown()
    {
        //Fill status dropdown
        GetStatus();


        IOrganizationRepository repository = new OrganizationRepository();
        var franchisees = repository.GetOrganizationIdNamePairs(Falcon.App.Core.Users.Enum.OrganizationType.Franchisee);

        if (franchisees != null)
        {
            ddlFranchisee.DataSource     = franchisees;
            ddlFranchisee.DataTextField  = "FirstValue";
            ddlFranchisee.DataValueField = "SecondValue";
            ddlFranchisee.DataBind();
            ddlFranchisee.Items.Insert(0, new ListItem("ALL", "0"));
        }

        //Fill Events dropdown
        var li = new ListItem {
            Text = "All", Value = "0"
        };

        ddlEvents.Items.Add(li);
        li = new ListItem {
            Text = "Yes", Value = "1"
        };
        ddlEvents.Items.Add(li);
        li = new ListItem {
            Text = "No", Value = "2"
        };
        ddlEvents.Items.Add(li);

        var currentSession = IoC.Resolve <ISessionContext>().UserSession;
        var franchisorDal  = new FranchisorDAL();
        var listTerritory  = franchisorDal.GetFranchiseeTerritory("", "", 4,
                                                                  currentSession.CurrentOrganizationRole.OrganizationRoleUserId, currentSession.CurrentOrganizationRole.RoleId, currentSession.UserId);

        ETerritory[] objTerritory = null;
        if (listTerritory != null)
        {
            objTerritory = listTerritory.ToArray();
        }
        if (objTerritory != null && objTerritory.Length > 0)
        {
            for (int count = 0; count < objTerritory.Length; count++)
            {
                ddlTerritory.Items.Add(new ListItem(objTerritory[count].Name, objTerritory[count].TerritoryID.ToString()));
            }
        }
        ddlTerritory.Items.Insert(0, new ListItem("Select Territory", "0"));

        //Fill type dropdown
        var franchiseeDal            = new FranchiseeDAL();
        var listProspectKeyPairValue = franchiseeDal.GetProspectTypeKeyValue();

        if (listProspectKeyPairValue != null)
        {
            EKeyValuepair[] prospectType = listProspectKeyPairValue.ToArray();
            if (prospectType.Length > 0)
            {
                _hostType.Items.Add(new ListItem("ALL", "0"));
                for (int count = 0; count < prospectType.Length; count++)
                {
                    _hostType.Items.Add(new ListItem(prospectType[count].Value, prospectType[count].Key.ToString()));
                }
            }
        }
    }
Esempio n. 17
0
    public List <string> GetFranchiseeByPrefixTextAndContextKey(string prefixText, string contextKey)
    {
        FranchiseeDAL franchiseeDal = new FranchiseeDAL();

        return(franchiseeDal.GetSimilarFranchiseeFranchiseeUser(prefixText, 0, Convert.ToInt32(contextKey)).Select <EFranchiseeFranchiseeUser, string>(eUser => eUser.FranchiseeUser.User.FirstName + " [ID:" + eUser.FranchiseeFranchiseeUserID + "]").ToList <string>());
    }