protected void BindGrid()
    {
        int TotalSpentTimeInMins = 0;
        int filterid = Convert.ToInt16(drpFilter.SelectedValue);
        BLLCollection<Contract_mst> col = new BLLCollection<Contract_mst>();
        colContract = objContract.Get_All();
        foreach (Contract_mst obj in colContract)
        {
            Contract_mst objCon = new Contract_mst();
            objCon = obj.Get_By_id(obj.Contractid);
            if (filterid == 1)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins>0)
                 {
                     col.Add(objCon);
                 }

            }
            if (filterid == 2)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins <= 0)
                {
                    col.Add(objCon);
                }

            }
            if (filterid == 3)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins <= 0 && TotalSpentTimeInMins > (-10080))
                {
                    col.Add(objCon);
                }

            }
            if (filterid == 4)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins >0 && TotalSpentTimeInMins < 10080)
                {
                    col.Add(objCon);
                }

            }
            if (filterid == 5)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins > 0 && TotalSpentTimeInMins < 21600)
                {
                    col.Add(objCon);
                }

            }

        }
        grvwContract.DataSource = col;
        grvwContract.DataBind();
    }
Beispiel #2
0
    protected void BindGrid()
    {
        int TotalSpentTimeInMins         = 0;
        int filterid                     = Convert.ToInt16(drpFilter.SelectedValue);
        BLLCollection <Contract_mst> col = new BLLCollection <Contract_mst>();

        colContract = objContract.Get_All();
        foreach (Contract_mst obj in colContract)
        {
            Contract_mst objCon = new Contract_mst();
            objCon = obj.Get_By_id(obj.Contractid);
            if (filterid == 1)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins > 0)
                {
                    col.Add(objCon);
                }
            }
            if (filterid == 2)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins <= 0)
                {
                    col.Add(objCon);
                }
            }
            if (filterid == 3)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins <= 0 && TotalSpentTimeInMins > (-10080))
                {
                    col.Add(objCon);
                }
            }
            if (filterid == 4)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins > 0 && TotalSpentTimeInMins < 10080)
                {
                    col.Add(objCon);
                }
            }
            if (filterid == 5)
            {
                TotalSpentTimeInMins = obj.Get_Contract_Status(objCon.Activeto);
                if (TotalSpentTimeInMins > 0 && TotalSpentTimeInMins < 21600)
                {
                    col.Add(objCon);
                }
            }
        }
        grvwContract.DataSource = col;
        grvwContract.DataBind();
    }
Beispiel #3
0
    protected void BindDropPriority()
    {
        Priority_mst objP = new Priority_mst();

        objP = objPriority.Get_By_id(priorityid);
        colPriority.Add(objP);
        drpPriority.DataTextField  = "name";
        drpPriority.DataValueField = "priorityid";
        drpPriority.DataSource     = colPriority;
        drpPriority.DataBind();
    }
    protected void BindListBox()
    {
        txtContractName.Text    = Session["contractname"].ToString();
        txtdesc.Text            = Session["description"].ToString();
        drpVendor.SelectedValue = Session["vendorid"].ToString();
        Asset_mst ObjAsset            = new Asset_mst();
        BLLCollection <Asset_mst> col = new BLLCollection <Asset_mst>();
        string varAsset = Session["AssetContract"].ToString();

        string[] arrAsset  = varAsset.Split(',');
        int      FlagCount = arrAsset.Length;

        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Asset_mst obj = new Asset_mst();
                obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                col.Add(obj);
            }
        }
        ListAsset.DataTextField  = "computerName";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource     = col;
        ListAsset.DataBind();
        Session["AssetContract"] = "";
    }
    protected void BindListBox()
    {
        txtContractName.Text = Session["contractname"].ToString();
        txtdesc.Text = Session["description"].ToString();
        drpVendor.SelectedValue = Session["vendorid"].ToString();
        Asset_mst ObjAsset = new Asset_mst();
        BLLCollection<Asset_mst> col = new BLLCollection<Asset_mst>();
        string varAsset = Session["AssetContract"].ToString();
        string[] arrAsset = varAsset.Split(',');
        int FlagCount = arrAsset.Length;
        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i]!="")
            {
                Asset_mst obj = new Asset_mst();
                obj = ObjAsset.Get_By_id(Convert.ToInt16(arrAsset[i].ToString()));
                col.Add(obj);
            }

        }
        ListAsset.DataTextField = "computerName";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource = col;
        ListAsset.DataBind();
        Session["AssetContract"] = "";
    }
    protected void BindDropDownSiteRegionWise()
    {
        BLLCollection<Site_mst> colSite1 = new BLLCollection<Site_mst>();

        int custid = Convert.ToInt32(drpRegion.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";
    }
    // 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();
        }
    }
    protected void BindListBox()
    {
        drpCategory.SelectedValue    = Session["Categoryid"].ToString();
        drpSubcategory.SelectedValue = Session["Subcategoryid"].ToString();
        drpTechnician.SelectedValue  = Session["Technician"].ToString();
        txtTitle.Text = Session["Title"].ToString();
        drpchangetype.SelectedValue = Session["Changetype"].ToString();

        Asset_mst ObjAsset            = new Asset_mst();
        BLLCollection <Asset_mst> col = new BLLCollection <Asset_mst>();
        string varAsset = Session["AssetContract"].ToString();

        string[] arrAsset  = varAsset.Split(',');
        int      FlagCount = arrAsset.Length;

        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Asset_mst obj = new Asset_mst();
                obj = ObjAsset.Get_By_id(Convert.ToInt16(arrAsset[i].ToString()));
                col.Add(obj);
            }
        }
        ListAsset.DataTextField  = "computerName";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource     = col;
        ListAsset.DataBind();
        for (int i = ListAsset.Items.Count - 1; i >= 0; i--)
        {
            ListAsset.Items[i].Selected = true;
        }
        Session["AssetContract"] = "";
    }
    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";
    }
