/// <summary> /// To Update Budget Sub Item /// </summary> /// <param name="LivBudgItemBOobj"></param> /// <returns></returns> public string UpdateBudgetSubItem(LivBudgItemBO LivBudgItemBOobj) { cnn = new OracleConnection(con); string returnResult = ""; proc = "USP_MST_UPD_LIVBUDCATG_ITEM"; cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Connection.Open(); cmd.Parameters.Add("LIV_BUD_ITEMID_", LivBudgItemBOobj.LIV_BUD_ITEMID); cmd.Parameters.Add("LIV_BUD_CATEGID_", LivBudgItemBOobj.LIV_BUD_CATEGID); cmd.Parameters.Add("LIV_BUD_ITEMNAME_", LivBudgItemBOobj.LIV_BUD_ITEMNAME); cmd.Parameters.Add("LIV_BUD_ITEMDESC_", LivBudgItemBOobj.LIV_BUD_ITEMDESC); cmd.Parameters.Add("UPDATEDBY_", LivBudgItemBOobj.UPDATEDBY); cmd.Parameters.Add("ERRORMESSAGE_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); if (cmd.Parameters["ERRORMESSAGE_"].Value != null) { returnResult = cmd.Parameters["ERRORMESSAGE_"].Value.ToString(); } cmd.Connection.Close(); return(returnResult); }
/// <summary> /// To fetch details from database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GetBudgetItem() { LivBudgCategoryBLL LivBudgCategoryBLLobj = new LivBudgCategoryBLL(); LivBudgItemBO LivBudgItemBOobj = LivBudgCategoryBLLobj.GetBudgetSubItemByID(Convert.ToInt32(ViewState["LIV_BUD_ITEMID"])); if (LivBudgItemBOobj != null) { txtBudCategory.Text = LivBudgItemBOobj.LIV_BUD_ITEMNAME; } txtBudgetItem.Text = LivBudgItemBOobj.LIV_BUD_ITEMDESC; LivBudgItemBOobj = null; LivBudgCategoryBLLobj = null; }
/// <summary> /// To Get All Budget Sub Items /// </summary> /// <param name="ItemId"></param> /// <returns></returns> public List <LivBudgItemBO> GetAllBudgetSubItems(int ItemId) { proc = "USP_GET_ALL_MST_LIVCATG_ITEM"; cnn = new OracleConnection(con); LivBudgItemBO LivBudgItemBOobj = null; List <LivBudgItemBO> LivBudgItemlist = new List <LivBudgItemBO>(); cmd = new OracleCommand(proc, cnn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("LIV_BUD_CATEGID_", ItemId); cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output; try { cmd.Connection.Open(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { LivBudgItemBOobj = new LivBudgItemBO(); if (!dr.IsDBNull(dr.GetOrdinal("LIV_BUD_ITEMID"))) { LivBudgItemBOobj.LIV_BUD_ITEMID = dr.GetInt32(dr.GetOrdinal("LIV_BUD_ITEMID")); } if (!dr.IsDBNull(dr.GetOrdinal("LIV_BUD_ITEMNAME"))) { LivBudgItemBOobj.LIV_BUD_ITEMNAME = dr.GetString(dr.GetOrdinal("LIV_BUD_ITEMNAME")); } if (!dr.IsDBNull(dr.GetOrdinal("LIV_BUD_ITEMDESC"))) { LivBudgItemBOobj.LIV_BUD_ITEMDESC = dr.GetString(dr.GetOrdinal("LIV_BUD_ITEMDESC")); } if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED"))) { LivBudgItemBOobj.ISDELETED = dr.GetString(dr.GetOrdinal("ISDELETED")); } LivBudgItemlist.Add(LivBudgItemBOobj); } dr.Close(); } catch (Exception ex) { throw ex; } return(LivBudgItemlist); }
/// <summary> /// To update details to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UpdateBudgetItem() { LivBudgCategoryBLL LivBudgCategoryBLLobj = new LivBudgCategoryBLL(); LivBudgItemBO LivBudgItemBOobj = new LivBudgItemBO(); string message = ""; try { if (ViewState["LIV_BUD_ITEMID"] != null) { LivBudgItemBOobj.LIV_BUD_ITEMID = Convert.ToInt32(ViewState["LIV_BUD_ITEMID"].ToString()); } string uID = string.Empty; uID = Session["USER_ID"].ToString(); LivBudgItemBOobj.LIV_BUD_CATEGID = Convert.ToInt32(ViewState["CATEGORY_ID"]); LivBudgItemBOobj.LIV_BUD_ITEMNAME = txtBudCategory.Text.Trim(); LivBudgItemBOobj.LIV_BUD_ITEMDESC = txtBudgetItem.Text.Trim(); LivBudgItemBOobj.UPDATEDBY = Convert.ToInt32(uID); message = LivBudgCategoryBLLobj.UpdateBudgetSubItem(LivBudgItemBOobj); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data updated successfully"; } ClearData(); SetUpdateMode(false); BindGrid(); if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Updated", "alert('" + message + "');", true); } } catch (Exception ex) { throw ex; } finally { LivBudgCategoryBLLobj = null; } }
/// <summary> /// To save details to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SaveBudgetItem() { LivBudgCategoryBLL LivBudgCategoryBLLobj = new LivBudgCategoryBLL(); LivBudgItemBO LivBudgItemBOobj = new LivBudgItemBO(); string message = ""; string Tribe = string.Empty; string uID = string.Empty; uID = Session["USER_ID"].ToString(); LivBudgItemBOobj.LIV_BUD_CATEGID = Convert.ToInt32(ViewState["LIV_BUD_CATEGID"]); LivBudgItemBOobj.LIV_BUD_ITEMNAME = txtBudCategory.Text.Trim(); LivBudgItemBOobj.LIV_BUD_ITEMDESC = txtBudgetItem.Text.Trim(); LivBudgItemBOobj.CREATEDBY = Convert.ToInt32(uID); try { message = LivBudgCategoryBLLobj.InsertBudgetSubItem(LivBudgItemBOobj); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data saved successfully"; } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } ClearData(); BindGrid(); } catch (Exception ee) { throw ee; } finally { LivBudgCategoryBLLobj = null; } }
/// <summary> /// To Update Budget Sub Item /// </summary> /// <param name="LivBudgItemBOobj"></param> /// <returns></returns> public string UpdateBudgetSubItem(LivBudgItemBO LivBudgItemBOobj) { return((new LivBudgCategoryDAL()).UpdateBudgetSubItem(LivBudgItemBOobj)); }
/// <summary> /// To Insert Budget Sub Item /// </summary> /// <param name="LivBudgItemBOobj"></param> /// <returns></returns> public string InsertBudgetSubItem(LivBudgItemBO LivBudgItemBOobj) { return((new LivBudgCategoryDAL()).InsertBudgetSubItem(LivBudgItemBOobj)); }