コード例 #1
0
        //Add  Check Maintenance
        public JsonResult AddCheckMaintenance(FM_Disbursement_CheckMaintenance model)
        {
            CheckMaintenanceTable tblCheckMaintenance = new CheckMaintenanceTable();

            tblCheckMaintenance.CheckInvntID  = model.CheckMaintenanceInventoryID;
            tblCheckMaintenance.DateIssued    = model.getCheckMaintenancecolumns.DateIssued;
            tblCheckMaintenance.ConsumedValue = model.CheckMaintenanceQuantityID;
            TOSSDB.CheckMaintenanceTables.Add(tblCheckMaintenance);
            TOSSDB.SaveChanges();

            CheckInventoryTable tblAccountablechkInventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == model.CheckMaintenanceInventoryID select e).FirstOrDefault();

            if (tblAccountablechkInventory.IsIssued == false)
            {
                tblAccountablechkInventory.IsIssued = true;
            }
            else
            {
                tblAccountablechkInventory.IsIssued = false;
            }
            TOSSDB.Entry(tblAccountablechkInventory);
            TOSSDB.SaveChanges();

            return(Json(""));
        }
コード例 #2
0
        //Get Table Check Maintenance
        public ActionResult Get_CheckMaintenanceTable()
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();
            List <CheckMaintenanceList>      tbl_CheckMaintenance = new List <CheckMaintenanceList>();

            var SQLQuery = "SELECT CheckMaintenanceTable.CheckMainteID,CheckMaintenanceTable.CheckInvntID,BankAccountTable.AccountNo,BankTable.BankName,CheckInventoryTable.StartingChckNo,CheckInventoryTable.EndingChckNo ,CheckInventoryTable.Quantity FROM CheckMaintenanceTable,CheckInventoryTable,BankAccountTable,BankTable WHERE CheckInventoryTable.CheckInvntID =CheckMaintenanceTable.CheckInvntID and BankAccountTable.BankAccountID=CheckInventoryTable.BankAccountID and BankTable.BankID=BankAccountTable.BankID";

            //SQLQuery += " WHERE (IsActive != 0)";
            using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString()))
            {
                Connection.Open();
                using (SqlCommand command = new SqlCommand("[dbo].[SP_CheckMaintenanceList]", Connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery));
                    SqlDataReader dr = command.ExecuteReader();
                    while (dr.Read())
                    {
                        tbl_CheckMaintenance.Add(new CheckMaintenanceList()
                        {
                            CheckMainteID  = GlobalFunction.ReturnEmptyInt(dr[0]),
                            Bank           = GlobalFunction.ReturnEmptyString(dr[3]),
                            AccountName    = GlobalFunction.ReturnEmptyString(dr[2]),
                            Quantity       = GlobalFunction.ReturnEmptyInt(dr[6]),
                            StartingChckNo = GlobalFunction.ReturnEmptyInt(dr[4]),
                            EndingChckNo   = GlobalFunction.ReturnEmptyInt(dr[5]),
                        });
                    }
                }
                Connection.Close();
            }
            model.getCheckMaintenanceList = tbl_CheckMaintenance.ToList();
            return(PartialView("CheckMaintenance/_CheckMaintenanceTable", model.getCheckMaintenanceList));
        }
コード例 #3
0
        public ActionResult LoadDynamicCheckMaintenanceInventory(int AccountNameIDDD2)
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            model.CheckMaintenanceInventoryList = new SelectList((from s in TOSSDB.CheckInventoryTables.ToList() where s.IsIssued != true && s.BankAccountID == AccountNameIDDD2 select new { CheckInvntID = s.CheckInvntID, StartingChckNo = s.StartingChckNo }), "CheckInvntID", "StartingChckNo");
            return(PartialView("CheckMaintenance/_DynamicDDStartingCheckNo", model));
        }
