//Table Internal Revenue Allotment public ActionResult Get_InternalRevenueAllotmentTable() { FM_GeneralReference_IRA model = new FM_GeneralReference_IRA(); List <IRAList> tbl_IRA = new List <IRAList>(); var SQLQuery = "SELECT * FROM DB_TOSS.dbo.IRA_Table"; //SQLQuery += " WHERE (IsActive != 0)"; using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString())) { Connection.Open(); using (SqlCommand command = new SqlCommand("[dbo].[SP_IRAList]", Connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery)); SqlDataReader dr = command.ExecuteReader(); while (dr.Read()) { tbl_IRA.Add(new IRAList() { IRAID = Convert.ToInt32(dr[0]), IRAPercentageShare = GlobalFunction.ReturnEmptyDecimal(dr[1]), IRAPercent = GlobalFunction.ReturnEmptyInt(dr[2]), IRABase = GlobalFunction.ReturnEmptyDecimal(dr[3]), }); } } Connection.Close(); } model.getIRAList = tbl_IRA.ToList(); return(PartialView("IRAShares/_InternalRevenueAllotmentTable", model.getIRAList)); }
//Delete Internal Revenue Allotment public ActionResult DeleteInternalRevenueAllotment(FM_GeneralReference_IRA model, int IRAID) { IRA_Table tblMemoAccount = (from e in TOSSDB.IRA_Table where e.IRAID == IRAID select e).FirstOrDefault(); TOSSDB.IRA_Table.Remove(tblMemoAccount); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }
//Get Update Internal Revenue Allotment public ActionResult Get_UpdateInternalRevenueAllotment(FM_GeneralReference_IRA model, int IRAID) { IRA_Table tblMemoAccount = (from e in TOSSDB.IRA_Table where e.IRAID == IRAID select e).FirstOrDefault(); model.getIRAcolumns.IRAID = tblMemoAccount.IRAID; model.getIRAcolumns.IRAPercentageShare = tblMemoAccount.IRAPercentageShare; model.getIRAcolumns.IRAPercent = tblMemoAccount.IRAPercent; model.getIRAcolumns.IRABase = tblMemoAccount.IRABase; return(PartialView("IRAShares/_UpdateInternalRevenueAllotment", model)); }
//Update Internal Revenue Allotment public ActionResult UpdateInternalRevenueAllotment(FM_GeneralReference_IRA model) { IRA_Table tblMemoAccount = (from e in TOSSDB.IRA_Table where e.IRAID == model.getIRAcolumns.IRAID select e).FirstOrDefault(); tblMemoAccount.IRAPercentageShare = model.getIRAcolumns.IRAPercentageShare; tblMemoAccount.IRAPercent = model.getIRAcolumns.IRAPercent; tblMemoAccount.IRABase = model.getIRAcolumns.IRABase; TOSSDB.Entry(tblMemoAccount); TOSSDB.SaveChanges(); return(PartialView("IRAShares/_UpdateInternalRevenueAllotment", model)); }
//Add Internal Revenue Allotment public JsonResult AddInternalRevenueAllotmentTable(FM_GeneralReference_IRA model) { IRA_Table tblIRA = new IRA_Table(); tblIRA.IRAPercentageShare = model.getIRAcolumns.IRAPercentageShare; tblIRA.IRAPercent = model.getIRAcolumns.IRAPercent; tblIRA.IRABase = model.getIRAcolumns.IRABase; TOSSDB.IRA_Table.Add(tblIRA); TOSSDB.SaveChanges(); return(Json(tblIRA)); }
//Get Add Internal Revenue Allotment Partial View public ActionResult Get_AddInternalRevenueAllotmentTable() { FM_GeneralReference_IRA model = new FM_GeneralReference_IRA(); return(PartialView("IRAShares/_AddInternalRevenueAllotment", model)); }