Beispiel #10
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();
    }
    public void BindDrpsite()
    {
        BLLCollection<Site_mst> col = new BLLCollection<Site_mst>();
        BLLCollection<Site_mst> colSite1 = new BLLCollection<Site_mst>();
        int custid = Convert.ToInt16(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";
        lblerrmsg.Text = "";
    }
    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.ToInt32(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";
    }
    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";
    }
Beispiel #14
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";
    }
Beispiel #15
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";
    }
    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";
    }
    protected void Bindgrid()
    {
        string complaintid = txtticket.Text;

        objCalls = objCalls.Get_By_id(complaintid);
        colCalls.Add(objCalls);
        grdvwRequest.DataSource = colCalls;
        grdvwRequest.DataBind();
    }
Beispiel #18
0
 protected void BindDropRequestType()
 {
     objRequestType = objRequestType.Get_By_id(2);
     colRequesttype.Add(objRequestType);
     drpRequestType.DataTextField  = "requesttypename";
     drpRequestType.DataValueField = "requesttypeid";
     drpRequestType.DataSource     = colRequesttype;
     drpRequestType.DataBind();
 }
Beispiel #19
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);
            }
        }
    }
Beispiel #20
0
    protected void BindDropMode()
    {
        Mode_mst objM = new Mode_mst();
        int      modeid;

        modeid = objMode.Get_Mode_By_Mname("web");

        objM = objMode.Get_By_id(modeid);
        colMode.Add(objM);
        drpMode.DataTextField  = "modename";
        drpMode.DataValueField = "modeid";
        drpMode.DataSource     = colMode;
        drpMode.DataBind();
    }
    protected void BindContractData()
    {
        int contractid = Convert.ToInt16(Request.QueryString[0]);

        objContract = objContract.Get_By_id(contractid);
        if (objContract != null)
        {
            txtContractName.Text = objContract.Contractname + " " + "Renewed";
            txtdesc.Text         = objContract.Description;

            drpVendor.SelectedValue = Convert.ToString(objContract.Vendorid);

            colContractToAssetMapping = objContractToAsset.Get_All_By_contractid(objContract.Contractid);
            foreach (ContractToAssetMapping obj in colContractToAssetMapping)
            {
                Asset_mst objA = new Asset_mst();
                objA = objA.Get_By_id(obj.Assetid);
                colAsset.Add(objA);
            }
            ListAsset.DataTextField  = "computername";
            ListAsset.DataValueField = "Assetid";
            ListAsset.DataSource     = colAsset;
            ListAsset.DataBind();
        }

        objContractNotfy = objContractNotfy.Get_By_id(contractid);
        if (objContractNotfy.Contractid != 0)
        {
            EscalateEmail_mst objEscalateEmail = new EscalateEmail_mst();
            chkLevel1.Checked  = true;
            txtBeforeDays.Text = objContractNotfy.Beforedays.ToString();
            string   varEmail = objContractNotfy.Sentto;
            string[] arrEmail = varEmail.Split((",").ToCharArray());
            for (int i = 0; i < arrEmail.Length - 1; i++)
            {
                if (arrEmail[i] != "," && arrEmail[i] != " ")
                {
                    objEscalateEmail = objEscalateEmail.Get_By_Emailid(arrEmail[i]);
                    for (int j = listLevel1.Items.Count - 1; j >= 0; j--)
                    {
                        if (Convert.ToInt16(listLevel1.Items[j].Value) == objEscalateEmail.Id)
                        {
                            listLevel1.Items[j].Selected = true;
                        }
                    }
                }
            }
        }
    }
    public CollectionBase GenerateUserToSiteMapping_mstCollection(ref IDataReader returnData)
    {
        BLLCollection <UserToSiteMapping> col = new BLLCollection <UserToSiteMapping>();

        while (returnData.Read())
        {
            UserToSiteMapping obj = new UserToSiteMapping();
            obj.Userid = (int)returnData["Userid"];
            obj.Siteid = (int)returnData["Siteid"];
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return(col);
    }
    public CollectionBase GenerateUserToSiteMapping_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<UserToSiteMapping> col = new BLLCollection<UserToSiteMapping>();
        while (returnData.Read())
        {

            UserToSiteMapping obj = new UserToSiteMapping();
            obj.Userid = (int)returnData["Userid"];
            obj.Siteid = (int)returnData["Siteid"];
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
Beispiel #24
0
    protected void BindContract()
    {
        int contractid = Convert.ToInt16(Request.QueryString[0]);

        objContract = objContract.Get_By_id(contractid);
        if (objContract != null)
        {
            lblContractName.Text      = objContract.Contractname;
            lblContractId.Text        = objContract.Contractid.ToString();
            lblActiveFrom.Text        = objContract.Activefrom.ToString();
            lblActiveTo.Text          = objContract.Activeto.ToString();
            objVendor                 = objVendor.Get_By_id(objContract.Vendorid);
            lblVendorname.Text        = objVendor.Vendorname.ToString();
            lblDesc.Text              = objContract.Description.ToString();
            colContractToAssetMapping = objContractToAsset.Get_All_By_contractid(objContract.Contractid);
            foreach (ContractToAssetMapping obj in colContractToAssetMapping)
            {
                Asset_mst objA = new Asset_mst();
                objA = objA.Get_By_id(obj.Assetid);
                colAsset.Add(objA);
            }
            grdvwViewAsset.DataSource = colAsset;
            grdvwViewAsset.DataBind();
        }
        objConRenewed = objConRenewed.Get_By_id(contractid);
        if (objConRenewed.Contractid != 0)
        {
            lblRen.Visible = true;
            Contract_mst obj = new Contract_mst();
            obj                = obj.Get_By_id(objConRenewed.Contractid);
            lblRenInfo.Text    = obj.Contractname;
            lblRenInfo.Visible = true;
        }
        objContractNotfy = objContractNotfy.Get_By_id(contractid);
        if (objContractNotfy.Contractid != 0)
        {
            lblUsers.Text = objContractNotfy.Sentto;
            lblDays.Text  = Convert.ToString(objContractNotfy.Beforedays);
        }
        else
        {
            lblUsers.Text = "-";
            lblDays.Text  = "-";
        }
    }
    public CollectionBase GenerateOrganization_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Organization_mst> col = new BLLCollection<Organization_mst>();
        while (returnData.Read())
        {
            DateTime Mydatetime = new DateTime();

            Organization_mst obj = new Organization_mst();
            obj.Orgid = (int)returnData["Orgid"];
            obj.Orgname = (string)returnData["Orgname"];
            obj.Description = (string)returnData["Description"];
            Mydatetime = (DateTime)returnData["Createdatetime"];
            obj.Createdatetime = Mydatetime.ToString();
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateOrganization_mstCollection(ref IDataReader returnData)
    {
        BLLCollection <Organization_mst> col = new BLLCollection <Organization_mst>();

        while (returnData.Read())
        {
            DateTime Mydatetime = new DateTime();

            Organization_mst obj = new Organization_mst();
            obj.Orgid          = (int)returnData["Orgid"];
            obj.Orgname        = (string)returnData["Orgname"];
            obj.Description    = (string)returnData["Description"];
            Mydatetime         = (DateTime)returnData["Createdatetime"];
            obj.Createdatetime = Mydatetime.ToString();
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return(col);
    }
    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();
    }
    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();
    }
    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();
    }
Beispiel #30
0
    protected void BindListBox()
    {
        //drpCategory.SelectedValue=Session["Category"].ToString();
        /// BindDropSubCategory();
        drpSubcategory.SelectedValue = Session["Subcategory"].ToString();
        drpchangetype.SelectedValue  = Session["ChangeType"].ToString();
        drpStatus.SelectedValue      = Session["Status"].ToString();
        // drpPriority.SelectedValue = Session["Priority"].ToString();

        Configuration_mst ObjAsset            = new Configuration_mst();
        BLLCollection <Configuration_mst> col = new BLLCollection <Configuration_mst>();
        string varAsset = Session["AssetContract"].ToString();

        string[] arrAsset  = varAsset.Split(',');
        int      FlagCount = arrAsset.Length;

        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Configuration_mst obj = new Configuration_mst();
                //obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                col.Add(obj);
            }
        }
        ListAsset.DataTextField  = "Serialno";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource     = col;
        ListAsset.DataBind();
        for (int i = ListAsset.Items.Count - 1; i >= 0; i--)
        {
            ListAsset.Items[i].Selected = true;
        }
        Session["AssetContract"] = "";
    }
