Пример #1
0
    public void BindDrpsite()
    {
        BLLCollection <Site_mst> col      = new BLLCollection <Site_mst>();
        BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
        int      custid  = Convert.ToInt32(drpCustomer.SelectedValue);
        Site_mst ObjSite = new Site_mst();

        col = ObjSite.Get_All();
        foreach (Site_mst obj in col)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colSite1.Add(obj);
            }
        }
        DrpSite.DataTextField  = "sitename";
        DrpSite.DataValueField = "siteid";
        DrpSite.DataSource     = colSite1;
        DrpSite.DataBind();
        ListItem item = new ListItem();

        item.Text  = Resources.MessageResource.errselectste.ToString();
        item.Value = "0";
        DrpSite.Items.Add(item);
        //DrpSite.SelectedValue = "0";
    }
Пример #2
0
    protected void BindDropDown()
    {
        BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
        int custid;

        custid = Convert.ToInt16(drpCustomer.SelectedValue);

        colSite = objSite.Get_All();
        foreach (Site_mst obj in colSite)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colSite1.Add(obj);
            }
        }
        drpSites.DataTextField  = "sitename";
        drpSites.DataValueField = "siteid";
        drpSites.DataSource     = colSite1;
        drpSites.DataBind();
        ListItem item = new ListItem();

        item.Text  = "------------Select-------------";
        item.Value = "0";
        drpSites.Items.Add(item);
        drpSites.SelectedValue = "0";
        //btnReset_Click();
    }
    protected void BindDropDownSiteRegionWise()
    {
        BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
        int custid = Convert.ToInt16(drpRegion.SelectedValue);

        // Declare collection col as Site_mst to get all Sites from database

        // By Calling Function objSite.Get_All() assign to col object
        colSite = objSite.Get_All();
        foreach (Site_mst obj in colSite)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colSite1.Add(obj);
            }
        }
        drpSites.DataTextField  = "sitename";
        drpSites.DataValueField = "siteid";
        drpSites.DataSource     = colSite1;
        drpSites.DataBind();
        ListItem item = new ListItem();

        item.Text  = "------------Select-------------";
        item.Value = "0";
        drpSites.Items.Add(item);
        drpSites.SelectedValue = "0";
    }
    public void BindDrpSite()
    {
        BLLCollection <Site_mst> col      = new BLLCollection <Site_mst>();
        BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
        int custid = Convert.ToInt32(drpCustomer.SelectedValue);

        col = objsite.Get_All();
        foreach (Site_mst obj in col)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colSite1.Add(obj);
            }
        }
        drpsite.DataTextField  = "SiteName";
        drpsite.DataValueField = "siteid";
        drpsite.DataSource     = colSite1;
        drpsite.DataBind();
        ListItem item = new ListItem();

        item.Text  = "-------------Select-------------";
        item.Value = "0";
        drpsite.Items.Add(item);
        drpsite.SelectedValue = "0";
    }
    // Event handler btnSearch_Click , To find user exist or not
    //protected void btnSearch_Click(object sender, EventArgs e)
    //{
    //    // Declare Local Variable Username to get username from textbox
    //    string Username = txtUserName.Text.ToString().Trim();
    //    // Find User Exist in Database by Calling objUser.Get_UserLogin_By_UserName_Like() Function
    //    objUser = objUser.Get_UserLogin_By_UserName_Like(Username);
    //    // If UserId is Not Zero than User Exist
    //    if (objUser.Userid != 0)
    //    {
    //        txtUserName.Text = objUser.Username.ToString().Trim();
    //    }
    //    else
    //    {
    //        txtUserName.Text = "";
    //    }
    //}

    // Bind Grid of grdvwSite , on the basis of drop down value Selection
    protected void BindGrid()
    {
        // Declare Local Variable regionid to get regionid from drpRegion DropDown
        int custid;

        // Assign regionid to localvariable regionid from selected value of drop down
        custid = Convert.ToInt16(drpRegion.SelectedValue);
        // If region is Zero , ie All has been selected ,and bind all Sites Information to Grid
        if (custid == 0)
        {
            colSites             = objSites.Get_All();
            grdvwSite.DataSource = colSites;
            grdvwSite.DataBind();
        }
        else
        {
            // Grid will bind only those sites ,which come under selected region
            BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
            colSites = objSites.Get_All();
            foreach (Site_mst obj in colSites)
            {
                int flag;
                flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
                if (flag == 1)
                {
                    colSite1.Add(obj);
                }
            }
            grdvwSite.DataSource = colSite1;
            grdvwSite.DataBind();
        }
    }
