protected void btnAddAsset_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { foreach (GridViewRow gv in grdvwViewAsset.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { ListItem item = new ListItem(); int varSiteid; int FlagCheckAsset = 0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("assetid")).Text.ToString(); ObjConfigurationmst = ObjConfigurationmst.Get_By_id(Convert.ToInt32(gvIDs)); item.Text = ObjConfigurationmst.Serialno; item.Value = ObjConfigurationmst.Assetid.ToString(); for (int i = listAsset.Items.Count - 1; i >= 0; i--) { if (Convert.ToInt32(listAsset.Items[i].Value) == ObjConfigurationmst.Assetid) { FlagCheckAsset = 1; } } if (FlagCheckAsset == 0) { listAsset.Items.Add(item); } } } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnAddAsset_Click(object sender, EventArgs e) {//Add Exception handilng try catch change by vishal 21-05-2012 try { foreach (GridViewRow gv in grdvwViewAsset.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { ListItem item = new ListItem(); int varSiteid; int FlagCheckAsset = 0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("assetid")).Text.ToString(); ObjConfigurationmst = ObjConfigurationmst.Get_By_id(Convert.ToInt32(gvIDs)); item.Text = ObjConfigurationmst.Serialno; item.Value = ObjConfigurationmst.Assetid.ToString(); for (int i = listAsset.Items.Count - 1; i >= 0; i--) { if (Convert.ToInt32(listAsset.Items[i].Value) == ObjConfigurationmst.Assetid) { FlagCheckAsset = 1; } } if (FlagCheckAsset == 0) { listAsset.Items.Add(item); } } } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnAddAsset_Click(object sender, EventArgs e) { foreach (GridViewRow gv in grdvwViewAsset.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { ListItem item = new ListItem(); int varSiteid; int FlagCheckAsset = 0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("assetid")).Text.ToString(); ObjConfigurationmst = ObjConfigurationmst.Get_By_id(Convert.ToInt16(gvIDs)); item.Text = ObjConfigurationmst.Serialno; item.Value = ObjConfigurationmst.Assetid.ToString(); for (int i = listAsset.Items.Count - 1; i >= 0; i--) { if (Convert.ToInt16(listAsset.Items[i].Value) == ObjConfigurationmst.Assetid) { FlagCheckAsset = 1; } } if (FlagCheckAsset == 0) { listAsset.Items.Add(item); } } } }
protected void btnAddAsset_Click(object sender, EventArgs e) { foreach (GridViewRow gv in grdvwViewAsset.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { ListItem item = new ListItem(); int varSiteid; int FlagCheckAsset = 0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("assetid")).Text.ToString(); ObjConfigurationmst = ObjConfigurationmst.Get_By_id(Convert.ToInt16(gvIDs)); item.Text = ObjConfigurationmst.Serialno; item.Value =ObjConfigurationmst.Assetid.ToString(); for (int i = listAsset.Items.Count - 1; i >= 0; i--) { if (Convert.ToInt16(listAsset.Items[i].Value) == ObjConfigurationmst.Assetid) { FlagCheckAsset = 1; } } if (FlagCheckAsset == 0) { listAsset.Items.Add(item); } } } }
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"] = ""; }
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 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 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 BindListBox() { //drpCategory.SelectedValue=Session["Category"].ToString(); /// BindDropSubCategory(); Configuration_mst ObjAsset = new Configuration_mst(); BLLCollection<Configuration_mst> col = new BLLCollection<Configuration_mst>(); string varAsset = Session["AssetContract"].ToString(); string[] arrAsset = varAsset.Split(','); int FlagCount = arrAsset.Length; for (int i = 0; i < FlagCount; i++) { if (arrAsset[i] != "," && arrAsset[i] != "") { Configuration_mst obj = new Configuration_mst(); //obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString())); obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString())); col.Add(obj); } } ListAsset.DataTextField = "Serialno"; ListAsset.DataValueField = "assetid"; ListAsset.DataSource = col; ListAsset.DataBind(); for (int i = ListAsset.Items.Count - 1; i >= 0; i--) { ListAsset.Items[i].Selected = true; } Session["AssetContract"] = ""; //drpSubcategory.SelectedValue = Session["Subcategory"].ToString(); //drpchangetype.SelectedValue = Session["ChangeType"].ToString(); //drpStatus.SelectedValue = Session["Status"].ToString(); }
protected void BindListBox() { Configuration_mst ObjAsset = new Configuration_mst(); BLLCollection<Configuration_mst> col = new BLLCollection<Configuration_mst>(); string varAsset = Session["AssetContract"].ToString(); string[] arrAsset = varAsset.Split(','); int FlagCount = arrAsset.Length; for (int i = 0; i < FlagCount; i++) { if (arrAsset[i] != "," && arrAsset[i] != "") { Configuration_mst obj = new Configuration_mst(); obj = ObjAsset.Get_By_id(Convert.ToInt32(arrAsset[i].ToString())); col.Add(obj); } } lstassetupdate.DataTextField = "Serialno"; lstassetupdate.DataValueField = "assetid"; lstassetupdate.DataSource = col; lstassetupdate.DataBind(); for (int i = lstassetupdate.Items.Count - 1; i >= 0; i--) { lstassetupdate.Items[i].Selected = true; } Session["AssetContract"] = ""; panaleditchange.Visible = true; pan1.Visible = false; editpanal(); }
public CollectionBase GenerateConfiguration_mstCollection(ref IDataReader returnData) { BLLCollection<Configuration_mst> col = new BLLCollection<Configuration_mst>(); while (returnData.Read()) { Configuration_mst obj = new Configuration_mst(); obj.Assetid = (int)returnData["Assetid"]; obj.Serialno = (string)returnData["Serialno"]; obj.Itemid = (int)returnData["Itemid"]; obj.Vendorid = (int)returnData["VendorId"]; obj.Version = (int)returnData["Version"]; if (returnData["Warranty"] != DBNull.Value) { obj.Warranty = (string)returnData["Warranty"]; } obj.Siteid = (int)returnData["Siteid"]; obj.Severity = (string)returnData["Severity"]; if (returnData["PurchaseDate"] != DBNull.Value) { DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["PurchaseDate"]; obj.Purchasedate = Mydatetime.ToString(); } col.Add(obj); } returnData.Close(); returnData.Dispose(); return col; }
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 object GenerateCMDBAsset_mstObject(ref IDataReader returnData) { Configuration_mst obj = new Configuration_mst(); while (returnData.Read()) { obj.Assetid = (int)returnData["Assetid"]; obj.Serialno = (string)returnData["Serialno"]; obj.Itemid = (int)returnData["Itemid"]; obj.Vendorid = (int)returnData["VendorId"]; obj.Version = (int)returnData["Version"]; if (returnData["Warranty"] != DBNull.Value) { obj.Warranty = (string)returnData["Warranty"]; } obj.Siteid = (int)returnData["Siteid"]; obj.Severity = (string)returnData["Severity"]; if (returnData["PurchaseDate"] != DBNull.Value) { DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["PurchaseDate"]; obj.Purchasedate = Mydatetime.ToString(); } } returnData.Close(); returnData.Dispose(); return obj; }
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 btnApprove_Click(object sender, EventArgs e) { ObjChangeApproveTrans.Changeid =Convert.ToInt16(Request.QueryString[0]); ObjChangeApproveTrans.Approvalcomment = txtcomment.Text.ToString(); ObjChangeApproveTrans.ApproverName =Request.QueryString[1]; int changestatusid=Objchangestatus.Get_By_StatusName(Resources.MessageResource.StrApproved); ObjChangeApproveTrans.Approvestatus=changestatusid; ObjChangeApproveTrans.Insert(); Change_mst Obj = new Change_mst(); Obj=Obj.Get_By_id(Convert.ToInt16(Request.QueryString[0])); ObjChange.Statusid = changestatusid; ObjChange.Changeid = Convert.ToInt16(Request.QueryString[0]); ObjChange.Active =true; ObjChange.Assignetime = Obj.Assignetime; ObjChange.Categoryid =Obj.Categoryid ; ObjChange.Changetype = Obj.Changetype; ObjChange.Subcategoryid = Obj.Subcategoryid; ObjChange.Technician = Obj.Technician; ObjChange.Title = Obj.Title; //ObjChange.Completedtime = ""; ObjChange.CreatedByID = Obj.CreatedByID; ObjChange.Description = Obj.Description; ObjChange.Priority = Obj.Priority; ObjChange.Requestedby = Obj.Requestedby; ObjChange.Sceduledstarttime = Obj.Sceduledstarttime; ObjChange.Sceduledendtime = Obj.Sceduledendtime; ObjChange.Approvalstatus = Obj.Approvalstatus; ObjChange.Impact = Obj.Impact; ObjChange.Update(); Change_mst ObjNewChange = new Change_mst(); ObjNewChange = ObjNewChange.Get_By_id(Convert.ToInt16(Request.QueryString[0])); string approvalrequest=Resources.MessageResource.StrApproved.ToString(); int modeid = ObjMode.Get_Mode_By_Mname("Email"); if(approvalrequest=="Approved") { BLLCollection<Incident_To_Change> colIncToChng = new BLLCollection<Incident_To_Change>(); colIncToChng=Objincidenttochange.Get_All_By_Changeid(ObjNewChange.Changeid); int FlagStatus=0; foreach (Incident_To_Change obj in colIncToChng) { FlagStatus = FlagStatus + 1; } if (FlagStatus == 0) { string statusname = Resources.MessageResource.strStatusOpen.ToString(); int statusid = Convert.ToInt16(Objstatus.Get_By_StatusName(statusname)); Objincludeassetinchange = Objincludeassetinchange.Get_By_Changeid(ObjNewChange.Changeid); Objconfiguration = Objconfiguration.Get_By_id(Objincludeassetinchange.Assetid); int priorityid = Convert.ToInt16(Objconfiguration.Severity); Incident_mst Objincident = new Incident_mst(); int slaid = Objincident.Get_By_SLAid(Objconfiguration.Siteid, priorityid); Objincident.Requesterid = ObjNewChange.Requestedby; Objincident.Title = ObjNewChange.Title; Objincident.Siteid = Objconfiguration.Siteid; Objincident.Createdbyid = ObjNewChange.CreatedByID; Objincident.Slaid = Convert.ToInt16(slaid); Objincident.Modeid = modeid; Objincident.Insert(); int incidentid = Objincident.Get_Current_Incidentid(); IncidentStates Objincidentstattes = new IncidentStates(); Objincidentstattes.Incidentid = incidentid; Objincidentstattes.Priorityid = Convert.ToInt16(Objconfiguration.Severity); Objincidentstattes.Subcategoryid = ObjNewChange.Subcategoryid; Objincidentstattes.Categoryid = ObjNewChange.Categoryid; Objincidentstattes.Statusid = statusid; Objincidentstattes.Requesttypeid = 2; Objincidentstattes.Insert(); objincidenthistory.Incidentid = incidentid; objincidenthistory.Operation = "create"; objincidenthistory.Operationownerid = ObjNewChange.CreatedByID; objincidenthistory.Insert(); Objincidenttochange.Changeid = ObjNewChange.Changeid; Objincidenttochange.Incidentid = incidentid; Objincidenttochange.Insert(); string myScript; myScript = "<script language=javascript>CloseWindow();</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); } } }
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(); }
public int Update_Configuration_mst_By_id(Configuration_mst ObjConfiguration) { return (int)ExecuteNonQuery(Sp_Configuration_Update, new object[] { ObjConfiguration.Assetid, ObjConfiguration.Vendorid, ObjConfiguration.Itemid, ObjConfiguration.Version, ObjConfiguration.Serialno, ObjConfiguration.Siteid, ObjConfiguration.Purchasedate, ObjConfiguration.Severity }); }
public int Insert_Configuration_mst(Configuration_mst ObjConfigurationmst) { return (int)ExecuteNonQuery(Sp_Configuration_Insert, new object[] { ObjConfigurationmst.Itemid, ObjConfigurationmst.Purchasedate, ObjConfigurationmst.Serialno, ObjConfigurationmst.Severity, ObjConfigurationmst.Siteid, ObjConfigurationmst.Vendorid, }); }