protected void btnupdateBackOutPlan_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 = "BackOutPlanChanged"; 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 ObjChangeBackOutPlan = ObjChangeBackOutPlan.Get_By_id(ObjChange.Changeid); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjChangeBackOutPlan.Descripion); curnt_value = Convert.ToString(EditorBackOutPlan.Text); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = "Description"; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); #endregion ObjChangeBackOutPlan.Changeid = changeid; ObjChangeBackOutPlan.Descripion = EditorBackOutPlan.Text.ToString(); ObjChangeBackOutPlan.Update(); ShowBackOutPlanPlaceholder(); btnupdateBackOutPlan.Visible = false; btncancellBackOutPlan.Visible = false; btncancellBackOutPlan.Visible = false; EditorBackOutPlan.Visible = false; lnkBackOutPlanadd.Visible = false; lnkBackOutPlanedit.Visible = true; ShowBackOutPlanPlaceholder(); ShowImpactPlaceholder(); ShowRollOutPlanPlaceholder(); } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnupdateBackOutPlan_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 = "BackOutPlanChanged"; 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 ObjChangeBackOutPlan = ObjChangeBackOutPlan.Get_By_id(ObjChange.Changeid); #endregion #region Insert the values in history difference table prev_value = Convert.ToString(ObjChangeBackOutPlan.Descripion); curnt_value = Convert.ToString(EditorBackOutPlan.Text); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = "Description"; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); #endregion ObjChangeBackOutPlan.Changeid = changeid; ObjChangeBackOutPlan.Descripion = EditorBackOutPlan.Text.ToString(); ObjChangeBackOutPlan.Update(); ShowBackOutPlanPlaceholder(); btnupdateBackOutPlan.Visible = false; btncancellBackOutPlan.Visible = false; btncancellBackOutPlan.Visible = false; EditorBackOutPlan.Visible = false; lnkBackOutPlanadd.Visible = false; lnkBackOutPlanedit.Visible = true; ShowBackOutPlanPlaceholder(); ShowImpactPlaceholder(); ShowRollOutPlanPlaceholder(); }