Пример #6
0
    public void BindDrpSite()
    {
        // Declare col as Collection of Site_mst Object to get all records from table
        BLLCollection <Site_mst> col      = new BLLCollection <Site_mst>();
        BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>();
        int custid = Convert.ToInt16(drpCustomer.SelectedValue);

        // declare object objOrganization of Site_mst_mst Class to call function Get_All() to fetch all records from database

        // Assign all records to variable col
        col = objSite.Get_All();
        foreach (Site_mst obj in col)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colSite1.Add(obj);
            }
        }
        drpSite.DataTextField  = "SiteName";
        drpSite.DataValueField = "siteid";

        drpSite.DataSource = colSite1;
        drpSite.DataBind();
        // Declare item as listItem to assign default value to drop down
        ListItem item = new ListItem();

        item.Text  = "--------------Select--------------";
        item.Value = "0";

        drpSite.Items.Add(item);
        drpSite.SelectedValue = "0";
    }
    protected void BindDropSite()
    {
        int userid;

        userid        = objUser.Userid;
        colUserToSite = ObjUserToSite.Get_All_By_userid(userid);
        foreach (UserToSiteMapping Obj in colUserToSite)
        {
            int      siteid;
            Site_mst objSite1 = new Site_mst();
            siteid   = Obj.Siteid;
            objSite1 = objSite.Get_By_id(siteid);
            if (objSite1.Siteid != 0)
            {
                int custid = Convert.ToInt16(drpCustomer.SelectedValue);
                int flag   = objCustToSite.Get_By_Id(custid, objSite1.Siteid);
                if (flag == 1)
                {
                    colSite.Add(objSite1);
                }
            }
        }


        //}
        //drpSite.DataTextField = "sitename";
        //drpSite.DataValueField = "siteid";
        //drpSite.DataSource = colSite ;
        //drpSite.DataBind();

        //        if (colSite.Count == 0)
        //        {
        //            ListItem item = new ListItem();
        //            item.Text = "-------------Select-------------";
        //            item.Value = "0";
        //            drpSite.Items.Add(item);

        //        }


        //    }



        //}

        //protected void BindDropSite()
        //{
        //colSite = objSite.Get_All();
        drpSite.DataTextField  = "sitename";
        drpSite.DataValueField = "siteid";
        drpSite.DataSource     = colSite;
        drpSite.DataBind();
        //ListItem item = new ListItem();
        //item.Text = "-------------Select-------------";
        //item.Value = "0";
        //drpSite.Items.Add(item);
        //drpSite.SelectedValue = "0";
    }
Пример #8
0
    protected void BindDropSite()
    {
        string         userName = "";
        MembershipUser User     = Membership.GetUser();

        if (User != null)
        {
            userName = User.UserName.ToString();
        }


        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            if (objUser.Userid != 0)
            {
                userid        = objUser.Userid;
                colUserToSite = ObjUserToSite.Get_All_By_userid(userid);
                foreach (UserToSiteMapping obj in colUserToSite)
                {
                    int      siteid;
                    Site_mst objSite1 = new Site_mst();
                    siteid   = obj.Siteid;
                    objSite1 = objSite1.Get_By_id(siteid);
                    if (objSite1.Siteid != 0)
                    {
                        int custid = Convert.ToInt16(drpCustomer.SelectedValue);
                        int flag   = objCustToSite.Get_By_Id(custid, objSite1.Siteid);
                        if (flag == 1)
                        {
                            colSite.Add(objSite1);
                        }
                    }
                }
            }
            drpSite.DataTextField  = "sitename";
            drpSite.DataValueField = "siteid";
            drpSite.DataSource     = colSite;
            drpSite.DataBind();

            if (colSite.Count == 0)
            {
                ListItem item = new ListItem();
                item.Text  = "-------------Select-------------";
                item.Value = "0";
                drpSite.Items.Add(item);
            }
        }
    }
    public void BindGrid()
    {
        int custid;

        custid           = Convert.ToInt16(drpRegion.SelectedValue);
        colservicewindow = objservicewindow.Get_All();
        BLLCollection <ServiceWindow_mst> colservicewindow1 = new BLLCollection <ServiceWindow_mst>();

        foreach (ServiceWindow_mst obj in colservicewindow)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                colservicewindow1.Add(obj);
            }
        }

        grdvwViewServiceWindow.DataSource = colservicewindow1;
        grdvwViewServiceWindow.DataBind();
    }
Пример #10
0
    public void BindGridRegion()
    {
        int custid = Convert.ToInt16(drpRegion.SelectedValue);

        // Declare collection col as Site_mst to get all Sites from database
        // By Calling Function objSite.Get_All() assign to col object
        col = objSite.Get_All();

        // Bind GridView by using Datasource and Databind Properties

        BLLCollection <Site_mst> col1 = new BLLCollection <Site_mst>();

        foreach (Site_mst obj in col)
        {
            int flag;
            flag = objCustToSite.Get_By_Id(custid, obj.Siteid);
            if (flag == 1)
            {
                col1.Add(obj);
            }
        }
        grdvwSite.DataSource = col1;
        grdvwSite.DataBind();
    }