Exemplo n.º 1
0
        //Dropdown Accountable Form Inventory Name
        public ActionResult GetDynamicAccountableformCTC()
        {
            FM_AccountableFormInventory model = new FM_AccountableFormInventory();

            model.AccountableFormInvtList = new SelectList((from s in TOSSDB.AccountableFormTables.ToList() where s.isCTC == true && s.Description != "Cash Ticket" select new { AccountFormID = s.AccountFormID, AccountFormName = s.AccountFormName }), "AccountFormID", "AccountFormName");
            return(PartialView("InventoryofAccountableForm/OR/_DynamicDDAccountableForm", model));
        }
Exemplo n.º 2
0
        //CTC
        //Table Accountable Form Inventory
        public ActionResult Get_AccountableFormInvtTableCTC()
        {
            FM_AccountableFormInventory    model = new FM_AccountableFormInventory();
            List <AccountableFormInvtList> tbl_AccountableFormInvt = new List <AccountableFormInvtList>();

            var SQLQuery = "SELECT * FROM DB_TOSS.dbo.AccountableForm_Inventory,dbo.AccountableFormTable where AccountableForm_Inventory.AFTableID = 3 and AccountableFormTable.AccountFormID = AccountableForm_Inventory.AccountFormID ";

            //SQLQuery += " WHERE (IsActive != 0)";
            using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString()))
            {
                Connection.Open();
                using (SqlCommand command = new SqlCommand("[dbo].[SP_AccountableFormInvtList]", Connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery));
                    SqlDataReader dr = command.ExecuteReader();
                    while (dr.Read())
                    {
                        tbl_AccountableFormInvt.Add(new AccountableFormInvtList()
                        {
                            AFORID     = GlobalFunction.ReturnEmptyInt(dr[0]),
                            AF         = GlobalFunction.ReturnEmptyString(dr[10]),
                            StubNo     = GlobalFunction.ReturnEmptyInt(dr[2]),
                            Quantity   = GlobalFunction.ReturnEmptyInt(dr[3]),
                            StratingOR = GlobalFunction.ReturnEmptyInt(dr[4]),
                            EndingOR   = GlobalFunction.ReturnEmptyInt(dr[5]),
                            Date       = GlobalFunction.ReturnEmptyString(dr[6]),
                        });
                    }
                }
                Connection.Close();
            }
            model.getAccountableFormInvtList = tbl_AccountableFormInvt.ToList();
            return(PartialView("InventoryofAccountableForm/CTC/_CTCDetailsTable", model.getAccountableFormInvtList));
        }
Exemplo n.º 3
0
        //Delete Accountable Form
        public ActionResult DeleteAccountableFormInventoryCTC(FM_AccountableFormInventory model, int AFORID)
        {
            AccountableForm_Inventory tblAccountableFormInventory = (from e in TOSSDB.AccountableForm_Inventory where e.AFORID == AFORID select e).FirstOrDefault();

            TOSSDB.AccountableForm_Inventory.Remove(tblAccountableFormInventory);
            TOSSDB.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 4
0
        public ActionResult Get_UpdateAccountableFormInventoryCT(FM_AccountableFormInventory model, int AFORID)
        {
            AccountableForm_Inventory tblAccountableFormInventory = (from e in TOSSDB.AccountableForm_Inventory where e.AFORID == AFORID select e).FirstOrDefault();

            model.getAccountableFormInvtcolumns.AFORID = tblAccountableFormInventory.AFORID;
            model.AFTempID = tblAccountableFormInventory.AccountFormID;
            model.getAccountableFormInvtcolumns.StartingOR = tblAccountableFormInventory.StartingOR;
            model.getAccountableFormInvtcolumns.EndingOR   = tblAccountableFormInventory.EndingOR;
            model.getAccountableFormInvtcolumns.Quantity   = tblAccountableFormInventory.Quantity;
            model.getAccountableFormInvtcolumns.Date       = tblAccountableFormInventory.Date;
            return(PartialView("InventoryofAccountableForm/CT/_UpdateCTDetails", model));
        }
Exemplo n.º 5
0
        //Update Accountable Form
        public ActionResult UpdateAccountableFormInventoryCT(FM_AccountableFormInventory model)
        {
            AccountableForm_Inventory tblAccountableFormInventory = (from e in TOSSDB.AccountableForm_Inventory where e.AFORID == model.getAccountableFormInvtcolumns.AFORID select e).FirstOrDefault();

            tblAccountableFormInventory.AccountFormID = model.AccountableFormInvtID;
            tblAccountableFormInventory.StartingOR    = model.getAccountableFormInvtcolumns.StartingOR;
            tblAccountableFormInventory.EndingOR      = model.getAccountableFormInvtcolumns.EndingOR;
            tblAccountableFormInventory.Quantity      = model.getAccountableFormInvtcolumns.Quantity;
            tblAccountableFormInventory.Date          = model.getAccountableFormInvtcolumns.Date;
            TOSSDB.Entry(tblAccountableFormInventory);
            TOSSDB.SaveChanges();
            return(PartialView("InventoryofAccountableForm/CT/_UpdateCTDetails", model));
        }
Exemplo n.º 6
0
        //Add Accountable Form Inventory
        public JsonResult AddAccountableFormInventoryCT(FM_AccountableFormInventory model)
        {
            AccountableForm_Inventory tblAccountableFormInventory = new AccountableForm_Inventory();

            tblAccountableFormInventory.AccountFormID = model.AccountableFormInvtID;
            tblAccountableFormInventory.Quantity      = model.getAccountableFormInvtcolumns.Quantity;
            tblAccountableFormInventory.StartingOR    = model.getAccountableFormInvtcolumns.StartingOR;
            tblAccountableFormInventory.EndingOR      = model.getAccountableFormInvtcolumns.EndingOR;
            tblAccountableFormInventory.Date          = model.getAccountableFormInvtcolumns.Date;
            tblAccountableFormInventory.AFTableID     = 2;
            TOSSDB.AccountableForm_Inventory.Add(tblAccountableFormInventory);
            TOSSDB.SaveChanges();
            return(Json(tblAccountableFormInventory));
        }
Exemplo n.º 7
0
        //Get Add Accountable Form Inventory Partial View
        public ActionResult Get_AddInvntAccountableFormCTC()
        {
            FM_AccountableFormInventory model = new FM_AccountableFormInventory();

            return(PartialView("InventoryofAccountableForm/CTC/_AddCTCDetails", model));
        }