Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "Manage Existing Territory";
        Franchisor_FranchisorMaster obj;

        obj = (Franchisor_FranchisorMaster)this.Master;
        obj.settitle("View Territory");
        obj.SetBreadCrumbRoot = "<a href=\"/App/Franchisee/Dashboard.aspx\">DashBoard</a>";
        obj.hideucsearch();
        txtZipCode.Attributes.Add("onKeyDown", "return txtkeypress(event);");
        if (!IsPostBack)
        {
            var currentSession = IoC.Resolve <ISessionContext>().UserSession;

            FranchisorDAL franchisorDAL = new FranchisorDAL();

            int roleID       = Convert.ToInt32(currentSession.CurrentOrganizationRole.RoleId);
            int franchiseeID = Convert.ToInt32(currentSession.CurrentOrganizationRole.OrganizationId);

            var listTerritory = franchisorDAL.GetFranchiseeTerritory("", "", 2, franchiseeID, roleID,
                                                                     Convert.ToInt32(currentSession.UserId));

            ETerritory[] objTerritory = null;
            objTerritory = listTerritory.ToArray();

            //objTerritory = objFranchisorService.GetAllActiveTerritoryForFFU(franchiseeID, true, roleID, true, Convert.ToInt32(objUserRole.UserID),true);

            BindData(objTerritory);
        }
    }
Ejemplo n.º 2
0
    protected void lnkBtnRemove_Click(object sender, EventArgs e)
    {
        LinkButton lnkBtnRemove = (LinkButton)sender;
        string     territoryid  = lnkBtnRemove.CommandArgument;
        bool       result       = new bool();
        //bool temp = true;

        FranchisorDAL franchisorDal = new FranchisorDAL();

        result = franchisorDal.DeleteTerritory(territoryid, 0);

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


        int roleID       = Convert.ToInt32(currentSession.CurrentOrganizationRole.RoleId);
        int franchiseeID = Convert.ToInt32(currentSession.CurrentOrganizationRole.OrganizationId);

        var listTerritory = franchisorDal.GetFranchiseeTerritory(txtSearch.Text.Trim(), txtZipCode.Text, 3, franchiseeID,
                                                                 roleID, Convert.ToInt32(currentSession.UserId));

        ETerritory[] objTerritory = null;

        if (listTerritory != null)
        {
            objTerritory = listTerritory.ToArray();
        }


        BindData(objTerritory);
    }
Ejemplo n.º 3
0
    protected void ibtnSearch_Click(object sender, ImageClickEventArgs e)
    {
        var currentSession = IoC.Resolve <ISessionContext>().UserSession;

        int roleID       = Convert.ToInt32(currentSession.CurrentOrganizationRole.RoleId);
        int franchiseeID = Convert.ToInt32(currentSession.CurrentOrganizationRole.OrganizationId);

        FranchisorDAL franchisorDal = new FranchisorDAL();

        var listTerritory = franchisorDal.GetFranchiseeTerritory(txtSearch.Text.Trim(), txtZipCode.Text, 3, franchiseeID,
                                                                 roleID, Convert.ToInt32(currentSession.UserId));

        ETerritory[] objTerritory = null;

        if (listTerritory != null)
        {
            objTerritory = listTerritory.ToArray();
        }

        //objTerritory = objFranchisorService.SearchTerritoryForFFU(txtSearch.Text.Trim(),txtZipCode.Text, franchiseeID, true, roleID, true, Convert.ToInt32(objUserRole.UserID), true);
        BindData(objTerritory);
    }
Ejemplo n.º 4
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()));
                }
            }
        }
    }