Beispiel #31
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();
    }
Beispiel #32
0
    //Added by Lalit
    public void BindDropCustomer()
    {
        BLLCollection <Customer_mst> colCtS = new BLLCollection <Customer_mst>();
        string         userName             = "";
        MembershipUser User = Membership.GetUser();

        if (User != null)
        {
            userName = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            int Flagcount = 0;
            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)
                    {
                        colCustToSite = objCustToSite.Get_All_By_siteid(objSite1.Siteid);


                        foreach (CustomerToSiteMapping objcts in colCustToSite)
                        {
                            Customer_mst objC       = new Customer_mst();
                            int          FlagStatus = 0;
                            objC = objC.Get_By_id(objcts.Custid);
                            if (Flagcount == 0)
                            {
                                colCtS.Add(objC);
                            }
                            else
                            {
                                foreach (Customer_mst objCus in colCtS)
                                {
                                    if (objC.Custid == objCus.Custid)
                                    {
                                        FlagStatus = 1;
                                    }
                                }
                                if (FlagStatus == 0)
                                {
                                    colCtS.Add(objC);
                                }
                            }
                            Flagcount = Flagcount + 1;
                        }
                    }
                }
            }
            //}

            //DdlStock.DataBind();
            //   DdlOwner.DataTextField = "Customer_Name";
            //  DdlOwner.DataValueField = "CustId";
            //  DdlOwner.DataSource = colCtS;
            //  DdlOwner.DataBind();

            //if (colCtS.Count == 0)
            //{
            ListItem item = new ListItem();
            item.Text = "Other";
            //item.Value = "1";
            //   DdlOwner.Items.Add(item);


            //}
        }
    }
    public CollectionBase Generateuseremail_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<UserEmail> col = new BLLCollection<UserEmail>();
        while (returnData.Read())
        {

            UserEmail obj = new UserEmail();
            obj.Userid = (int)returnData["userid"];
            obj.Emailid = (string)returnData["emailid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public void BindDropCustomer()
    {
        //colCust = objCustomer.Get_All();
        //drpCustomer.DataTextField = "Customer_Name";
        //drpCustomer.DataValueField = "CustId";
        //drpCustomer.DataSource = colCust;
        //drpCustomer.DataBind();
        //ListItem item = new ListItem();
        //item.Text = "------------Select-------------";
        //item.Value = "0";
        //drpCustomer.Items.Add(item);
        //drpCustomer.SelectedValue = "0";
        BLLCollection<Customer_mst> colCtS = new BLLCollection<Customer_mst>();
        string userName = "";
        MembershipUser User = Membership.GetUser();
        if (User != null)
        {
            userName = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            int Flagcount = 0;
            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)
                    {
                        colCustToSite = objCustToSite.Get_All_By_siteid(objSite1.Siteid);
                        foreach (CustomerToSiteMapping objcts in colCustToSite)
                        {
                            Customer_mst objC = new Customer_mst();
                            int FlagStatus = 0;
                            objC = objC.Get_By_id(objcts.Custid);
                            if (Flagcount == 0)
                            {
                                colCtS.Add(objC);
                            }
                            else
                            {
                                foreach (Customer_mst objCus in colCtS)
                                {
                                    if (objC.Custid == objCus.Custid)
                                    {
                                        FlagStatus = 1;
                                    }

                                }
                                if (FlagStatus == 0)
                                {
                                    colCtS.Add(objC);
                                }
                            }
                            Flagcount = Flagcount + 1;
                        }
                    }
                }
            }
        }
        drpCustomer.DataTextField = "Customer_Name";
        drpCustomer.DataValueField = "CustId";
        drpCustomer.DataSource = colCtS;
        drpCustomer.DataBind();
        if (colCtS.Count == 0)
        {
            ListItem item = new ListItem();
            item.Text = "-------------Select-------------";
            item.Value = "0";
            drpCustomer.Items.Add(item);
        }
    }
    protected void BindContractData()
    {
        int contractid = Convert.ToInt32(Request.QueryString[0]);

        objContract = objContract.Get_By_id(contractid);
        if (objContract != null)
        {
            string dd;
            string mm;
            string yy;
            txtContractName.Text = objContract.Contractname;
            txtdesc.Text         = objContract.Description.ToString();
            string[] tempdate = objContract.Activefrom.ToString().Split(("/").ToCharArray());
            string   StrData  = tempdate[2].ToString();
            string[] temp1    = StrData.Split((" ").ToCharArray());

            if (Convert.ToInt32(tempdate[1]) < 10)
            {
                dd = "0" + tempdate[1];
            }
            else
            {
                dd = tempdate[1];
            }
            if (Convert.ToInt32(tempdate[0]) < 10)
            {
                mm = "0" + tempdate[0];
            }
            else
            {
                mm = tempdate[0];
            }
            string vardateFrom = dd + "/" + mm + "/" + temp1[0];
            txtActiveFrom.Text = vardateFrom;


            string[] tempdate1 = objContract.Activeto.ToString().Split(("/").ToCharArray());
            string   StrData1  = tempdate1[2].ToString();
            string[] temp2     = StrData1.Split((" ").ToCharArray());

            if (Convert.ToInt32(tempdate1[1]) < 10)
            {
                dd = "0" + tempdate1[1];
            }
            else
            {
                dd = tempdate1[1];
            }
            if (Convert.ToInt32(tempdate1[0]) < 10)
            {
                mm = "0" + tempdate1[0];
            }
            else
            {
                mm = tempdate1[0];
            }
            string vardateTo = dd + "/" + mm + "/" + temp2[0];


            txtActiveTo.Text        = vardateTo;
            drpVendor.SelectedValue = Convert.ToString(objContract.Vendorid);

            colContractToAssetMapping = objContractToAsset.Get_All_By_contractid(objContract.Contractid);
            foreach (ContractToAssetMapping obj in colContractToAssetMapping)
            {
                Asset_mst objA = new Asset_mst();
                objA = objA.Get_By_id(obj.Assetid);
                colAsset.Add(objA);
            }
            ListAsset.DataTextField  = "computername";
            ListAsset.DataValueField = "Assetid";
            ListAsset.DataSource     = colAsset;
            ListAsset.DataBind();
        }

        objContractNotfy = objContractNotfy.Get_By_id(contractid);
        if (objContractNotfy.Contractid != 0)
        {
            EscalateEmail_mst objEscalateEmail = new EscalateEmail_mst();
            chkLevel1.Checked  = true;
            txtBeforeDays.Text = objContractNotfy.Beforedays.ToString();
            string   varEmail = objContractNotfy.Sentto;
            string[] arrEmail = varEmail.Split((",").ToCharArray());
            for (int i = 0; i < arrEmail.Length - 1; i++)
            {
                if (arrEmail[i] != "," && arrEmail[i] != " ")
                {
                    objEscalateEmail = objEscalateEmail.Get_By_Emailid(arrEmail[i]);
                    for (int j = listLevel1.Items.Count - 1; j >= 0; j--)
                    {
                        if (Convert.ToInt32(listLevel1.Items[j].Value) == objEscalateEmail.Id)
                        {
                            listLevel1.Items[j].Selected = true;
                        }
                    }
                }
            }
        }
    }
    public CollectionBase GenerateSubcategory_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Subcategory_mst> col = new BLLCollection<Subcategory_mst>();
        while (returnData.Read())
        {

            Subcategory_mst obj = new Subcategory_mst();
            obj.Subcategoryid = (int)returnData["subcategoryid"];
            obj.Subcategoryname = (string)returnData["subcategoryname"];
            obj.Subcategorydescription = (string)returnData["subcategorydescription"];
            obj.Categoryid = (int)returnData["categoryid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateUserViewNotAssignAsset_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Asset_mst> col = new BLLCollection<Asset_mst>();
        while (returnData.Read())
        {
            Asset_mst obj = new Asset_mst();
            obj.Assetid = (int)returnData["assetid"];
            obj.Computername = (string)returnData["computername"];
            //DateTime Mydatetime = new DateTime();
            //Mydatetime = (DateTime)returnData["createdatetime"];
            //obj.Createdatetime = Mydatetime.ToString();
            if (returnData["domain"] != DBNull.Value)
            {
                obj.Domain = (string)returnData["domain"];
            }

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateTechnician_To_GroupCollection(ref IDataReader returnData)
    {
        BLLCollection<Technician_To_Group> col = new BLLCollection<Technician_To_Group>();
        while (returnData.Read())
        {

            Technician_To_Group obj = new Technician_To_Group();
            obj.Groupid = (int)returnData["Groupid"];
            obj.Technicianid = (int)returnData["Technicianid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateViewServiceWindow_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<ServiceWindow_mst> col = new BLLCollection<ServiceWindow_mst>();
        while (returnData.Read())
        {
            ServiceWindow_mst obj = new ServiceWindow_mst();
            obj.Servicewindowid = (int)returnData["Servicewindowid"];
            obj.Siteid = (int)returnData["Siteid"];
            col.Add(obj);
        }

        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateVendor_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Vendor_mst> col = new BLLCollection<Vendor_mst>();
        while (returnData.Read())
        {

            Vendor_mst obj = new Vendor_mst();
            obj.Vendorid = (int)returnData["vendorid"];
            obj.Vendorname = (string)returnData["vendorname"];
            obj.Contactperson = (string)returnData["contactperson"];
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public void BindDrpsite()
    {
        BLLCollection<Site_mst> col = new BLLCollection<Site_mst>();
        BLLCollection<Site_mst> colSite1 = new BLLCollection<Site_mst>();
        int custid = Convert.ToInt16(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";
    }
    protected void BindListBox()
    {
        drpCategory.SelectedValue = Session["Categoryid"].ToString();
        drpSubcategory.SelectedValue = Session["Subcategoryid"].ToString();
        drpTechnician.SelectedValue = Session["Technician"].ToString();
        txtTitle.Text = Session["Title"].ToString();
        drpchangetype.SelectedValue = Session["Changetype"].ToString();

        Asset_mst ObjAsset = new Asset_mst();
        BLLCollection<Asset_mst> col = new BLLCollection<Asset_mst>();
        string varAsset = Session["AssetContract"].ToString();
        string[] arrAsset = varAsset.Split(',');
        int FlagCount = arrAsset.Length;
        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Asset_mst obj = new Asset_mst();
                obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                col.Add(obj);
            }

        }
        ListAsset.DataTextField = "computerName";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource = col;
        ListAsset.DataBind();
        for (int i = ListAsset.Items.Count - 1; i >= 0; i--)
        {
            ListAsset.Items[i].Selected = true;

        }
        Session["AssetContract"] = "";
    }
    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 CollectionBase GenerateTitle_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Title_mst> col = new BLLCollection<Title_mst>();
        while (returnData.Read())
        {

            Title_mst obj = new Title_mst();
            obj.Id = (int)returnData["Id"];
            obj.Categoryid = (int)returnData["Categoryid"];
            obj.Title = (string)returnData["Title"];
            obj.Subacetgoryid = (int)returnData["subcategoryid"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateUserViewAsset_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Asset_mst> col = new BLLCollection<Asset_mst>();
        while (returnData.Read())
        {
            Asset_mst obj = new Asset_mst();
            obj.Assetid = (int)returnData["assetid"];
            obj.Computername = (string)returnData["computername"];
            //DateTime Mydatetime = new DateTime();
            //Mydatetime = (DateTime)returnData["createdatetime"];
            //obj.Createdatetime = Mydatetime.ToString();
            if (returnData["domain"] != DBNull.Value)
            {
                obj.Domain = (string)returnData["domain"];
            }
            if (returnData["TagNo"] != DBNull.Value)
            {
                obj.TagNo = (string)returnData["TagNo"];
            }
            if (returnData["PONo"] != DBNull.Value)
            {
                obj.PONo = (string)returnData["PONo"];
            }
            if (returnData["AssetOwner"] != DBNull.Value)
            {
                obj.AssetOwner = (string)returnData["AssetOwner"];
            }
            ///////////add by vishal 01-06-2012
            if (returnData["Is in stock"] != DBNull.Value)
            {
                obj.IsInStock = (bool)returnData["Is in stock"];
            }
            if (returnData["Manual"] != DBNull.Value)
            {
                obj.manaul = (bool)returnData["Manual"];
            }

            if (returnData["Location"] != DBNull.Value)
            {
                obj.location = (string)returnData["Location"];
            }
            if (returnData["CompanyCode"] != DBNull.Value)
            {
                obj.CompanyCode = (string)returnData["CompanyCode"];
            }
            if (returnData["PurchaseDate"] != DBNull.Value)
            {
                //obj.PurchaseDate = (string) returnData["PurchaseDate"];
                obj.PurchaseDate = ((DateTime)returnData["PurchaseDate"]).ToString();
                //obj.PurchaseDate = DateTime.ParseExact("dd/MM/yyyy").ToString("PurchaseDate");

            }
            if (returnData["AssetCategory"] != DBNull.Value)
            {
                obj.AssetCategory = (string)returnData["AssetCategory"];
            }
            if (returnData["Remarks"] != DBNull.Value)
            {
                obj.Remarks = (string)returnData["Remarks"];
            }
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    protected void BindListBox()
    {
        Configuration_mst ObjAsset = new Configuration_mst();
        BLLCollection<Configuration_mst> col = new BLLCollection<Configuration_mst>();
        string varAsset = Session["AssetContract"].ToString();
        string[] arrAsset = varAsset.Split(',');
        int FlagCount = arrAsset.Length;
        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Configuration_mst obj = new Configuration_mst();
                obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));

                col.Add(obj);
            }

        }
        lstassetupdate.DataTextField = "Serialno";
        lstassetupdate.DataValueField = "assetid";
        lstassetupdate.DataSource = col;
        lstassetupdate.DataBind();
        for (int i = lstassetupdate.Items.Count - 1; i >= 0; i--)
        {
            lstassetupdate.Items[i].Selected = true;

        }
        Session["AssetContract"] = "";
        panaleditchange.Visible = true;
        pan1.Visible = false;
        editpanal();
    }
    public CollectionBase GenerateUserToAssetMapping_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<UserToAssetMapping> col = new BLLCollection<UserToAssetMapping>();
        while (returnData.Read())
        {
            UserToAssetMapping obj = new UserToAssetMapping();

            obj.Assetid = (int)returnData["assetid"];
            obj.Userid = (int)returnData["userid"];
            if (returnData["assetlocation"] != DBNull.Value)
            {
                obj.AssetLocation = (string)returnData["assetlocation"];
            }
            if (returnData["companyname"] != DBNull.Value)
            {
                obj.AssetCompanyName = (string)returnData["companyname"];
            }
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    protected void BindListBox()
    {
        //drpCategory.SelectedValue=Session["Category"].ToString();
        /// BindDropSubCategory();

        Configuration_mst ObjAsset = new Configuration_mst();
        BLLCollection<Configuration_mst> col = new BLLCollection<Configuration_mst>();
        string varAsset = Session["AssetContract"].ToString();
        string[] arrAsset = varAsset.Split(',');
        int FlagCount = arrAsset.Length;
        for (int i = 0; i < FlagCount; i++)
        {
            if (arrAsset[i] != "," && arrAsset[i] != "")
            {
                Configuration_mst obj = new Configuration_mst();
                //obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString()));
                col.Add(obj);
            }

        }
        ListAsset.DataTextField = "Serialno";
        ListAsset.DataValueField = "assetid";
        ListAsset.DataSource = col;
        ListAsset.DataBind();
        for (int i = ListAsset.Items.Count - 1; i >= 0; i--)
        {
            ListAsset.Items[i].Selected = true;

        }
        Session["AssetContract"] = "";
        //drpSubcategory.SelectedValue = Session["Subcategory"].ToString();
        //drpchangetype.SelectedValue = Session["ChangeType"].ToString();
        //drpStatus.SelectedValue = Session["Status"].ToString();
    }
    public CollectionBase GenerateUsername_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Customer_mst> col = new BLLCollection<Customer_mst>();
        while (returnData.Read())
        {

            Customer_mst obj = new Customer_mst();
            obj.Customer_name = (string)returnData["customerName"];
            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
    public CollectionBase GenerateStatus_mstCollection(ref IDataReader returnData)
    {
        BLLCollection<Status_mst> col = new BLLCollection<Status_mst>();
        while (returnData.Read())
        {

            Status_mst obj = new Status_mst();
            obj.Statusid = (int)returnData["statusid"];
            obj.Description = (string)returnData["description"];
            obj.Statusname = (string)returnData["statusname"];

            col.Add(obj);
        }
        returnData.Close();
        returnData.Dispose();
        return col;
    }
 //added by lalit 02nov2011 to fetch users who has role admin,technician,sde to be mapped with category and subcategory
 public CollectionBase GenerateUserLogin_mstCollection_TechAdminSDE(ref IDataReader returnData)
 {
     BLLCollection<UserLogin_mst> col = new BLLCollection<UserLogin_mst>();
     while (returnData.Read())
     {
         UserLogin_mst obj = new UserLogin_mst();
         obj.Userid = (int)returnData["Userid"];
         obj.Username = (string)returnData["Username"];
         obj.Roleid = (int)returnData["Roleid"];
         obj.Orgid = (int)returnData["Orgid"];
         col.Add(obj);
     }
     returnData.Close();
     returnData.Dispose();
     return col;
 }
 public CollectionBase GenerateState_mstCollection(ref IDataReader returnData)
 {
     BLLCollection<State_mst> col = new BLLCollection<State_mst>();
     while (returnData.Read())
     {
         State_mst obj = new State_mst();
         obj.Stateid = (int)returnData["Stateid"];
         obj.Statename = (string)returnData["Statename"];
         obj.Countryid = (int)returnData["Countryid"];
         col.Add(obj);
     }
     returnData.Close();
     returnData.Dispose();
     return col;
 }
 public CollectionBase GenerateUserLogin_mstCollection(ref IDataReader returnData)
 {
     BLLCollection<UserLogin_mst> col = new BLLCollection<UserLogin_mst>();
     while (returnData.Read())
     {
         UserLogin_mst obj = new UserLogin_mst();
         obj.Userid = (int)returnData["Userid"];
         obj.Username = (string)returnData["Username"];
         obj.Roleid = (int)returnData["Roleid"];
         obj.Password = (string)returnData["Password"];
         obj.Orgid = (int)returnData["Orgid"];
         obj.Enable = (bool)returnData["Enable"];
         if (returnData["DomainName"] != DBNull.Value)
         {
             obj.DomainName = (string)returnData["DomainName"];
         }
         //obj.Company = (string)returnData["Company"];
         //obj.City = (string)returnData["City"];
         obj.ADEnable = (bool)returnData["ADEnable"];
         DateTime Mydatetime = new DateTime();
         Mydatetime = (DateTime)returnData["Createdatetime"];
         obj.Createdatetime = Mydatetime.ToString();
         col.Add(obj);
     }
     returnData.Close();
     returnData.Dispose();
     return col;
 }
    protected void Showchangeinfo()
    {
        Approvalpanal.Visible = true;
        btnApprove.Visible = true;
        btnReject.Visible = true;
        Alreadyapprovedpanal.Visible = false;
        NameValueCollection n = Request.QueryString;

        int changeid = Convert.ToInt16(Request.QueryString[0]);
        //lblchangeid.Text = changeid.ToString();
        ObjChange = ObjChange.Get_By_id(changeid);
        lblchangeid.Text = ObjChange.Changeid.ToString();
        lbltitle.Text = ObjChange.Title;
        lbldescription.Text = ObjChange.Description;
        //lblDateDisp.Text = ObjChange.Createdtime.ToString();
        int requesterid = Convert.ToInt16(ObjChange.Requestedby);

        //lblTitle.Text = ObjChange.Title.ToString();

        //lblDescription.Text = ObjChange.Description.ToString();

        lblserviceeffected.Text = "Email";
        int chantypeid = Convert.ToInt16(ObjChange.Changetype);
        ObjChangeType = ObjChangeType.Get_By_id(chantypeid);
        if (chantypeid != 0)
        {
            lblchangetype.Text = ObjChangeType.Changetypename.ToString();
        }
        int changestatus = Convert.ToInt16(ObjChange.Statusid);
        Objchangestatus = Objchangestatus.Get_By_id(changestatus);
        if (changestatus != 0)
        {
            lblStatus.Text = Objchangestatus.Statusname;
        }
        int priorityid = Convert.ToInt16(ObjChange.Priority);
        ObjPriority = ObjPriority.Get_By_id(priorityid);
        if (priorityid != 0)
        {
            lblpriority.Text = ObjPriority.Name.ToString();

        }
        else
        {
            lblpriority.Text = "";

        }

        int category = Convert.ToInt16(ObjChange.Categoryid);
        ObjCategory = ObjCategory.Get_By_id(category);
        if (category != 0)
        {
            lblcategory.Text = ObjCategory.CategoryName.ToString();

        }
        else
        {
            lblcategory.Text = "";

        }

        int subcategory = Convert.ToInt16(ObjChange.Subcategoryid);
        Objsubcategory = Objsubcategory.Get_By_id(subcategory);
        if (subcategory != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();

        }
        else
        {
            lblsubcategory.Text = "";

        }

        int creator = Convert.ToInt16(ObjChange.CreatedByID);
        ObjUser = ObjUser.Get_By_id(creator);
        lblCreatedby.Text = ObjUser.Username.ToString();
        lblCreatedDate.Text = ObjChange.Createdtime.ToString();
        int techid = Convert.ToInt16(ObjChange.Technician);
        ObjUser = ObjUser.Get_By_id(techid);

        if (techid != 0)
        {
            lbltechid.Text = ObjUser.Username.ToString();

        }
        else
        {
            lbltechid.Text = "";

        }
        colassetincludeinchange = objincludeasset.Get_All_IncludeAssetinchange(changeid);
        BLLCollection<Configuration_mst> colasset = new BLLCollection<Configuration_mst>();
        Configuration_mst ObjAsset = new Configuration_mst();

        foreach (IncludedAssetinchange obj in colassetincludeinchange)
        {
            ObjAsset = ObjAsset.Get_By_id(obj.Assetid);
            colasset.Add(ObjAsset);

        }
        lstAsset.DataTextField = "Serialno";
        lstAsset.DataValueField = "assetid";
        lstAsset.DataSource = colasset;
        lstAsset.DataBind();
    }
    protected void Showchangeinfo()
    {
        Approvalpanal.Visible        = true;
        btnApprove.Visible           = true;
        btnReject.Visible            = true;
        Alreadyapprovedpanal.Visible = false;
        NameValueCollection n = Request.QueryString;

        int changeid = Convert.ToInt32(Request.QueryString[0]);

        //lblchangeid.Text = changeid.ToString();
        ObjChange           = ObjChange.Get_By_id(changeid);
        lblchangeid.Text    = ObjChange.Changeid.ToString();
        lbltitle.Text       = ObjChange.Title;
        lbldescription.Text = ObjChange.Description;
        //lblDateDisp.Text = ObjChange.Createdtime.ToString();
        int requesterid = Convert.ToInt32(ObjChange.Requestedby);



        //lblTitle.Text = ObjChange.Title.ToString();

        //lblDescription.Text = ObjChange.Description.ToString();

        lblserviceeffected.Text = "Email";
        int chantypeid = Convert.ToInt32(ObjChange.Changetype);

        ObjChangeType = ObjChangeType.Get_By_id(chantypeid);
        if (chantypeid != 0)
        {
            lblchangetype.Text = ObjChangeType.Changetypename.ToString();
        }
        int changestatus = Convert.ToInt32(ObjChange.Statusid);

        Objchangestatus = Objchangestatus.Get_By_id(changestatus);
        if (changestatus != 0)
        {
            lblStatus.Text = Objchangestatus.Statusname;
        }
        int priorityid = Convert.ToInt32(ObjChange.Priority);

        ObjPriority = ObjPriority.Get_By_id(priorityid);
        if (priorityid != 0)
        {
            lblpriority.Text = ObjPriority.Name.ToString();
        }
        else
        {
            lblpriority.Text = "";
        }

        int category = Convert.ToInt32(ObjChange.Categoryid);

        ObjCategory = ObjCategory.Get_By_id(category);
        if (category != 0)
        {
            lblcategory.Text = ObjCategory.CategoryName.ToString();
        }
        else
        {
            lblcategory.Text = "";
        }


        int subcategory = Convert.ToInt32(ObjChange.Subcategoryid);

        Objsubcategory = Objsubcategory.Get_By_id(subcategory);
        if (subcategory != 0)
        {
            lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString();
        }
        else
        {
            lblsubcategory.Text = "";
        }

        int creator = Convert.ToInt32(ObjChange.CreatedByID);

        ObjUser             = ObjUser.Get_By_id(creator);
        lblCreatedby.Text   = ObjUser.Username.ToString();
        lblCreatedDate.Text = ObjChange.Createdtime.ToString();
        int techid = Convert.ToInt32(ObjChange.Technician);

        ObjUser = ObjUser.Get_By_id(techid);

        if (techid != 0)
        {
            lbltechid.Text = ObjUser.Username.ToString();
        }
        else
        {
            lbltechid.Text = "";
        }
        colassetincludeinchange = objincludeasset.Get_All_IncludeAssetinchange(changeid);
        BLLCollection <Configuration_mst> colasset = new BLLCollection <Configuration_mst>();
        Configuration_mst ObjAsset = new Configuration_mst();

        foreach (IncludedAssetinchange obj in colassetincludeinchange)
        {
            ObjAsset = ObjAsset.Get_By_id(obj.Assetid);
            colasset.Add(ObjAsset);
        }
        lstAsset.DataTextField  = "Serialno";
        lstAsset.DataValueField = "assetid";
        lstAsset.DataSource     = colasset;
        lstAsset.DataBind();
    }