//Table Account Code Partial View public ActionResult Get_AccountCodeTable() { FM_GeneralReference_MemoAccountClass model = new FM_GeneralReference_MemoAccountClass(); List <MMAccountTitleList> tbl_AccountCode = new List <MMAccountTitleList>(); var SQLQuery = "SELECT * FROM DB_TOSS.dbo.MemoAccClass_AccountCode"; //SQLQuery += " WHERE (IsActive != 0)"; using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString())) { Connection.Open(); using (SqlCommand command = new SqlCommand("[dbo].[SP_MMAccountCodeList]", Connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery)); SqlDataReader dr = command.ExecuteReader(); while (dr.Read()) { tbl_AccountCode.Add(new MMAccountTitleList() { AccountCodeID = GlobalFunction.ReturnEmptyInt(dr[0]), AccountCode = GlobalFunction.ReturnEmptyString(dr[1]), AccountTitle = GlobalFunction.ReturnEmptyString(dr[2]), }); } } Connection.Close(); } model.getMMAccountTitleList = tbl_AccountCode.ToList(); return(PartialView("MemoAccountClass/AccountCode/_AccountCodeTable", model.getMMAccountTitleList)); }
//Dropdown Memo Account Revision Year public ActionResult GetDynamicMemoRevisionYear() { FM_GeneralReference_MemoAccountClass model = new FM_GeneralReference_MemoAccountClass(); model.MMRevisionYearList = new SelectList((from s in TOSSDB.MemoAccClass_RevisionYr.ToList() orderby s.RevisionID ascending select new { RevisionID = s.RevisionID, RevisionYear = s.RevisionYear }), "RevisionID", "RevisionYear"); return(PartialView("MemoAccountClass/_DynamicDDRevisionYear", model)); }
//Delete Memo Account public ActionResult DeleteAccountCode(FM_GeneralReference_MemoAccountClass model, int AccountCodeID) { MemoAccClass_AccountCode tblMemoAccount = (from e in TOSSDB.MemoAccClass_AccountCode where e.AccountCodeID == AccountCodeID select e).FirstOrDefault(); TOSSDB.MemoAccClass_AccountCode.Remove(tblMemoAccount); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }
//Get Add Account Code Memo Account Classification Partial View public ActionResult GetSelectedDynamicMemoAccountTitle(int MMAccountTitleIDTempID) { FM_GeneralReference_MemoAccountClass model = new FM_GeneralReference_MemoAccountClass(); model.MMAccountTitleList = new SelectList((from s in TOSSDB.MemoAccClass_AccountCode.ToList() orderby s.AccountCodeID ascending select new { AccountCodeID = s.AccountCodeID, AccountTitle = s.AccountTitle }), "AccountCodeID", "AccountTitle"); model.MMAccountTitleID = MMAccountTitleIDTempID; return(PartialView("MemoAccountClass/_DynamicDDAccountTitle", model)); }
//Get Update Memo Account public ActionResult Get_UpdateAccountCode(FM_GeneralReference_MemoAccountClass model, int AccountCodeID) { MemoAccClass_AccountCode tblMemoAccount = (from e in TOSSDB.MemoAccClass_AccountCode where e.AccountCodeID == AccountCodeID select e).FirstOrDefault(); model.getMMAccountTitleColumns.AccountCodeID = tblMemoAccount.AccountCodeID; model.getMMAccountTitleColumns.AccountTitle = tblMemoAccount.AccountTitle; model.getMMAccountTitleColumns.AccountCode = tblMemoAccount.AccountCode; return(PartialView("MemoAccountClass/AccountCode/_UpdateAccountCode", model)); }
//Get Update Memo Account public ActionResult Get_UpdateMemoAccount(FM_GeneralReference_MemoAccountClass model, int MemoAccClassID) { MemoAccClassTable tblMemoAccount = (from e in TOSSDB.MemoAccClassTables where e.MemoAccClassID == MemoAccClassID select e).FirstOrDefault(); model.MemoAccClassID = tblMemoAccount.MemoAccClassID; model.MMAccountTitleTempID = tblMemoAccount.AccountCodeID; model.MMRevisionYrTempID = tblMemoAccount.RevisionID; return(PartialView("MemoAccountClass/_UpdateMemoAccClass", model)); }
//Update Memo Account public ActionResult UpdateAccountCode(FM_GeneralReference_MemoAccountClass model) { MemoAccClass_AccountCode tblMemoAccount = (from e in TOSSDB.MemoAccClass_AccountCode where e.AccountCodeID == model.getMMAccountTitleColumns.AccountCodeID select e).FirstOrDefault(); tblMemoAccount.AccountCode = model.getMMAccountTitleColumns.AccountCode; tblMemoAccount.AccountTitle = model.getMMAccountTitleColumns.AccountTitle; TOSSDB.Entry(tblMemoAccount); TOSSDB.SaveChanges(); return(PartialView("MemoAccountClass/AccountCode/_UpdateAccountCode", model)); }
//Add Memo Account Classification public JsonResult AddAccountCode(FM_GeneralReference_MemoAccountClass model) { MemoAccClass_AccountCode tblMemoAccountCode = new MemoAccClass_AccountCode(); tblMemoAccountCode.AccountTitle = model.getMMAccountTitleColumns.AccountTitle; tblMemoAccountCode.AccountCode = model.getMMAccountTitleColumns.AccountCode; TOSSDB.MemoAccClass_AccountCode.Add(tblMemoAccountCode); TOSSDB.SaveChanges(); return(Json(tblMemoAccountCode)); }
//Update Memo Account public ActionResult UpdateMemoAccount(FM_GeneralReference_MemoAccountClass model) { MemoAccClassTable tblMemoAccount = (from e in TOSSDB.MemoAccClassTables where e.MemoAccClassID == model.MemoAccClassID select e).FirstOrDefault(); tblMemoAccount.AccountCodeID = model.MMAccountTitleID; tblMemoAccount.RevisionID = model.MMRevisionYrID; TOSSDB.Entry(tblMemoAccount); TOSSDB.SaveChanges(); return(PartialView("MemoAccountClass/_UpdateMemoAccClass", model)); }
//Add Memo Account Classification public JsonResult AddMemoAccClassTable(FM_GeneralReference_MemoAccountClass model) { MemoAccClassTable tblMemoAccount = new MemoAccClassTable(); tblMemoAccount.AccountCodeID = model.MMAccountTitleID; tblMemoAccount.RevisionID = model.MMRevisionYrID; TOSSDB.MemoAccClassTables.Add(tblMemoAccount); TOSSDB.SaveChanges(); return(Json(tblMemoAccount)); }
public ActionResult Get_AddAccountCode() { FM_GeneralReference_MemoAccountClass model = new FM_GeneralReference_MemoAccountClass(); return(PartialView("MemoAccountClass/AccountCode/_AddAccountCode", model)); }