protected void BindSite() { colSite = objSite.Get_All(); for (int i = 0; i < colSite.Count; i++) { for (int j = i; j < colSite.Count; j++) { if (String.Compare(colSite[i].Sitename, colSite[j].Sitename) > 0) { Site_mst obj = new Site_mst(); obj = colSite[i]; colSite[i] = colSite[j]; colSite[j] = obj; } } } drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); //item.Text = "---Select Site---"; //item.Value = "0"; //drpsite.Items.Add(item); drpsite.SelectedValue = "0"; }
public void BindGrid() { col = ObjAsset.Get_By_comandname("A"); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = "a"; }
protected void btnsearch_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { string name; if (txtname.Text == "") { col = ObjAsset.Get_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = ""; } else { name = txtname.Text.ToString(); col = ObjAsset.Get_By_comandname(name); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = name; } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
// Definition BindDropRegion() Function , To Bind Drop Down drpRegion public void BindDropRegion() { // Bind Drop Down Region,By Calling Function Get_All() via objRegion Object and assign to collection colRegion //colRegion = objRegion.Get_All(); //drpRegion.DataTextField = "regionname"; //drpRegion.DataValueField = "regionid"; //drpRegion.DataSource = colRegion; //drpRegion.DataBind(); //// Declare List Item item and add text ALL and value 0 to it and add to drpRegion Drop Down //ListItem item = new ListItem(); //item.Text = "All"; //item.Value = "0"; //drpRegion.Items.Add(item); //drpRegion.SelectedValue = "0"; colCustomer = objCustomer.Get_All(); drpRegion.DataTextField = "Customer_Name"; drpRegion.DataValueField = "custid"; drpRegion.DataSource = colCustomer; drpRegion.DataBind(); ListItem item = new ListItem(); item.Text = "------------Select------------"; item.Value = "0"; drpRegion.Items.Add(item); drpRegion.SelectedValue = "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(); }
protected void grdvwViewAsset_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AlphaPaging")) { string commandname = e.CommandArgument.ToString(); ViewState["commandname"] = e.CommandArgument.ToString(); col = ObjAsset.Get_By_comandname(commandname); if (col.Count != 0) { grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } else { DataTable dt = new DataTable(); dt.Columns.Add("assetid"); dt.Columns.Add("computername"); dt.Columns.Add("domain"); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); grdvwViewAsset.DataSource = dt; grdvwViewAsset.DataBind(); //grdvwViewAsset.Rows[0].Cells[3].Visible = false; //grdvwViewAsset.Rows[0].Cells[5].Visible = false; } } }
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"] = ""; }
public void BindGrid() { DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); Asset_mst objAsset = new Asset_mst(); BLLCollection<Asset_mst> colAsset = new BLLCollection<Asset_mst>(); colAsset = objAsset.Get_All(); foreach (Asset_mst obj in colAsset) { DataRow row; row = dtTable.NewRow(); row["computername"] = Convert.ToString(obj.Computername); assetid = Convert.ToInt16(obj.Assetid); Asset_OperatingSystem_mst objos = new Asset_OperatingSystem_mst(); objos = objos.Get_By_Assetid(assetid); row["osname"] = Convert.ToString(objos.Os_name); row["username"] = Convert.ToString(objos.User_name); row["productkey"] = Convert.ToString(objos.Product_key); Asset_ProductInfo_mst objproduct = new Asset_ProductInfo_mst(); objproduct = objproduct.Get_By_Assetid(assetid); row["productname"] = Convert.ToString(objproduct.Product_name); row["productmanu"] = Convert.ToString(objproduct.Product_manufacturer); row["serialno"] = Convert.ToString(objproduct.Serial_number); Asset_Processor_mst objprocessor = new Asset_Processor_mst(); objprocessor = objprocessor.Get_By_Assetid(assetid); row["processorname"] = Convert.ToString(objprocessor.Processor_name); Asset_Memory_mst objmemory = new Asset_Memory_mst(); objmemory = objmemory.Get_By_Assetid(assetid); row["physicalmemory"] = Convert.ToString(objmemory.Physical_mem); dtTable.Rows.Add(row); } dtgrid.DataSource = dtTable; dtgrid.DataBind(); }
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"; }
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 = ""; }
protected void grdvwUser_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AlphaPaging")) { string commandname = e.CommandArgument.ToString(); ViewState["commandname"] = e.CommandArgument.ToString(); col = ObjUserlogin.Get_By_comandname(commandname); if (col.Count!=0) { grdvwUser.DataSource = col; grdvwUser.DataBind(); } else { DataTable dt = new DataTable(); dt.Columns.Add("userid"); dt.Columns.Add("username"); dt.Columns.Add("Enable"); dt.Columns.Add("createdatetime"); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); grdvwUser.DataSource = dt; grdvwUser.DataBind(); grdvwUser.Rows[0].Cells[4].Visible = false; grdvwUser.Rows[0].Cells[5].Visible = false; } } }
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 BindGrid() { BLLCollection<Cab_mst> col = new BLLCollection<Cab_mst>(); col = ObjCab.Get_All(); Cabgrdvw.DataSource = col; Cabgrdvw.DataBind(); }
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"; }
// Definition of BindGrid(); protected void BindGrid() { colState = objState.Get_All(); grvwObj.DataSource = colState; grvwObj.DataBind(); clear(); }
public void BindGrid() { col = objUser.Get_By_comandname("A"); grdvwViewUser.DataSource = col; grdvwViewUser.DataBind(); ViewState["commandname"] = "a"; }
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 BindDrpDepartment() { BLLCollection<Department_mst> col = new BLLCollection<Department_mst>(); Department_mst Objdepartment = new Department_mst(); int Selectedsiteval = Convert.ToInt16(DrpSite.SelectedValue); if (Selectedsiteval==0) { DrpDepartment.DataSource = col; DrpDepartment.DataBind(); ListItem item = new ListItem(); item.Text = "--------------Select---------------"; item.Value = "0"; DrpDepartment.Items.Add(item); DrpDepartment.SelectedValue = "0"; } else { col = Objdepartment.Get_All_By_SiteId(Selectedsiteval); DrpDepartment.DataTextField = "departmentName"; DrpDepartment.DataValueField = "deptid"; DrpDepartment.DataSource = col; DrpDepartment.DataBind(); ListItem item = new ListItem(); item.Text = Resources.MessageResource.errSelectDept.ToString(); item.Value = "0"; DrpDepartment.Items.Add(item); DrpDepartment.SelectedValue = "0"; } }
public void BindGrid() { BLLCollection<RoleInfo_mst> col = new BLLCollection<RoleInfo_mst>(); col = RoleObj.Get_All(); Rolegrdvw.DataSource = col; Rolegrdvw.DataBind(); ClearControl(); }
public void BindGrid() { BLLCollection<Category_mst> col = new BLLCollection<Category_mst>(); col = CategoryObj.Get_All(); Categorygrdvw.DataSource = col; Categorygrdvw.DataBind(); }
public void BindGrid() { // Initialize col objects, to get collection of Country_mst objects by Calling Function Get_All() col = objCountry.Get_All(); // Bind GridView via col datasource grvwCountry.DataSource = col; grvwCountry.DataBind(); }
public void BindGrid() { BLLCollection<Impact_mst> col = new BLLCollection<Impact_mst>(); col = ImpactObj.Get_All(); Impactgrdvw.DataSource = col; Impactgrdvw.DataBind(); ClearControl(); }
public void BindGrid() { BLLCollection<EscalateEmail_mst> col = new BLLCollection<EscalateEmail_mst>(); col = objemail.Get_All(); Emailgrdvw.DataSource = col; Emailgrdvw.DataBind(); resetcontrols(); }
protected void BindDropStatus() { colStatus = objStatus.Get_All_By_OpenStatus(); drpStatus.DataTextField = "statusname"; drpStatus.DataValueField = "statusid"; drpStatus.DataSource = colStatus; drpStatus.DataBind(); }
public void BindGrid() { int itemid = Convert.ToInt16(drpitem.SelectedValue); col = Objconfigurableitems.Get_All_CI_Byitems(itemid); grdvwCI.DataSource = col; grdvwCI.DataBind(); }
public void BindGrid() { BLLCollection<Customer_mst> col = new BLLCollection<Customer_mst>(); col = ObjCustomer.Get_All(); Customergrdvw.DataSource = col; Customergrdvw.DataBind(); clear(); }
public void BindGrid() { BLLCollection<Status_mst> col = new BLLCollection<Status_mst>(); col = ObjStatus.Get_All(); Statusgrdvw.DataSource = col; Statusgrdvw.DataBind(); Clearcontrol(); }
public void BindGrid() { BLLCollection<Priority_mst> col = new BLLCollection<Priority_mst>(); col = Priorityobj.Get_All(); Prioritygrdvw.DataSource=col; Prioritygrdvw.DataBind(); ClearControl(); }
protected void BindDropChangeStatus() { colchangestatus = Objchangestatus.Get_All(); drpStatus.DataTextField = "statusname"; drpStatus.DataValueField = "changestatusid"; drpStatus.DataSource = colchangestatus; drpStatus.DataBind(); }
public void BindGrid() { BLLCollection<Service_mst> col = new BLLCollection<Service_mst>(); col = ObjService.Get_All(); Servicegrdvw.DataSource = col; Servicegrdvw.DataBind(); Clearcontrol(); }
protected void Page_Load(object sender, EventArgs e) { this.ClientScript.GetPostBackEventReference(this, "arg"); // Values for SelectAsset Page after select the asset for a particular user int flag = Convert.ToInt16(Session["flag2"]); if (flag == 1) { string username; userid = Convert.ToInt16(Session["userid"]); username = (string)(Session["username"]); txtusername.Text = username.ToString(); Session["flag2"] = "0"; } lblErrorMsg.Text = ""; if (!IsPostBack) { //string name; //if (txtname.Text == "") //{ // ViewState["commandname"] = ""; //} //else //{ // name = txtname.Text.ToString(); // col = ObjAsset.Get_By_comandname(name); // grdvwViewAsset.DataSource = col; // grdvwViewAsset.DataBind(); // ViewState["commandname"] = name; //} // col = ObjAsset.Get_By_comandname(""); col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } }
protected void grdvwViewAsset_RowCommand(object sender, GridViewCommandEventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { if (e.CommandName.Equals("AlphaPaging")) { string commandname = e.CommandArgument.ToString(); ViewState["commandname"] = e.CommandArgument.ToString(); col = ObjAsset.Get_By_comandname(commandname); if (col.Count != 0) { grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } else { DataTable dt = new DataTable(); dt.Columns.Add("assetid"); dt.Columns.Add("computername"); dt.Columns.Add("domain"); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); grdvwViewAsset.DataSource = dt; grdvwViewAsset.DataBind(); //grdvwViewAsset.Rows[0].Cells[3].Visible = false; //grdvwViewAsset.Rows[0].Cells[5].Visible = false; } } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
public void SentMailToChangeCommittee(int changeid, int changetypeid) { string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString(); string strContactNumber = Resources.MessageResource.strContactNumber.ToString(); Cab_mst Objcabmember = new Cab_mst(); ObjChange = ObjChange.Get_By_id(changeid); BLLCollection <Cab_mst> colmembers = new BLLCollection <Cab_mst>(); UserLogin_mst objUserCreator = new UserLogin_mst(); int FlagUser; int roleid; string varServerName; varServerName = Resources.MessageResource.serverNameForChangePage.ToString(); // varServerName = "10.80.0.15"; string url11; url11 = "http://" + varServerName + "/BEST/LoginPageAccess/ApproveorRejectChangeRequest.aspx?changeid=" + changeid; colmembers = Objcabmember.Get_All_By_ChangeTypeid(changetypeid); string url; foreach (Cab_mst objmember in colmembers) { url = "<a href=" + url11 + "&userid=" + objmember.Membername + " ' onclick=window.open()>Click Here For Approval</a>"; obj.From = Resources.MessageResource.strAdminEmail.ToString(); obj.To = objmember.Emailid; obj.Subject = "New Change Added. Change Id : " + changeid; obj.Body = "Dear Sir/Madam,<br/>A New Change has been requested.Please.<br/><br/><b>Solution Details : </b> <br/><br/><b>Changeid Id :</b>" + ObjChange.Changeid + "<br/><b>Title :</b>" + ObjChange.Title + " <br/><b>Added By :</b>" + ObjChange.CreatedByID + "<br/><b>Created Date   :</b>" + ObjChange.Createdtime + "<br/><b>Content :</b>" + ObjChange.Description + "<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/></b><br/><b>Kindly Click the following link to Aprove or Reject the Change Request. <br></br>" + url + " <b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>"; obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } }
protected void BindDropTechnician() { objRole = objRole.Get_RoleInfo_By_RoleName("technician"); if (objRole.Roleid != 0) { int siteid = 0; int roleid; if (drpSite.SelectedValue != "") { siteid = Convert.ToInt16(drpSite.SelectedValue); } roleid = objRole.Roleid; if (siteid != 0 && roleid != 0) { colUser = objUser.Get_All_By_Role_Site(roleid, siteid); drpTechnician.DataTextField = "username"; drpTechnician.DataValueField = "userid"; drpTechnician.DataSource = colUser; drpTechnician.DataBind(); ListItem item = new ListItem(); item.Text = "-----------Select-----------"; item.Value = "0"; drpTechnician.Items.Add(item); drpTechnician.SelectedValue = "0"; } else { colUser = objUser.Get_All_By_Role_Site(roleid, siteid); drpTechnician.DataTextField = "username"; drpTechnician.DataValueField = "userid"; drpTechnician.DataSource = colUser; drpTechnician.DataBind(); ListItem item = new ListItem(); item.Text = "-----------Select-----------"; item.Value = "0"; drpTechnician.Items.Add(item); drpTechnician.SelectedValue = "0"; } } }
protected void btnsearch_Click(object sender, EventArgs e) { /* Modify by Lalit */ string name; if (txtname.Text == "") { col = ObjUserlogin.Get_By_comandname("A"); grdvwUser.DataSource = col; grdvwUser.DataBind(); ViewState["commandname"] = "a"; } else { name = txtname.Text.ToString(); col = ObjUserlogin.Get_By_comandname(name); grdvwUser.DataSource = col; grdvwUser.DataBind(); ViewState["commandname"] = name; } }
public void BinddropRole() { // Declare col as Collection of RoleInfo_mst Object to get all records from table BLLCollection <RoleInfo_mst> col = new BLLCollection <RoleInfo_mst>(); // declare object objRole of RoleInfo_mst Class to call function Get_All() to fetch all records from database RoleInfo_mst objRole = new RoleInfo_mst(); // Assign all records to variable col col = objRole.Get_All(); dropRole.DataTextField = "rolename"; dropRole.DataValueField = "roleid"; dropRole.DataSource = col; dropRole.DataBind(); // Declare item as listItem to assign default value to drop down ListItem item = new ListItem(); item.Text = Resources.MessageResource.errSelectRole.ToString(); item.Value = "0"; dropRole.Items.Add(item); dropRole.SelectedValue = "0"; }
protected void BindDropSubCategory() { try { int categoryid = Convert.ToInt16(drpCategory.SelectedValue); colSubCategory = ObjSubcategory.Get_All_By_Categoryid(categoryid); drpSubCategory.DataTextField = "subcategoryname"; drpSubCategory.DataValueField = "subcategoryid"; drpSubCategory.DataSource = colSubCategory; drpSubCategory.DataBind(); ListItem item = new ListItem(); item.Text = "-------------Select-------------"; item.Value = "0"; drpSubCategory.Items.Add(item); drpSubCategory.SelectedValue = "0"; } catch (Exception ex) { ex.ToString(); } }
protected void BindListBox() { col = objEscalateEmail.Get_All(); listLevel1.DataTextField = "email"; listLevel1.DataValueField = "id"; listLevel1.DataSource = col; listLevel1.DataBind(); listLevel2.DataTextField = "email"; listLevel2.DataValueField = "id"; listLevel2.DataSource = col; listLevel2.DataBind(); listLevel3.DataTextField = "email"; listLevel3.DataValueField = "id"; listLevel3.DataSource = col; listLevel3.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(); }
protected void Page_Load(object sender, EventArgs e) { string username = (string)(Session["Username"]); int flag1 = 0; if (username == null) { lblusername.Text = ""; } else { lblusername.Text = username.ToString(); } //lblErrorMsg.Text = ""; if (!IsPostBack) { col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = ""; } }
protected void updateWorkaround() { int problemid = Convert.ToInt32(Request.QueryString[1]); int flag = Convert.ToInt32(Request.QueryString[0]); colproblems = ObjproblemToSolution.Get_All_Problemid(problemid); foreach (ProblemToSolution obj in colproblems) { if (obj.Solutiontype == "WorkAround") { ObjSolution = ObjSolution.Get_By_id(obj.Solutionid); if (ObjSolution.Solution == "WorkAround") { ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(obj.Solutionid); txtTitle.Text = ObjSolution.Title.ToString(); txtKeywords.Text = ObjSolutionKeyword.Keywords.ToString(); drpTopic.SelectedValue = Convert.ToString(ObjSolution.Topicid); Editor.Text = ObjSolution.Content.ToString(); } } } }
protected void BindDropTechnician() { objRole = objRole.Get_RoleInfo_By_RoleName("technician"); if (objRole.Roleid != 0) { int roleid; roleid = objRole.Roleid; if (roleid != 0) { colUser = objUser.Get_All_By_Role(roleid); drpUserList.DataTextField = "username"; drpUserList.DataValueField = "userid"; drpUserList.DataSource = colUser; drpUserList.DataBind(); ListItem item = new ListItem(); item.Text = "-------------Select-------------"; item.Value = "0"; drpUserList.Items.Add(item); drpUserList.SelectedValue = "0"; } } }
protected void departmentgrdvw_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState != DataControlRowState.Edit) { int siteid; Label lblsiteid = (Label)e.Row.FindControl("lblsite"); if (lblsiteid != null) { siteid = Convert.ToInt16(lblsiteid.Text); ViewState["siteid"] = lblsiteid.Text; objSite = objSite.Get_By_id(siteid); lblsiteid.Text = objSite.Sitename.ToString(); } } if (e.Row.RowState == (System.Web.UI.WebControls.DataControlRowState.Alternate | System.Web.UI.WebControls.DataControlRowState.Edit)) { DropDownList drpsitename = (DropDownList)e.Row.FindControl("drpsitename"); BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); col = objSite.Get_All(); drpsitename.DataSource = col; drpsitename.DataTextField = "sitename"; drpsitename.DataValueField = "siteid"; drpsitename.DataBind(); drpsitename.SelectedValue = ViewState["siteid"].ToString(); } if (e.Row.RowState == DataControlRowState.Edit) { DropDownList drpsitename = (DropDownList)e.Row.FindControl("drpsitename"); BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); col = objSite.Get_All(); drpsitename.DataSource = col; drpsitename.DataTextField = "SiteName"; drpsitename.DataValueField = "siteid"; drpsitename.DataBind(); drpsitename.SelectedValue = ViewState["siteid"].ToString(); } }
protected void Cabgrdvw_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState != DataControlRowState.Edit) { int statusid; Label lblstatusid = (Label)e.Row.FindControl("lblchangetypeid1"); if (lblstatusid != null) { statusid = Convert.ToInt16(lblstatusid.Text); ViewState["statusid"] = lblstatusid.Text; objct = objct.Get_By_id(statusid); lblstatusid.Text = objct.Changetypename.ToString(); } } if (e.Row.RowState == (System.Web.UI.WebControls.DataControlRowState.Alternate | System.Web.UI.WebControls.DataControlRowState.Edit)) { DropDownList drpcab1 = (DropDownList)e.Row.FindControl("drpcab1"); BLLCollection <ChangeType_mst> col = new BLLCollection <ChangeType_mst>(); col = objct.Get_All(); drpcab1.DataSource = col; drpcab1.DataTextField = "ChangeTypename"; drpcab1.DataValueField = "ChangeTypeid"; drpcab1.DataBind(); drpcab1.SelectedValue = ViewState["statusid"].ToString(); } if (e.Row.RowState == DataControlRowState.Edit) { DropDownList drpcab1 = (DropDownList)e.Row.FindControl("drpcab1"); BLLCollection <ChangeType_mst> col = new BLLCollection <ChangeType_mst>(); col = objct.Get_All(); drpcab1.DataSource = col; drpcab1.DataTextField = "ChangeTypename"; drpcab1.DataValueField = "ChangeTypeid"; drpcab1.DataBind(); drpcab1.SelectedValue = ViewState["statusid"].ToString(); } }
public void BindHub() { BLLCollection <Hub_mst> col = new BLLCollection <Hub_mst>(); col = objHub.Get_All(); for (int i = 0; i < col.Count; i++) { for (int j = i; j < col.Count; j++) { if (String.Compare(col[i].Hubname, col[j].Hubname) > 0) { Hub_mst obj = new Hub_mst(); obj = col[i]; col[i] = col[j]; col[j] = obj; } } } drpHub.DataTextField = "HubName"; drpHub.DataValueField = "Hubid"; drpHub.DataSource = col; drpHub.DataBind(); ////////////////////////////////////////////////////// //change done by meenakshi 12 july 2102 ListItem item = new ListItem(); //item.Text = "--------------Select--------------"; item.Text = "All"; item.Value = "0"; drpHub.Items.Add(item); drpHub.SelectedValue = "0"; //item.Value = "0"; //drpHub.Items.Add(item); //drpHub.SelectedValue = "0"; /////////////////////////////////////////////////////////////end }
public void BindDrpCategory() { // Declare col as Collection of Category_mst Object to get all records from table BLLCollection <Category_mst> col = new BLLCollection <Category_mst>(); // declare object objOrganization of Category_mst_mst Class to call function Get_All() to fetch all records from database // Assign all records to variable col col = ObjCategory.Get_All(); drpTopic.DataTextField = "CategoryName"; drpTopic.DataValueField = "categoryid"; drpTopic.DataSource = col; drpTopic.DataBind(); // Declare item as listItem to assign default value to drop down ListItem item = new ListItem(); item.Text = Resources.MessageResource.errSelectTopic.ToString(); item.Value = "0"; drpTopic.Items.Add(item); drpTopic.SelectedValue = "0"; }
// Handler grvwObj_RowDataBound handling GridView RowDataBound Event protected void grvwObj_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState != DataControlRowState.Edit) { int countryid; Label lblCountry = (Label)e.Row.FindControl("lblCountry"); if (lblCountry != null) { countryid = Convert.ToInt32(lblCountry.Text); ViewState["countryid"] = lblCountry.Text; objCountry = objCountry.Get_By_id(countryid); lblCountry.Text = objCountry.Countryname.ToString(); } } if (e.Row.RowState == DataControlRowState.Edit) { DropDownList dropCountry = (DropDownList)e.Row.FindControl("dropCountry"); BLLCollection <Country_mst> col = new BLLCollection <Country_mst>(); col = objCountry.Get_All(); dropCountry.DataSource = col; dropCountry.DataTextField = "countryname"; dropCountry.DataValueField = "countryid"; dropCountry.DataBind(); dropCountry.SelectedValue = ViewState["countryid"].ToString(); } if (e.Row.RowState == (System.Web.UI.WebControls.DataControlRowState.Alternate | System.Web.UI.WebControls.DataControlRowState.Edit)) { DropDownList dropCountry = (DropDownList)e.Row.FindControl("dropCountry"); BLLCollection <Country_mst> col = new BLLCollection <Country_mst>(); col = objCountry.Get_All(); dropCountry.DataSource = col; dropCountry.DataTextField = "countryname"; dropCountry.DataValueField = "countryid"; dropCountry.DataBind(); dropCountry.SelectedValue = ViewState["countryid"].ToString(); } }
public void SentMailToSDM(int siteid, int incidentid, int requesterid) { string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString(); string strContactNumber = Resources.MessageResource.strContactNumber.ToString(); int FlagUser; string varRole = Resources.MessageResource.strSDMRole.ToString(); int roleid; roleid = objRole.Get_By_RoleName(varRole); colUser = objUser.Get_All_By_Role(roleid); foreach (UserLogin_mst objusr in colUser) { FlagUser = objUserToSiteMapping.Get_By_Id(objusr.Userid, siteid); if (FlagUser != 0) { objIncident = objIncident.Get_By_id(incidentid); objSite = objSite.Get_By_id(objIncident.Siteid); objIncidentStates = objIncidentStates.Get_By_id(incidentid); objPriority = objPriority.Get_By_id(objIncidentStates.Priorityid); UserLogin_mst obju = new UserLogin_mst(); UserLogin_mst objReq = new UserLogin_mst(); obju = obju.Get_By_id(objUserToSiteMapping.Userid); objC_info = objC_info.Get_By_id(objusr.Userid); objReq = objReq.Get_By_id(requesterid); ContactInfo_mst objReqContInfo = new ContactInfo_mst(); objReqContInfo = objReqContInfo.Get_By_id(objReq.Userid); obj.From = Resources.MessageResource.strAdminEmail.ToString(); obj.To = objC_info.Emailid; obj.Subject = "High Priority Call. Ticket Id: " + incidentid; obj.Body = "Dear Sir/Madam,<br/>High Priority Call has been logged, please find below the Complaint details .<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objReq.Username + "<br/><b>Mail Address :</b>" + objReqContInfo.Emailid + "<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>"; obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } } }
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"] = ""; }
public void BindGrid() { DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); Asset_mst objAsset = new Asset_mst(); BLLCollection <Asset_mst> colAsset = new BLLCollection <Asset_mst>(); colAsset = objAsset.Get_All(); foreach (Asset_mst obj in colAsset) { DataRow row; row = dtTable.NewRow(); row["computername"] = Convert.ToString(obj.Computername); assetid = Convert.ToInt32(obj.Assetid); Asset_OperatingSystem_mst objos = new Asset_OperatingSystem_mst(); objos = objos.Get_By_Assetid(assetid); row["osname"] = Convert.ToString(objos.Os_name); row["username"] = Convert.ToString(objos.User_name); row["productkey"] = Convert.ToString(objos.Product_key); Asset_ProductInfo_mst objproduct = new Asset_ProductInfo_mst(); objproduct = objproduct.Get_By_Assetid(assetid); row["productname"] = Convert.ToString(objproduct.Product_name); row["productmanu"] = Convert.ToString(objproduct.Product_manufacturer); row["serialno"] = Convert.ToString(objproduct.Serial_number); Asset_Processor_mst objprocessor = new Asset_Processor_mst(); objprocessor = objprocessor.Get_By_Assetid(assetid); row["processorname"] = Convert.ToString(objprocessor.Processor_name); Asset_Memory_mst objmemory = new Asset_Memory_mst(); objmemory = objmemory.Get_By_Assetid(assetid); row["physicalmemory"] = Convert.ToString(objmemory.Physical_mem); dtTable.Rows.Add(row); } dtgrid.DataSource = dtTable; dtgrid.DataBind(); }
//protected void lnkdelete_Click(object sender, EventArgs e) //{ // string SolutionId = ""; // foreach (RepeaterItem gv in Repeter.Items) // { // string gvIDs; // int FlagStatus = 0; // // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row // CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // // Get the Site Id from variable of Label type declare in GridView of grdvwSite // gvIDs = ((Label)gv.FindControl("SiteID")).Text.ToString(); // // Check if gvIDs is not null // if (gvIDs != "") // { // if (deleteChkBxItem.Checked) // { // SolutionId = SolutionId + Convert.ToInt16(gvIDs) + ","; // } // } // } // string[] str = SolutionId.Split(new char[] { ',' }); // foreach (string s in str) // { // if (s == "") // { // break; // } // int solid = Convert.ToInt16(s); // Objsolutioncreator.Delete(solid); // ObjSolutionKeyword.Delete(solid); // ObjSolution.Delete(solid); // } // Response.Redirect("~/KEDB/ViewSolution.aspx"); //} private void LoadDataForFilterParameter() { BLLCollection <Solution_mst> col = new BLLCollection <Solution_mst>(); string filterid = drpfilter.SelectedValue; col = ObjSolution.Get_All_By_Filterid(filterid); PagedDataSource pgitems = new PagedDataSource(); pgitems.DataSource = col; pgitems.AllowPaging = true; pgitems.PageSize = 5; pgitems.CurrentPageIndex = PageNumber; if (pgitems.PageCount > 1) { rptPages.Visible = true; ArrayList pages = new ArrayList(); for (int i = 0; i < pgitems.PageCount; i++) { pages.Add((i + 1).ToString()); } rptPages.Visible = true; rptPages.DataSource = pages; rptPages.DataBind(); } else { rptPages.Visible = false; } Repeter.DataSource = pgitems; Repeter.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(); }
protected void grdvwViewUser_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("AlphaPaging")) { string commandname = e.CommandArgument.ToString(); ViewState["commandname"] = e.CommandArgument.ToString(); col = objUser.Get_By_comandname(commandname); if (col.Count != 0) { grdvwViewUser.DataSource = col; grdvwViewUser.DataBind(); } else { DataTable dt = new DataTable(); dt.Columns.Add("userid"); dt.Columns.Add("username"); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); grdvwViewUser.DataSource = dt; grdvwViewUser.DataBind(); } } }
protected void Bindgrid() { #region Declaration of localvariable and table Variable int filterId; DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); string userName = ""; int varTechnicianId = 0; string varSortParameter = "createdatetime"; #endregion #region Get Current User and his Role MembershipUser User = Membership.GetUser(); string varUserRole = ""; string varRoleTechnician = ""; if (User != null) { userName = User.UserName.ToString(); string[] arrUserRole = Roles.GetRolesForUser(); varUserRole = arrUserRole[0].ToString(); varRoleTechnician = Resources.MessageResource.strTechnicianRole.ToString(); } #endregion #region Get User object by Calling Function Get_UserLogin_By_UserName() via passing parameter username and organizationid objOrganization = objOrganization.Get_Organization(); objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid); #endregion #region If User Exist if (objUser.Userid != 0) { string fromdate = null; string todate = null; #region Find how many sites have been mapped to current user by calling function Get_All_By_userid() via passing parameter userid int userid = objUser.Userid; colUserToSite = ObjUserToSite.Get_All_By_userid(userid); #endregion #region Fetch each object from Collection of UserToSiteMapping foreach (UserToSiteMapping obj in colUserToSite) { #region Declare Local Variables and Collection of Incident_mst Type string Status; BLLCollection <Incident_mst> col = new BLLCollection <Incident_mst>(); int siteid; #endregion #region Get the Siteid and Filter Parameter siteid = obj.Siteid; filterId = 0; #endregion #region If Role of User is Technician #region If Filter Variable is All if (filterId == 0) { col = objIncident.Get_All_By_Siteid_Requesterid(siteid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #endregion #region Fetch Each object of type Incident_mst from Collection Incident_mst foreach (Incident_mst objInc in col) { #region Create Table row and assign value to it DataRow row; row = dtTable.NewRow(); row["incidentid"] = Convert.ToString(objInc.Incidentid); row["title"] = objInc.Title; row["requesterid"] = Convert.ToString(objInc.Requesterid); row["createdbyid"] = Convert.ToString(objInc.Createdbyid); row["siteid"] = Convert.ToString(objInc.Siteid); row["createdatetime"] = Convert.ToString(objInc.Createdatetime); objIncidentStates = objIncidentStates.Get_By_id(objInc.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["technicianid"] = objIncidentStates.Technicianid; row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); #endregion } #endregion } #endregion #region Bind Grid from datasource dtTable DataView dvData = new DataView(dtTable); string sortFormat = "{0} {1}"; String sortDirection = "DESC"; if (varSortParameter == "createdatetime") { varSortParameter = "incidentid"; } dvData.Sort = String.Format(sortFormat, varSortParameter, sortDirection); grdvwRequest.DataSource = dvData; grdvwRequest.DataBind(); #endregion } #endregion }
protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e) { System.Drawing.ColorConverter colConvert = new ColorConverter(); BLLCollection <ColorScheme_mst> colColor = new BLLCollection <ColorScheme_mst>(); if (e.Row.RowType == DataControlRowType.DataRow) { #region Autogenerate Serial number Label lblSerial = (Label)e.Row.FindControl("lblSerial"); lblSerial.Text = i.ToString(); i++; #endregion int TotalTimeSpentonCall; int TotalResolutionTime; int varIncidentid = Convert.ToInt16(((Label)e.Row.FindControl("incidentid")).Text.ToString()); string varCreateDatetime = e.Row.Cells[9].Text; string varStatusOpen = Resources.MessageResource.strStatusOpen.ToString(); string varStatusClose = Resources.MessageResource.strStatusClose.ToString(); string varStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString(); string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString(); #region Bind Data Row at Run time with requesterid to Requester name int requesterid = Convert.ToInt16(e.Row.Cells[3].Text); objUser = objUser.Get_By_id(requesterid); if (objUser.Userid != 0) { e.Row.Cells[3].Text = objUser.Username.ToString(); } else { e.Row.Cells[3].Text = ""; } #endregion #region Bind Datarow at Run Time with Createdbyid to Created by name int createdbyid = Convert.ToInt16(e.Row.Cells[4].Text); objUser = objUser.Get_By_id(createdbyid); if (objUser.Userid != 0) { e.Row.Cells[4].Text = objUser.Username.ToString(); } else { e.Row.Cells[4].Text = ""; } #endregion #region Bind Datarow at Run Time with technicianid to technician name int technicianid = Convert.ToInt16(e.Row.Cells[5].Text); objUser = objUser.Get_By_id(technicianid); if (objUser.Userid != 0) { e.Row.Cells[5].Text = objUser.Username.ToString(); } else { e.Row.Cells[5].Text = ""; } #endregion #region Bind Datarow at run time with Statusid to Status int statusid = Convert.ToInt16(e.Row.Cells[6].Text); objStatus = objStatus.Get_By_id(statusid); if (objStatus.Statusid != 0) { e.Row.Cells[6].Text = objStatus.Statusname.ToString(); } else { e.Row.Cells[6].Text = ""; } #endregion #region Bind Datarow at run time with Priorityid to Priority int priorityid = Convert.ToInt16(e.Row.Cells[7].Text); objPriority = objPriority.Get_By_id(priorityid); if (objPriority.Priorityid != 0) { e.Row.Cells[7].Text = objPriority.Name.ToString(); } else { e.Row.Cells[7].Text = ""; } #endregion #region Bind Datarow at run time with Siteid to Site int siteid = Convert.ToInt16(e.Row.Cells[8].Text); objSite = objSite.Get_By_id(siteid); if (objSite.Siteid != 0) { string custSiteName; int custid = 0; colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid); foreach (CustomerToSiteMapping objCuToSite in colCustToSite) { custid = objCuToSite.Custid; } objCustomer = objCustomer.Get_By_id(custid); e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString(); } else { e.Row.Cells[8].Text = ""; } #endregion #region Apply Color Coding to Open Calls,According to define SLA if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower()) { Incident_mst obj = new Incident_mst(); obj = obj.Get_By_id(varIncidentid); if (obj.Incidentid != 0) { if (obj.Slaid != 0) { #region Declare local variables,and objects of various classes int percent; ProcessEscalateEmail objPro = new ProcessEscalateEmail(); #endregion #region Get Total Resolution time define for particular SLA and Time Spent on Request TotalResolutionTime = objPro.GetResolutionTimeInMins(obj.Slaid); TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString()); if (TotalTimeSpentonCall < 0) { TotalTimeSpentonCall = 0; } #endregion #region Calculate Percent percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime; #endregion ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOpen); foreach (ColorScheme_mst objCol in colColor) { if (objCol.Percnt_to != 0) { if (percent >= objCol.Percnt && percent <= objCol.Percnt_to) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } else { if (percent >= objCol.Percnt) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } else { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus("NonSLA"); foreach (ColorScheme_mst objCol in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } #endregion #region Apply Color Coding to Close Calls if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusClose); foreach (ColorScheme_mst obj in colColor) { try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } catch (Exception ex) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); } } } #endregion #region Apply Color Coding to On Hold Calls if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOnHold); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion #region Apply Color Coding to Resolved Calls if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusResolved); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion } }
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 void GetAllCalls() { #region Declaretion of local variables int totalResolutionTimeInMins; int totalSpentMinOnCall; int totalEscalateEmailLevel1Min; int totalEscalateEmailLevel2Min; int totalEscalateEmailLevel3Min; string status = Resources.MessageResource.strStatusOpen.ToString(); int statusId = objStatus.Get_By_StatusName(status); int requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeIncident.ToString()); #endregion #region Get All Open Calls,of Incident Type colIncident = objIncident.Get_All_For_ProcessEmailEscalate(statusId, requesttypeid); #endregion #region Process Each Call , and check Time spent on call and Escalation Time foreach (Incident_mst obj in colIncident) { #region Get Total Resolution Time Define for Selected SLA totalResolutionTimeInMins = GetResolutionTimeInMins(obj.Slaid); #endregion #region Get Total time Spent on Call,till now totalSpentMinOnCall = obj.Get_TimeSpentonRequest(obj.Incidentid, obj.Siteid, obj.Createdatetime, DateTime.Now.ToString()); #endregion #region Get Total Time Define for Level 1 Escalation to shoot mail totalEscalateEmailLevel1Min = GetLevel1EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel1Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel1Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 1, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 2 Escalation to shoot mail totalEscalateEmailLevel2Min = GetLevel2EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel2Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel2Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 2, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 3 Escalation to shoot mail totalEscalateEmailLevel3Min = GetLevel3EscalationTimeInMins(obj.Slaid); if (totalEscalateEmailLevel3Min > 0) { #region Check ,If Email Escalation time is defined to shoot mail if ((totalSpentMinOnCall + totalEscalateEmailLevel3Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 3, obj.Slaid); } #endregion } #endregion } #endregion }
protected void BindSite() { //change done by meenakshi int hubid = 0; hubid = Convert.ToInt32(drpHub.SelectedValue); if (drpHub.SelectedValue != "") { hubid = Convert.ToInt32(drpHub.SelectedValue); } if (hubid != 0) { colSite = objSite.Get_By_hubid_site(hubid); //end drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; //drpsite.DataSource = colSite; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); // item.Selected = true; item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); drpsite.SelectedValue = "0"; } else { colSite = objSite.Get_All(); for (int i = 0; i < colSite.Count; i++) { for (int j = i; j < colSite.Count; j++) { if (String.Compare(colSite[i].Sitename, colSite[j].Sitename) > 0) { Site_mst obj = new Site_mst(); obj = colSite[i]; colSite[i] = colSite[j]; colSite[j] = obj; } } } drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; //drpsite.DataSource = colSite; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); drpsite.SelectedValue = "0"; //item.Text = "---Select Site---"; //item.Value = "0"; //drpsite.Items.Add(item); //drpsite.SelectedValue = "0"; } }
public void SentmailUser(int userid, int incidentid, string status) { objIncident = objIncident.Get_By_id(incidentid); //added by lalit 02 nov to get resolution and show it to user when call closed mail goes to user objIncidentResolution = objIncidentResolution.Get_By_id(incidentid); //end objSite = objSite.Get_By_id(objIncident.Siteid); objAreaManager = objAreaManager.Get_By_id(objSite.Siteid); objIncidentStates = objIncidentStates.Get_By_id(incidentid); objPriority = objPriority.Get_By_id(objIncidentStates.Priorityid); objUser = objUser.Get_By_id(objIncident.Requesterid); objC_info = objC_info.Get_By_id(userid); objtech = objtech.Get_By_id(objIncidentStates.Technicianid); colemailid = objemail.Get_All_userid(userid); string strStatusOpen = Resources.MessageResource.strStatusOpen.ToString(); string strStatusClose = Resources.MessageResource.strStatusClose.ToString(); string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString(); string strContactNumber = Resources.MessageResource.strContactNumber.ToString(); if (strStatusOpen.ToLower() == status.ToLower()) { foreach (UserEmail obj1 in colemailid) { if (obj1.Emailid != null) { obj.From = Resources.MessageResource.strAdminEmail.ToString(); obj.To = obj1.Emailid; obj.CC = objAreaManager.Email; obj.Subject = "Call Logged. Ticket Id : " + incidentid; obj.Body = "Dear " + objC_info.Firstname + ",<br/><br/> Thank you for contacting IT Service desk, please find below the new Ticket Id details for your future reference.<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>EstimatedResolutionTime :</b> " + GetResolutionTimeInHours(objIncident.Slaid) + "<br/><b>Email Address :</b> " + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> " + strYourSinscerely + "</b>"; obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); string varPriority = Resources.MessageResource.strPriorityHigh.ToString(); if (objPriority.Priorityid != 0) { if (objPriority.Name.ToLower() == varPriority.ToLower()) { SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid); } } } } //if (objC_info.Emailid != null) //{ // obj.From = Resources.MessageResource.strAdminEmail.ToString(); // obj.To = objC_info.Emailid; // obj.Subject = " New Call Logged. Ticket Id : " + incidentid; // obj.Body = "Dear User,<br/> Thank you for contacting Service desk, please find below the Ticket Id details for your future reference.<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>"; // obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); // //obj.SentMail(); // string varPriority = Resources.MessageResource.strPriorityHigh.ToString(); // if (objPriority.Priorityid != 0) // { // if (objPriority.Name.ToLower() == varPriority.ToLower()) // { // SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid); // } // } //} } if (strStatusClose.ToLower() == status.ToLower()) { foreach (UserEmail obj1 in colemailid) { if (obj1.Emailid != null) { int id = Convert.ToInt16(objIncident.Incidentid); string varServerName1; string varfeedbackmode; varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString(); //added by lalit to check feedback mode. feedback should add in mail or not. //fetching value from resouce file which is from appsettting page. varfeedbackmode = Resources.MessageResource.UserFeedbackmode.ToString(); string url11; url11 = "http://" + varServerName1 + "/" + getpath() + "/LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid; //url11 = "../LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid; if (objC_info.Emailid != null) { // string url; // url = "<a href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>"; string url = "<a href=" + url11 + " ' onclick=window.open()>Your Feedback</a>"; obj.From = Resources.MessageResource.strAdminEmail.ToString(); obj.To = obj1.Emailid; obj.CC = objAreaManager.Email; obj.Subject = "Call Closed Ticket id : " + incidentid; //added by lalit if (varfeedbackmode == "0") //0 means default mode where user will not recieve link in mail to give feedback { obj.Body = "Dear " + objC_info.Firstname + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by <b>" + objtech.Username + "</b> on <b>" + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</b> " + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>" + strYourSinscerely + "</b>"; } else { obj.Body = "Dear " + objC_info.Firstname + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by <b>" + objtech.Username + "</b> on <b>" + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</b> " + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + strContactNumber + ".<br/><br/>To give feedback click on " + url + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>" + strYourSinscerely + "</b>"; } obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } } } //int id = Convert.ToInt16(objIncident.Incidentid); //string varServerName1; //varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString(); //// varServerName = "10.80.0.15"; //string url11; //url11 = "http://" + varServerName1 + "/BESTN/LoginPageAccess/CustomerFeedback.aspx?incident=" + id; //if (objC_info.Emailid != null) //{ // string url; // url = "<a href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>"; // obj.From = Resources.MessageResource.strAdminEmail.ToString(); // obj.To = objC_info.Emailid; // obj.Subject = "Call Closed Ticket id : " + incidentid; // obj.Body = "Dear User,<br/> <b>Complaint Status:</b>Problem solved and call closed by <b>" + objtech.Username + "</b> on <b>" + objIncident.Completedtime + "</b>.We are pleased to inform you that your reported Service Call has been attended and problem solved as informed by our engineer.<br/>Should there be any further questions or queries, please do not hesitate to contact the Service Desk on 0120 4393941, quoting your Ticket Reference Number. " + "<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "</br><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Your Feedback</b><br/><br/>" + url + "<br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>"; // obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); // // obj.SentMail(); //} } }
protected void BindGrid() { colChange = ObjChange.Get_All(); grdvwChange.DataSource = colChange; grdvwChange.DataBind(); }