protected void btnupdateRollOutPlan_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { string prev_value; string curnt_value; int historyid; int changeid = Convert.ToInt32(Request.QueryString[0]); #region For updating values in Problem history table ObjChangeHistory.Changeid = changeid; MembershipUser User = Membership.GetUser(); string username = User.UserName.ToString(); Objorganization = Objorganization.Get_Organization(); int userid = ObjUser.Get_By_UserName(username, Objorganization.Orgid); ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "RollOutPlanUpdated"; ObjChangeHistory.Insert(); #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() historyid = ObjChangeHistory.Get_Current_ChangeHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjChange = ObjChange.Get_By_id(changeid); #endregion #region Find the value of current symptom ObjChangeRollOutPlan = ObjChangeRollOutPlan.Get_By_id(ObjChange.Changeid); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjChangeRollOutPlan.Description); curnt_value = Convert.ToString(EditorRollOutPlan.Text); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = "Description"; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); #endregion ObjChangeRollOutPlan.Changeid = changeid; ObjChangeRollOutPlan.Description = EditorRollOutPlan.Text.ToString(); ObjChangeRollOutPlan.Update(); ShowRollOutPlanPlaceholder(); btnupdateRollOutPlan.Visible = false; btnsaveRollOutPlan.Visible = false; btncancellRollOutPlan.Visible = false; EditorRollOutPlan.Visible = false; lnkRollOutPlanedit.Visible = true; lnkRollOutPlanadd.Visible = false; ShowImpactPlaceholder(); ShowBackOutPlanPlaceholder(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnupdateRollOutPlan_Click(object sender, EventArgs e) { string prev_value; string curnt_value; int historyid; int changeid = Convert.ToInt16(Request.QueryString[0]); #region For updating values in Problem history table ObjChangeHistory.Changeid = changeid; MembershipUser User = Membership.GetUser(); string username = User.UserName.ToString(); Objorganization = Objorganization.Get_Organization(); int userid = ObjUser.Get_By_UserName(username, Objorganization.Orgid); ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "RollOutPlanUpdated"; ObjChangeHistory.Insert(); #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() historyid = ObjChangeHistory.Get_Current_ChangeHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjChange = ObjChange.Get_By_id(changeid); #endregion #region Find the value of current symptom ObjChangeRollOutPlan = ObjChangeRollOutPlan.Get_By_id(ObjChange.Changeid); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjChangeRollOutPlan.Description); curnt_value = Convert.ToString(EditorRollOutPlan.Text); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = "Description"; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); #endregion ObjChangeRollOutPlan.Changeid = changeid; ObjChangeRollOutPlan.Description = EditorRollOutPlan.Text.ToString(); ObjChangeRollOutPlan.Update(); ShowRollOutPlanPlaceholder(); btnupdateRollOutPlan.Visible = false; btnsaveRollOutPlan.Visible = false; btncancellRollOutPlan.Visible = false; EditorRollOutPlan.Visible = false; lnkRollOutPlanedit.Visible = true; lnkRollOutPlanadd.Visible = false; ShowImpactPlaceholder(); ShowBackOutPlanPlaceholder(); }