protected void Impactgrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name, desc, id; int ImpactId; int FlagImpact; name = ((TextBox)Impactgrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtImpactName")).Text; desc = ((TextBox)Impactgrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtImpactdesc")).Text; id = Convert.ToString(Impactgrdvw.Rows[e.RowIndex].Cells[0].Text); ImpactId = Convert.ToInt16(id); ImpactObj = ImpactObj.Get_By_id(ImpactId); if (ImpactObj.Impactname == name) { ImpactObj.Impactname = name; ImpactObj.Description = desc; ImpactObj.Update(); Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else { FlagImpact = ImpactObj.Get_By_ImpactName(name); if ((FlagImpact == 0) && (name != "")) { ImpactObj.Impactname = name; ImpactObj.Description = desc; ImpactObj.Update(); Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else if (name == "") { lblerrmsg.Text = Resources.MessageResource.errnotempty.ToString(); } else { Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errImpactExist.ToString(); } } }
string GetImpactString(int impactid) { string impactname = ""; objImpact = objImpact.Get_By_id(impactid); if (objImpact.Impactid != 0) { impactname = objImpact.Impactname; } return impactname; }
public int Update_Impact_mst_By_id(Impact_mst objImpact) { return (int)ExecuteNonQuery(Sp_Impact_Update, new object[] { objImpact.Impactname, objImpact.Impactid, objImpact.Description }); }
//end public int Insert_Impact_mst(Impact_mst objImpact) { return (int)ExecuteNonQuery(Sp_Impact_Insert, new object[] { objImpact.Impactname, objImpact.Description }); }
public object GenerateImpact_mstObject(ref IDataReader returnData) { Impact_mst obj = new Impact_mst(); while (returnData.Read()) { obj.Impactid = (int)returnData["impactid"]; obj.Impactname = (string)returnData["impactname"]; obj.Description = (string)returnData["description"]; } returnData.Close(); returnData.Dispose(); return obj; }
public CollectionBase GenerateImpact_mstCollection(ref IDataReader returnData) { BLLCollection<Impact_mst> col = new BLLCollection<Impact_mst>(); while (returnData.Read()) { Impact_mst obj = new Impact_mst(); obj.Impactid = (int)returnData["Impactid"]; obj.Impactname = (string)returnData["Impactname"]; obj.Description = (string)returnData["Description"]; col.Add(obj); } returnData.Close(); returnData.Dispose(); return col; }
protected void Impactgrdvw_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name, desc, id; int ImpactId; int FlagImpact; name = ((TextBox)Impactgrdvw.Rows[e.RowIndex].Cells[1].Controls[0].FindControl("txtImpactName")).Text; desc = ((TextBox)Impactgrdvw.Rows[e.RowIndex].Cells[2].Controls[0].FindControl("txtImpactdesc")).Text; id = Convert.ToString(Impactgrdvw.Rows[e.RowIndex].Cells[0].Text); ImpactId = Convert.ToInt16(id); ImpactObj = ImpactObj.Get_By_id(ImpactId); if (ImpactObj.Impactname == name) { ImpactObj.Impactname = name; ImpactObj.Description = desc; ImpactObj.Update(); Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else { FlagImpact = ImpactObj.Get_By_ImpactName(name); if ((FlagImpact == 0)&&(name!="")) { ImpactObj.Impactname = name; ImpactObj.Description = desc; ImpactObj.Update(); Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errupdate.ToString(); } else if(name == "") { lblerrmsg.Text = Resources.MessageResource.errnotempty.ToString(); } else { Impactgrdvw.EditIndex = -1; BindGrid(); lblerrmsg.Text = Resources.MessageResource.errImpactExist.ToString(); } } }