public IHttpActionResult PostCMDB(CMDB cMDB) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CMDBs.Add(cMDB); try { db.SaveChanges(); } catch (DbUpdateException) { if (CMDBExists(cMDB.TipoCI)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = cMDB.TipoCI }, cMDB)); }
public IHttpActionResult PutCMDB(string id, CMDB cMDB) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cMDB.TipoCI) { return(BadRequest()); } db.Entry(cMDB).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CMDBExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetCMDB(string id) { CMDB cMDB = db.CMDBs.Find(id); if (cMDB == null) { return(NotFound()); } return(Ok(cMDB)); }
public IHttpActionResult DeleteCMDB(string id) { CMDB cMDB = db.CMDBs.Find(id); if (cMDB == null) { return(NotFound()); } db.CMDBs.Remove(cMDB); db.SaveChanges(); return(Ok(cMDB)); }
protected void btnupdate_Click(object sender, EventArgs e) {///Add Exception handilng try catch change by vishal 21-05-2012 try { TextBox txtp1 = (TextBox)PlaceHolderParams.FindControl("txtparam1Id"); TextBox txtp2 = (TextBox)PlaceHolderParams.FindControl("txtparam2Id"); TextBox txtp3 = (TextBox)PlaceHolderParams.FindControl("txtparam3Id"); TextBox txtp4 = (TextBox)PlaceHolderParams.FindControl("txtparam4Id"); TextBox txtp5 = (TextBox)PlaceHolderParams.FindControl("txtparam5Id"); TextBox txtp6 = (TextBox)PlaceHolderParams.FindControl("txtparam6Id"); TextBox txtp7 = (TextBox)PlaceHolderParams.FindControl("txtparam7Id"); TextBox txtp8 = (TextBox)PlaceHolderParams.FindControl("txtparam8Id"); TextBox txtp9 = (TextBox)PlaceHolderParams.FindControl("txtparam9Id"); TextBox txtp10 = (TextBox)PlaceHolderParams.FindControl("txtparam10Id"); 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); //ObjCMDB.Assetid = ObjConfiguration.Assetid; CMDB objcmdb = new CMDB(); objcmdb.Assetid = ObjConfiguration.Assetid; if (ObjConfigurableitem.Param1 != "") { if (txtp1.Text == ObjCMDB.Param1) { objcmdb.Param1 = txtp1.Text.ToString(); } else { objcmdb.Param1 = txtp1.Text.ToString(); Objcmdbtrans.Currentvalue = txtp1.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param1; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param1; Objcmdbtrans.Insert(); } } else { objcmdb.Param1 = ObjCMDB.Param1; } if (ObjConfigurableitem.Param2 != "") { if (txtp2.Text == ObjCMDB.Param2) { objcmdb.Param2 = txtp2.Text.ToString(); } else { objcmdb.Param2 = txtp2.Text.ToString(); Objcmdbtrans.Currentvalue = txtp2.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param2; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param2; Objcmdbtrans.Insert(); } } else { objcmdb.Param2 = ObjCMDB.Param2; } if (ObjConfigurableitem.Param3 != "") { if (txtp3.Text == ObjCMDB.Param3) { objcmdb.Param3 = txtp3.Text.ToString(); } else { objcmdb.Param3 = txtp3.Text.ToString(); Objcmdbtrans.Currentvalue = txtp3.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param3; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param3; Objcmdbtrans.Insert(); } } else { objcmdb.Param3 = ObjCMDB.Param3; } if (ObjConfigurableitem.Param4 != "") { if (txtp4.Text == ObjCMDB.Param4) { objcmdb.Param4 = txtp4.Text.ToString(); } else { objcmdb.Param4 = txtp4.Text.ToString(); Objcmdbtrans.Currentvalue = txtp4.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param4; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param4; Objcmdbtrans.Insert(); } } else { objcmdb.Param4 = ObjCMDB.Param4; } if (ObjConfigurableitem.Param5 != "") { if (txtp5.Text == ObjCMDB.Param5) { objcmdb.Param5 = txtp5.Text.ToString(); } else { objcmdb.Param5 = txtp5.Text.ToString(); Objcmdbtrans.Currentvalue = txtp5.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param5; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param5; Objcmdbtrans.Insert(); } } else { objcmdb.Param5 = ObjCMDB.Param5; } if (ObjConfigurableitem.Param6 != "") { if (txtp6.Text == ObjCMDB.Param6) { objcmdb.Param6 = txtp6.Text.ToString(); } else { objcmdb.Param6 = txtp6.Text.ToString(); Objcmdbtrans.Currentvalue = txtp6.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param6; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param6; Objcmdbtrans.Insert(); } } else { objcmdb.Param6 = ObjCMDB.Param6; } if (ObjConfigurableitem.Param7 != "") { if (txtp7.Text == ObjCMDB.Param7) { objcmdb.Param7 = txtp7.Text.ToString(); } else { objcmdb.Param7 = txtp7.Text.ToString(); Objcmdbtrans.Currentvalue = txtp7.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param7; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param7; Objcmdbtrans.Insert(); } } else { objcmdb.Param7 = ObjCMDB.Param7; } if (ObjConfigurableitem.Param8 != "") { if (txtp8.Text == ObjCMDB.Param8) { objcmdb.Param8 = txtp8.Text.ToString(); } else { objcmdb.Param8 = txtp8.Text.ToString(); Objcmdbtrans.Currentvalue = txtp8.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param8; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param8; Objcmdbtrans.Insert(); } } else { objcmdb.Param8 = ObjCMDB.Param8; } if (ObjConfigurableitem.Param9 != "") { if (txtp8.Text == ObjCMDB.Param9) { objcmdb.Param9 = txtp9.Text.ToString(); } else { objcmdb.Param9 = txtp9.Text.ToString(); Objcmdbtrans.Currentvalue = txtp9.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param9; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param9; Objcmdbtrans.Insert(); } } else { objcmdb.Param9 = ObjCMDB.Param9; } if (ObjConfigurableitem.Param10 != "") { if (txtp10.Text == ObjCMDB.Param10) { objcmdb.Param10 = txtp10.Text.ToString(); } else { objcmdb.Param10 = txtp10.Text.ToString(); Objcmdbtrans.Currentvalue = txtp10.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param10; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param10; Objcmdbtrans.Insert(); } } else { objcmdb.Param10 = ObjCMDB.Param10; } objcmdb.Update(); Configuration_mst obj = new Configuration_mst(); obj.Assetid = ObjConfiguration.Assetid; obj.Vendorid = ObjConfiguration.Vendorid; obj.Itemid = ObjConfiguration.Itemid; obj.Serialno = ObjConfiguration.Serialno; int versionno = ObjConfiguration.Version; versionno = versionno + 1; obj.Version = versionno; obj.Siteid = ObjConfiguration.Siteid; obj.Severity = ObjConfiguration.Severity; obj.Purchasedate = ObjConfiguration.Purchasedate; obj.Update(); Session["CMDBUpdate"] = "true"; string myScript; //myScript = "<script language=javascript>javascript:window.close();</script>"; ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true); // Page.RegisterClientScriptBlock("MyScript", myScript); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnupdate_Click(object sender, EventArgs e) { TextBox txtp1 = (TextBox)PlaceHolderParams.FindControl("txtparam1Id"); TextBox txtp2 = (TextBox)PlaceHolderParams.FindControl("txtparam2Id"); TextBox txtp3 = (TextBox)PlaceHolderParams.FindControl("txtparam3Id"); TextBox txtp4 = (TextBox)PlaceHolderParams.FindControl("txtparam4Id"); TextBox txtp5 = (TextBox)PlaceHolderParams.FindControl("txtparam5Id"); TextBox txtp6 = (TextBox)PlaceHolderParams.FindControl("txtparam6Id"); TextBox txtp7 = (TextBox)PlaceHolderParams.FindControl("txtparam7Id"); TextBox txtp8 = (TextBox)PlaceHolderParams.FindControl("txtparam8Id"); TextBox txtp9 = (TextBox)PlaceHolderParams.FindControl("txtparam9Id"); TextBox txtp10 = (TextBox)PlaceHolderParams.FindControl("txtparam10Id"); 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); //ObjCMDB.Assetid = ObjConfiguration.Assetid; CMDB objcmdb = new CMDB(); objcmdb.Assetid = ObjConfiguration.Assetid; if (ObjConfigurableitem.Param1 != "") { if (txtp1.Text == ObjCMDB.Param1) { objcmdb.Param1 = txtp1.Text.ToString(); } else { objcmdb.Param1 = txtp1.Text.ToString(); Objcmdbtrans.Currentvalue = txtp1.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param1; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param1; Objcmdbtrans.Insert(); } } else { objcmdb.Param1 = ObjCMDB.Param1; } if (ObjConfigurableitem.Param2 != "") { if (txtp2.Text == ObjCMDB.Param2) { objcmdb.Param2 = txtp2.Text.ToString(); } else { objcmdb.Param2 = txtp2.Text.ToString(); Objcmdbtrans.Currentvalue = txtp2.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param2; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param2; Objcmdbtrans.Insert(); } } else { objcmdb.Param2 = ObjCMDB.Param2; } if (ObjConfigurableitem.Param3 != "") { if (txtp3.Text == ObjCMDB.Param3) { objcmdb.Param3 = txtp3.Text.ToString(); } else { objcmdb.Param3 = txtp3.Text.ToString(); Objcmdbtrans.Currentvalue = txtp3.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param3; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param3; Objcmdbtrans.Insert(); } } else { objcmdb.Param3 = ObjCMDB.Param3; } if (ObjConfigurableitem.Param4 != "") { if (txtp4.Text == ObjCMDB.Param4) { objcmdb.Param4 = txtp4.Text.ToString(); } else { objcmdb.Param4 = txtp4.Text.ToString(); Objcmdbtrans.Currentvalue = txtp4.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param4; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param4; Objcmdbtrans.Insert(); } } else { objcmdb.Param4 = ObjCMDB.Param4; } if (ObjConfigurableitem.Param5 != "") { if (txtp5.Text == ObjCMDB.Param5) { objcmdb.Param5 = txtp5.Text.ToString(); } else { objcmdb.Param5 = txtp5.Text.ToString(); Objcmdbtrans.Currentvalue = txtp5.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param5; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param5; Objcmdbtrans.Insert(); } } else { objcmdb.Param5 = ObjCMDB.Param5; } if (ObjConfigurableitem.Param6 != "") { if (txtp6.Text == ObjCMDB.Param6) { objcmdb.Param6 = txtp6.Text.ToString(); } else { objcmdb.Param6 = txtp6.Text.ToString(); Objcmdbtrans.Currentvalue = txtp6.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param6; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param6; Objcmdbtrans.Insert(); } } else { objcmdb.Param6 = ObjCMDB.Param6; } if (ObjConfigurableitem.Param7 != "") { if (txtp7.Text == ObjCMDB.Param7) { objcmdb.Param7 = txtp7.Text.ToString(); } else { objcmdb.Param7 = txtp7.Text.ToString(); Objcmdbtrans.Currentvalue = txtp7.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param7; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param7; Objcmdbtrans.Insert(); } } else { objcmdb.Param7 = ObjCMDB.Param7; } if (ObjConfigurableitem.Param8 != "") { if (txtp8.Text == ObjCMDB.Param8) { objcmdb.Param8 = txtp8.Text.ToString(); } else { objcmdb.Param8 = txtp8.Text.ToString(); Objcmdbtrans.Currentvalue = txtp8.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param8; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param8; Objcmdbtrans.Insert(); } } else { objcmdb.Param8 = ObjCMDB.Param8; } if (ObjConfigurableitem.Param9 != "") { if (txtp8.Text == ObjCMDB.Param9) { objcmdb.Param9 = txtp9.Text.ToString(); } else { objcmdb.Param9 = txtp9.Text.ToString(); Objcmdbtrans.Currentvalue = txtp9.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param9; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param9; Objcmdbtrans.Insert(); } } else { objcmdb.Param9 = ObjCMDB.Param9; } if (ObjConfigurableitem.Param10 != "") { if (txtp10.Text == ObjCMDB.Param10) { objcmdb.Param10 = txtp10.Text.ToString(); } else { objcmdb.Param10 = txtp10.Text.ToString(); Objcmdbtrans.Currentvalue = txtp10.Text.ToString(); Objcmdbtrans.Previousvalue = ObjCMDB.Param10; Objcmdbtrans.Assetid = ObjConfiguration.Assetid; Objcmdbtrans.Parametername = ObjConfigurableitem.Param10; Objcmdbtrans.Insert(); } } else { objcmdb.Param10 = ObjCMDB.Param10; } objcmdb.Update(); Configuration_mst obj = new Configuration_mst(); obj.Assetid = ObjConfiguration.Assetid; obj.Vendorid = ObjConfiguration.Vendorid; obj.Itemid = ObjConfiguration.Itemid; obj.Serialno = ObjConfiguration.Serialno; int versionno = ObjConfiguration.Version; versionno = versionno + 1; obj.Version = versionno; obj.Siteid = ObjConfiguration.Siteid; obj.Severity = ObjConfiguration.Severity; obj.Purchasedate = ObjConfiguration.Purchasedate; obj.Update(); Session["CMDBUpdate"] = "true"; string myScript; //myScript = "<script language=javascript>javascript:window.close();</script>"; ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshParent();", "refreshParent();", true); // Page.RegisterClientScriptBlock("MyScript", myScript); }
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(); } }
public DataProvider() { _dbContext = new CMDB(); }
public int Update_CMDB_mst_By_id(CMDB ObjCMDB) { return (int)ExecuteNonQuery(Sp_CMDB_Update, new object[] { ObjCMDB.Assetid, ObjCMDB.Param1, ObjCMDB.Param2, ObjCMDB.Param3, ObjCMDB.Param4, ObjCMDB.Param5, ObjCMDB.Param6, ObjCMDB.Param7, ObjCMDB.Param8, ObjCMDB.Param9, ObjCMDB.Param10, ObjCMDB.Param11, ObjCMDB.Param12, ObjCMDB.Param13, ObjCMDB.Param14, ObjCMDB.Param15 }); }
public int Insert_CMDB_mst(CMDB ObjCMDB) { return (int)ExecuteNonQuery(Sp_CMDB_Insert, new object[] { ObjCMDB.Assetid, ObjCMDB.Param1, ObjCMDB.Param2, ObjCMDB.Param3, ObjCMDB.Param4, ObjCMDB.Param5, ObjCMDB.Param6, ObjCMDB.Param7, ObjCMDB.Param8, ObjCMDB.Param9, ObjCMDB.Param10, ObjCMDB.Param11, ObjCMDB.Param12, ObjCMDB.Param13, ObjCMDB.Param14, ObjCMDB.Param15 }); }
public object GenerateCMDBAsset_Byid_mstObject(ref IDataReader returnData) { CMDB Obj = new CMDB(); while (returnData.Read()) { Obj.Assetid = (int)returnData["Assetid"]; if (returnData["Param1"] != DBNull.Value) { Obj.Param1 = (string)returnData["Param1"]; } if (returnData["Param2"] != DBNull.Value) { Obj.Param2 = (string)returnData["Param2"]; } if (returnData["Param3"] != DBNull.Value) { Obj.Param3 = (string)returnData["Param3"]; } if (returnData["Param4"] != DBNull.Value) { Obj.Param4 = (string)returnData["Param4"]; } if (returnData["Param5"] != DBNull.Value) { Obj.Param5 = (string)returnData["Param5"]; } if (returnData["Param6"] != DBNull.Value) { Obj.Param6 = (string)returnData["Param6"]; } if (returnData["Param7"] != DBNull.Value) { Obj.Param7 = (string)returnData["Param7"]; } if (returnData["Param8"] != DBNull.Value) { Obj.Param8 = (string)returnData["Param8"]; } if (returnData["Param9"] != DBNull.Value) { Obj.Param9 = (string)returnData["Param9"]; } if (returnData["Param10"] != DBNull.Value) { Obj.Param10 = (string)returnData["Param10"]; } if (returnData["Param11"] != DBNull.Value) { Obj.Param11 = (string)returnData["Param11"]; } if (returnData["Param12"] != DBNull.Value) { Obj.Param12 = (string)returnData["Param12"]; } if (returnData["Param13"] != DBNull.Value) { Obj.Param13 = (string)returnData["Param13"]; } if (returnData["Param14"] != DBNull.Value) { Obj.Param14 = (string)returnData["Param14"]; } if (returnData["Param15"] != DBNull.Value) { Obj.Param15 = (string)returnData["Param15"]; } } returnData.Close(); returnData.Dispose(); return Obj; }