//Dropdown Account Name public ActionResult GetDynamicAccountName(int BankID) { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); var Acronym = ""; foreach (var item in TOSSDB.BankAccountTables.Where(a => a.BankID == BankID).ToList()) { for (var i = 0; i < item.SubFund.Fund.FundName.Length;) { if (i == 0) { Acronym += item.SubFund.Fund.FundName[i].ToString(); } else if (item.SubFund.Fund.FundName[i] == ' ') { Acronym += item.SubFund.Fund.FundName[i + 1].ToString(); } i++; } model.globalClasses.BankAccDDs.Add(new BankAccDD { BankAccountID = item.BankAccountID, AccountNo = item.AccountNo + " - (" + Acronym + " - " + item.SubFund.SubFundName + ")", }); Acronym = ""; } model.CheckInventoryAccountNameList = new SelectList(model.globalClasses.BankAccDDs.ToList(), "BankAccountID", "AccountNo"); //model.CheckInventoryAccountNameList = new SelectList((from s in TOSSDB.BankAccountTables.ToList() where s.BankID == BankID select new { BankAccountID = s.BankAccountID, AccountNo = s.AccountNo + " - (" + Acronym + " - " + s.SubFund.SubFundName + ")" }), "BankAccountID", "AccountNo"); //model.CheckInventoryAccountNameList = new SelectList(TOSSDB.BankAccountTables.Where(a=>a.BankID == BankID).ToList(), "SubFundID", "FundName"); return(PartialView("CheckInventory/_DynamicDDAccountName", model)); }
//Table Internal Revenue Allotment public ActionResult Get_CheckInventoryTable() { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); List <CheckInventoryList> tbl_CheckInventory = new List <CheckInventoryList>(); var SQLQuery = "SELECT * FROM DB_TOSS.dbo.CheckInventoryTable,dbo.BankAccountTable,dbo.BankTable where dbo.BankAccountTable.BankAccountID = dbo.CheckInventoryTable.BankAccountID and dbo.BankTable.BankID = dbo.BankAccountTable.BankID"; //SQLQuery += " WHERE (IsActive != 0)"; using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString())) { Connection.Open(); using (SqlCommand command = new SqlCommand("[dbo].[SP_CheckInventoryList]", Connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery)); SqlDataReader dr = command.ExecuteReader(); while (dr.Read()) { tbl_CheckInventory.Add(new CheckInventoryList() { CheckInvntID = GlobalFunction.ReturnEmptyInt(dr[0]), Bank = GlobalFunction.ReturnEmptyString(dr[17]), AccountName = GlobalFunction.ReturnEmptyString(dr[11]), Quantity = GlobalFunction.ReturnEmptyInt(dr[3]), StartingChckNo = GlobalFunction.ReturnEmptyInt(dr[4]), EndingChckNo = GlobalFunction.ReturnEmptyInt(dr[5]), Date = Convert.ToDateTime(dr[6]), }); } } Connection.Close(); } model.getCheckInventoryList = tbl_CheckInventory.ToList(); return(PartialView("CheckInventory/_CheckInventoryTable", model.getCheckInventoryList)); }
//Check Inventory #region //Dropdown Account Name public ActionResult GetDynamicBankName() { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); model.CheckInventoryAccountNameList = new SelectList((from s in TOSSDB.BankTables.ToList() select new { BankID = s.BankID, BankName = s.BankName }), "BankID", "BankName"); return(PartialView("CheckInventory/_DynamicDDBankName", model)); }
//Check Inventory #region //Dropdown Account Name public ActionResult GetDynamicAccountName(int BankAccountID) { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); model.CheckInventoryAccountNameList = new SelectList((from s in TOSSDB.BankAccountTables.ToList() where s.BankID == BankAccountID select new { BankAccountID = s.BankAccountID, AccountNo = s.AccountNo /*+ "- ("+ s.FundType_FundName.FundTitle +")"*/ }), "BankAccountID", "AccountNo"); return(PartialView("CheckInventory/_DynamicDDAccountName", model)); }
//Delete DVType public ActionResult DeleteCheckInventory(FM_Disbursement_CheckInventory model, int CheckInvntID) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == CheckInvntID select e).FirstOrDefault(); TOSSDB.CheckInventoryTables.Remove(tblCheckIventory); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }
//Update DVType public ActionResult UpdateCheckInventory(FM_Disbursement_CheckInventory model) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == model.getCheckInventorycolumns.CheckInvntID select e).FirstOrDefault(); tblCheckIventory.BankAccountID = model.CheckInventoryAccountNameID; tblCheckIventory.Quantity = model.getCheckInventorycolumns.Quantity; tblCheckIventory.StartingChckNo = model.getCheckInventorycolumns.StartingChckNo; tblCheckIventory.EndingChckNo = model.getCheckInventorycolumns.EndingChckNo; tblCheckIventory.DateIssued = model.getCheckInventorycolumns.DateIssued; TOSSDB.Entry(tblCheckIventory); TOSSDB.SaveChanges(); return(PartialView("CheckInventory/_UpdateCheckInventory", model)); }
//Get Update DVType public ActionResult Get_UpdateCheckInventory(FM_Disbursement_CheckInventory model, int CheckInvntID) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == CheckInvntID select e).FirstOrDefault(); model.getCheckInventorycolumns.CheckInvntID = tblCheckIventory.CheckInvntID; model.CheckInventoryBankTempID = tblCheckIventory.BankAccountTable.BankID; model.CheckInventoryAccountNameTempID = tblCheckIventory.BankAccountID; model.getCheckInventorycolumns.Quantity = tblCheckIventory.Quantity; model.getCheckInventorycolumns.StartingChckNo = tblCheckIventory.StartingChckNo; model.getCheckInventorycolumns.EndingChckNo = tblCheckIventory.EndingChckNo; model.getCheckInventorycolumns.DateIssued = tblCheckIventory.DateIssued; return(PartialView("CheckInventory/_UpdateCheckInventory", model)); }
//Add DVType public JsonResult AddCheckInventory(FM_Disbursement_CheckInventory model) { CheckInventoryTable tblCheckInventory = new CheckInventoryTable(); tblCheckInventory.BankAccountID = model.CheckInventoryAccountNameID; tblCheckInventory.Quantity = model.getCheckInventorycolumns.Quantity; tblCheckInventory.StartingChckNo = model.getCheckInventorycolumns.StartingChckNo; tblCheckInventory.EndingChckNo = model.getCheckInventorycolumns.EndingChckNo; tblCheckInventory.DateIssued = model.getCheckInventorycolumns.DateIssued; tblCheckInventory.IsIssued = false; TOSSDB.CheckInventoryTables.Add(tblCheckInventory); TOSSDB.SaveChanges(); return(Json(tblCheckInventory)); }
public ActionResult CheckInventoryTab() { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); return(PartialView("CheckInventory/CheckInventoryIndex", model)); }
//Get Add DVType Partial View public ActionResult Get_AddCheckInventory() { FM_Disbursement_CheckInventory model = new FM_Disbursement_CheckInventory(); return(PartialView("CheckInventory/_AddCheckInventory", model)); }