コード例 #4
0
        public ActionResult GetSelectedDynamicAccountNameCM(int BankID, int CheckInventoryAccountNameIDTempID)
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();
            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.CheckMaintenanceList          = new SelectList(model.globalClasses.BankAccDDs.ToList(), "BankAccountID", "AccountNo");
            model.CheckMaintenanceAccountNameID = CheckInventoryAccountNameIDTempID;
            return(PartialView("CheckMaintenance/_DynamicDDAccountName2", model));
        }
コード例 #5
0
        //Check Maintenance
        #region
        //Dropdown Account Name
        public ActionResult GetDynamicBankNameCM()
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            model.CheckMaintenanceList = new SelectList((from s in TOSSDB.BankTables.ToList() select new { BankID = s.BankID, BankName = s.BankName }), "BankID", "BankName");
            return(PartialView("CheckMaintenance/_DynamicDDBankName", model));
        }
コード例 #6
0
        //Check Maintenance
        #region
        //Dropdown Account Name
        public ActionResult GetDynamicMaitenance(int BankAccountID)
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            model.CheckMaintenanceAccountNameList = 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("CheckMaintenance/_DynamicDDAccountName2", model));
        }
コード例 #7
0
        //Get Update Check Maintenance
        public ActionResult Get_UpdateCheckMaintenance(FM_Disbursement_CheckMaintenance model, int CheckMainteID)
        {
            CheckMaintenanceTable tblCheckMaintenance = (from e in TOSSDB.CheckMaintenanceTables where e.CheckMainteID == CheckMainteID select e).FirstOrDefault();

            model.getCheckMaintenancecolumns.CheckMainteID = tblCheckMaintenance.CheckMainteID;
            model.CheckMaintenanceBankIDTemp = tblCheckMaintenance.CheckInvntID;
            return(PartialView("CheckMaintenance/_UpdateCheckMaintenance", model));
        }
コード例 #8
0
        public ActionResult Get_CheckMaintenanceQuantyNEnd(int StartingChckNo)
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.StartingChckNo == StartingChckNo select e).FirstOrDefault();

            if (tblCheckIventory != null)
            {
                model.CheckMaintenanceEndingNoID = tblCheckIventory.EndingChckNo;
                model.CheckMaintenanceQuantityID = tblCheckIventory.Quantity;
            }


            return(PartialView("CheckMaintenance/_DynamicTBQuantyNEndNo", model));
        }
コード例 #9
0
        //Update Check Maintenance

        //Delete Check Maintenance
        public ActionResult DeleteCheckMaintenance(FM_Disbursement_CheckMaintenance model, int CheckMainteID)
        {
            CheckMaintenanceTable tblCheckMaintenance = (from e in TOSSDB.CheckMaintenanceTables where e.CheckMainteID == CheckMainteID select e).FirstOrDefault();

            TOSSDB.CheckMaintenanceTables.Remove(tblCheckMaintenance);
            TOSSDB.SaveChanges();

            CheckInventoryTable tblAccountablechkInventory = (from e in TOSSDB.CheckInventoryTables where e.IsIssued == true select e).FirstOrDefault();

            if (tblAccountablechkInventory.IsIssued == true)
            {
                tblAccountablechkInventory.IsIssued = false;
            }
            else
            {
                tblAccountablechkInventory.IsIssued = true;
            }
            TOSSDB.Entry(tblAccountablechkInventory);
            TOSSDB.SaveChanges();

            return(RedirectToAction("Index"));
        }
コード例 #10
0
        public ActionResult DVTypeTab()
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            return(PartialView("DVType/DVTypeIndex", model));
        }
コード例 #11
0
        //Get Add Check Maintenance Partial View
        public ActionResult Get_AddCheckMaitenance()
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            return(PartialView("CheckMaintenance/_AddCheckMaintenance", model));
        }
コード例 #12
0
        public ActionResult Get_AddCheckMaintenanceInventory()
        {
            FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance();

            return(PartialView("CheckMaintenance/_DynamicDDCheckInventory", model));
        }