protected void ChangeTypegrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name, desc, id; int ChangeTypeId = 0; name = ((TextBox)ChangeTypegrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtStatusName")).Text; desc = ((TextBox)ChangeTypegrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtStatusdesc")).Text; id = Convert.ToString(ChangeTypegrdvw.Rows[e.RowIndex].Cells[0].Text); ChangeTypeId = Convert.ToInt32(id); changetypecount = ObjChangeType.Get_By_ChangeTypeName(name); ObjChangeType = ObjChangeType.Get_By_id(ChangeTypeId); if ((changetypecount == 0) && (name != "")) { ObjChangeType.Changetypename = name; ObjChangeType.Changetypeid = ChangeTypeId; ObjChangeType.Description = desc; ObjChangeType.Update(); ChangeTypegrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else if (name == "") { lblerrmsg.Text = "Change Type Field should not be empty"; } else if (ObjChangeType.Changetypename == name) { ObjChangeType.Changetypeid = ChangeTypeId; ObjChangeType.Changetypename = name; ObjChangeType.Description = desc; ObjChangeType.Update(); ChangeTypegrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else { BindGrid(); lblerrmsg.Text = Resources.MessageResource.erralready.ToString(); } ChangeTypegrdvw.EditIndex = -1; }
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(); } }
protected void showCMDBValues() { panalupdatecmdb.Visible = true; int Incidentidforchange = Convert.ToInt32(Session["Incidentidforchange"]); ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange); int changeid = Convert.ToInt32(ObjIncidentochange.Changeid); Objincludeasset = Objincludeasset.Get_By_Changeid(changeid); int Assetid = Convert.ToInt32(Objincludeasset.Assetid); ObjConfiguration = ObjConfiguration.Get_By_id(Assetid); int itemid = Convert.ToInt32(ObjConfiguration.Itemid); ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid); ObjCMDB = ObjCMDB.Get_By_id(Assetid); Objchange = Objchange.Get_By_id(changeid); int categoryid = Convert.ToInt32(Objchange.Categoryid); Objcategory = Objcategory.Get_By_id(categoryid); if (categoryid != 0) { lblcategory.Text = Objcategory.CategoryName.ToString(); } int Subcategoryid = Convert.ToInt32(Objchange.Subcategoryid); Objsubcategory = Objsubcategory.Get_By_id(Subcategoryid); if (Subcategoryid != 0) { lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString(); } lblassetid.Text = ObjConfiguration.Assetid.ToString(); int itemid1 = Convert.ToInt32(ObjConfiguration.Itemid); Objcategory = Objcategory.Get_By_id(itemid1); lblitemname.Text = Objcategory.CategoryName.ToString(); Objvendor = Objvendor.Get_By_id(ObjConfiguration.Vendorid); lblvendor.Text = Objvendor.Vendorname.ToString(); lblchangeid.Text = Objchange.Changeid.ToString(); lblserialno.Text = ObjConfiguration.Serialno.ToString(); int changetypid = Convert.ToInt32(Objchange.Changetype); Objchangetype = Objchangetype.Get_By_id(changetypid); lblchangetype.Text = Objchangetype.Changetypename.ToString(); lbltitle.Text = Objchange.Title.ToString(); if (ObjConfigurableitem.Param1 != "") { txtparam1.Visible = true; lblparam1.Text = ObjConfigurableitem.Param1.ToString(); txtparam1.Text = ObjCMDB.Param1.ToString(); } if (ObjConfigurableitem.Param2 != "") { txtparam2.Visible = true; lblparam2.Text = ObjConfigurableitem.Param2.ToString(); txtparam2.Text = ObjCMDB.Param2.ToString(); } if (ObjConfigurableitem.Param3 != "") { txtparam3.Visible = true; lblparam3.Text = ObjConfigurableitem.Param3.ToString(); txtparam3.Text = ObjCMDB.Param3.ToString(); } if (ObjConfigurableitem.Param4 != "") { txtparam4.Visible = true; lblparam4.Text = ObjConfigurableitem.Param4.ToString(); txtparam4.Text = ObjCMDB.Param4.ToString(); } if (ObjConfigurableitem.Param5 != "") { txtparam5.Visible = true; lblparam5.Text = ObjConfigurableitem.Param5.ToString(); txtparam5.Text = ObjCMDB.Param5.ToString(); } if (ObjConfigurableitem.Param6 != "") { txtparam6.Visible = true; lblparam6.Text = ObjConfigurableitem.Param6.ToString(); txtparam6.Text = ObjCMDB.Param6.ToString(); } if (ObjConfigurableitem.Param7 != "") { txtparam7.Visible = true; lblparam7.Text = ObjConfigurableitem.Param7.ToString(); txtparam7.Text = ObjCMDB.Param7.ToString(); } if (ObjConfigurableitem.Param8 != "") { txtparam8.Visible = true; lblparam8.Text = ObjConfigurableitem.Param8.ToString(); txtparam8.Text = ObjCMDB.Param8.ToString(); } if (ObjConfigurableitem.Param9 != "") { txtparam9.Visible = true; lblparam9.Text = ObjConfigurableitem.Param9.ToString(); txtparam9.Text = ObjCMDB.Param9.ToString(); } if (ObjConfigurableitem.Param10 != "") { txtparam10.Visible = true; lblparam10.Text = ObjConfigurableitem.Param10.ToString(); txtparam10.Text = ObjCMDB.Param10.ToString(); } }
protected void showCMDBValues() { panalupdatecmdb.Visible = true; int Incidentidforchange = Convert.ToInt16(Session["Incidentidforchange"]); ObjIncidentochange = ObjIncidentochange.Get_By_Incidentid(Incidentidforchange); int changeid = Convert.ToInt16(ObjIncidentochange.Changeid); Objincludeasset = Objincludeasset.Get_By_Changeid(changeid); int Assetid = Convert.ToInt16(Objincludeasset.Assetid); ObjConfiguration = ObjConfiguration.Get_By_id(Assetid); int itemid = Convert.ToInt16(ObjConfiguration.Itemid); ObjConfigurableitem = ObjConfigurableitem.Get_By_id(itemid); ObjCMDB = ObjCMDB.Get_By_id(Assetid); Objchange = Objchange.Get_By_id(changeid); int categoryid = Convert.ToInt16(Objchange.Categoryid); Objcategory = Objcategory.Get_By_id(categoryid); if (categoryid != 0) { lblcategory.Text = Objcategory.CategoryName.ToString(); } int Subcategoryid = Convert.ToInt16(Objchange.Subcategoryid); Objsubcategory = Objsubcategory.Get_By_id(Subcategoryid); if (Subcategoryid != 0) { lblsubcategory.Text = Objsubcategory.Subcategoryname.ToString(); } lblassetid.Text = ObjConfiguration.Assetid.ToString(); int itemid1=Convert.ToInt16(ObjConfiguration.Itemid); Objcategory = Objcategory.Get_By_id(itemid1); lblitemname.Text = Objcategory.CategoryName.ToString(); Objvendor = Objvendor.Get_By_id(ObjConfiguration.Vendorid); lblvendor.Text = Objvendor.Vendorname.ToString(); lblchangeid.Text = Objchange.Changeid.ToString(); lblserialno.Text = ObjConfiguration.Serialno.ToString(); int changetypid=Convert.ToInt16(Objchange.Changetype); Objchangetype = Objchangetype.Get_By_id(changetypid); lblchangetype.Text = Objchangetype.Changetypename.ToString(); lbltitle.Text = Objchange.Title.ToString(); if (ObjConfigurableitem.Param1 != "") { txtparam1.Visible = true; lblparam1.Text = ObjConfigurableitem.Param1.ToString(); txtparam1.Text = ObjCMDB.Param1.ToString(); } if (ObjConfigurableitem.Param2 != "") { txtparam2.Visible = true; lblparam2.Text = ObjConfigurableitem.Param2.ToString(); txtparam2.Text = ObjCMDB.Param2.ToString(); } if (ObjConfigurableitem.Param3 != "") { txtparam3.Visible = true; lblparam3.Text = ObjConfigurableitem.Param3.ToString(); txtparam3.Text = ObjCMDB.Param3.ToString(); } if (ObjConfigurableitem.Param4 != "") { txtparam4.Visible = true; lblparam4.Text = ObjConfigurableitem.Param4.ToString(); txtparam4.Text = ObjCMDB.Param4.ToString(); } if (ObjConfigurableitem.Param5 != "") { txtparam5.Visible = true; lblparam5.Text = ObjConfigurableitem.Param5.ToString(); txtparam5.Text = ObjCMDB.Param5.ToString(); } if (ObjConfigurableitem.Param6 != "") { txtparam6.Visible = true; lblparam6.Text = ObjConfigurableitem.Param6.ToString(); txtparam6.Text = ObjCMDB.Param6.ToString(); } if (ObjConfigurableitem.Param7 != "") { txtparam7.Visible = true; lblparam7.Text = ObjConfigurableitem.Param7.ToString(); txtparam7.Text = ObjCMDB.Param7.ToString(); } if (ObjConfigurableitem.Param8 != "") { txtparam8.Visible = true; lblparam8.Text = ObjConfigurableitem.Param8.ToString(); txtparam8.Text = ObjCMDB.Param8.ToString(); } if (ObjConfigurableitem.Param9 != "") { txtparam9.Visible = true; lblparam9.Text = ObjConfigurableitem.Param9.ToString(); txtparam9.Text = ObjCMDB.Param9.ToString(); } if (ObjConfigurableitem.Param10 != "") { txtparam10.Visible = true; lblparam10.Text = ObjConfigurableitem.Param10.ToString(); txtparam10.Text = ObjCMDB.Param10.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(); } }
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(); }
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 ChangeTypegrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name, desc, id; int ChangeTypeId = 0; name = ((TextBox)ChangeTypegrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtStatusName")).Text; desc = ((TextBox)ChangeTypegrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtStatusdesc")).Text; id = Convert.ToString(ChangeTypegrdvw.Rows[e.RowIndex].Cells[0].Text); ChangeTypeId = Convert.ToInt16(id); changetypecount = ObjChangeType.Get_By_ChangeTypeName(name); ObjChangeType = ObjChangeType.Get_By_id(ChangeTypeId); if ((changetypecount == 0) && (name != "")) { ObjChangeType.Changetypename = name; ObjChangeType.Changetypeid = ChangeTypeId; ObjChangeType.Description = desc; ObjChangeType.Update(); ChangeTypegrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else if (name == "") { lblerrmsg.Text = "Change Type Field should not be empty"; } else if (ObjChangeType.Changetypename == name) { ObjChangeType.Changetypeid = ChangeTypeId; ObjChangeType.Changetypename = name; ObjChangeType.Description = desc; ObjChangeType.Update(); ChangeTypegrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else { BindGrid(); lblerrmsg.Text = Resources.MessageResource.erralready.ToString(); } ChangeTypegrdvw.EditIndex = -1; }
public int Update_ChangeType_mst_By_id(ChangeType_mst objChangeType) { return (int)ExecuteNonQuery(Sp_ChangeType_Update, new object[] { objChangeType.Changetypeid, objChangeType.Changetypename, objChangeType.Description }); }
public int Insert_ChangeType_mst(ChangeType_mst objChangeType) { return (int)ExecuteNonQuery(Sp_ChangeType_Insert, new object[] { objChangeType.Changetypename, objChangeType.Description }); }
public object GenerateChangeType_mstObject(ref IDataReader returnData) { ChangeType_mst obj = new ChangeType_mst(); while (returnData.Read()) { obj.Changetypeid = (int)returnData["changetypeid"]; obj.Changetypename = (string)returnData["changetypename"]; obj.Description = (string)returnData["description"]; } returnData.Close(); returnData.Dispose(); return obj; }
public CollectionBase GenerateChangeType_mstCollection(ref IDataReader returnData) { BLLCollection<ChangeType_mst> col = new BLLCollection<ChangeType_mst>(); while (returnData.Read()) { ChangeType_mst obj = new ChangeType_mst(); obj.Changetypeid = (int)returnData["ChangeTypeid"]; obj.Changetypename = (string)returnData["ChangeTypename"]; obj.Description = (string)returnData["Description"]; col.Add(obj); } returnData.Close(); returnData.Dispose(); return col; }