Пример #1
0
        public ActionResult ModifyPO(string id)
        {
            clsPOSetup      posetup   = new clsPOSetup();
            List <dropdown> cust      = new List <dropdown>();
            TCCGDataContext dbcontext = new TCCGDataContext();


            var q_po_profile = from aa in dbcontext.TCCG_PO_MSTRs
                               where aa.PO_NUM == id
                               select aa;

            posetup.ponum  = id;
            posetup.podate = DateTime.Parse(q_po_profile.First().PO_DATE.ToString()).ToShortDateString();


            var q_tccg_customer = from aa in dbcontext.TCCG_CUSTOMERs
                                  where aa.cust_status == "SID005"
                                  select new { aa.CUSTOMER_CODE, aa.CUSTOMER_NAME };



            cust.Add(new dropdown {
                displayvalue = "=Select=", valuemember = "=Select="
            });
            foreach (var row in q_tccg_customer)
            {
                cust.Add(new dropdown {
                    displayvalue = row.CUSTOMER_NAME, valuemember = row.CUSTOMER_CODE
                });
            }

            posetup.customer = cust;
            ViewBag.cusid    = q_po_profile.First().PO_CUSTOMER;
            return(View(posetup));
        }
Пример #2
0
        public ActionResult CreatePO()
        {
            clsPOSetup      posetup   = new clsPOSetup();
            List <dropdown> cust      = new List <dropdown>();
            TCCGDataContext dbcontext = new TCCGDataContext();


            //posetup.ponum = clsfunc.CodeGenerator(procedure.constring(), "po_num", "tbl_100_PO", "PO-" + DateTime.Now.ToString("MMddyy"), 10, 3);
            posetup.ponum  = "[SYSTEM GENERATED]";
            posetup.podate = DateTime.Now.Date.ToShortDateString();


            var q_tccg_customer = from aa in dbcontext.TCCG_CUSTOMERs
                                  where aa.cust_status == "SID005"
                                  select new { aa.CUSTOMER_CODE, aa.CUSTOMER_NAME };



            cust.Add(new dropdown {
                displayvalue = "=Select=", valuemember = "=Select="
            });
            foreach (var row in q_tccg_customer)
            {
                cust.Add(new dropdown {
                    displayvalue = row.CUSTOMER_NAME, valuemember = row.CUSTOMER_CODE
                });
            }

            posetup.customer = cust;

            return(View(posetup));
        }
Пример #3
0
        public ActionResult invoice(string id)
        {
            preview_invoice            pre_invoice = new preview_invoice();
            List <preview_invoice_dtl> pre_dtl     = new List <preview_invoice_dtl>();

            TCCGDataContext dbcon = new TCCGDataContext();

            var q_invoice = (from aa in dbcon.V_INVOICEs
                             where aa.INVOICE_NUM == id
                             select aa).First();

            var q_invoice_dtl = from aa in dbcon.V_INVOICE_DTLs
                                where aa.DR_num == id
                                select aa;


            pre_invoice.invoice_num = id;
            pre_invoice.invoice_dte = DateTime.Parse(q_invoice.INVOICE_DTE.ToString()).ToShortDateString();
            pre_invoice.total_amt   = q_invoice.DR_Total;

            foreach (var row in q_invoice_dtl)
            {
                pre_dtl.Add(new preview_invoice_dtl {
                    qty   = row.DR_quantity,
                    make  = row.MAKE,
                    model = row.MODEL,
                    vin   = row.VIN_ENGINE,
                    price = row.DR_itemSellingPrice
                });
            }

            pre_invoice.invoice_dtl = pre_dtl;

            return(View(pre_invoice));
        }
Пример #4
0
        public ActionResult PaymentTransaction(int?p)
        {
            TCCGDataContext    dbcon = new TCCGDataContext();
            List <PaymentList> pylst = new List <PaymentList>();

            var q_pay_list = from aa in dbcon.V_PAYMENT_LISTs
                             orderby aa.PAY_DTE descending
                             select aa;

            foreach (var row in q_pay_list)
            {
                pylst.Add(new PaymentList {
                    _PAY_NUM       = row.PAY_NUM,
                    _PAY_DTE       = DateTime.Parse(row.PAY_DTE.ToString()).ToShortDateString(),
                    _INVOICE_NUM   = row.INVOICE_NUM,
                    _CUSTOMER_NAME = row.CUSTOMER_NAME,
                    _AMT_PAID      = row.AMT_PAID,
                    _PAY_BALANCE   = row.PAY_BALANCE
                });
            }

            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(pylst.ToPagedList(pageNumber, pageSize)));
        }
Пример #5
0
        public ActionResult PackingList(string id)
        {
            TCCGDataContext dbcon = new TCCGDataContext();

            clsRptPackinglist          rptpacking = new clsRptPackinglist();
            List <rpt_packinglist_dtl> dtl        = new List <rpt_packinglist_dtl>();

            var q_paking = (from aa in dbcon.V_PACKING_LISTs
                            where aa.PL_NUM == id
                            select aa).First();

            var q_dtl = from aa in dbcon.V_PACKING_LIST_DTLs
                        where aa.PL_NUM == id
                        select aa;

            rptpacking.plnum        = id;
            rptpacking.pldte        = DateTime.Parse(q_paking.PL_DTE.ToString()).ToShortDateString();
            rptpacking.ship         = q_paking.DR_Ship;
            rptpacking.via          = q_paking.DR_via;
            rptpacking.gross_weight = q_paking.GROSS_WEIGHT;
            rptpacking.customer     = q_paking.DR_customer;
            rptpacking.customername = q_paking.CUSTOMER_ADDRESS + "<br/>" + q_paking.CUSTOMER_NAME + " <br/>" + q_paking.cust_mobile;

            foreach (var row in q_dtl)
            {
                dtl.Add(new rpt_packinglist_dtl {
                    qty = row.QTY, make = row.MAKE, model = row.MODEL, vin = row.VIN_ENGINE, net_weight = row.NET_WEIGTH
                });
            }


            rptpacking.pklist = dtl;

            return(View(rptpacking));
        }
Пример #6
0
        public ActionResult CreateInvoice()
        {
            TCCGDataContext dbcontext     = new TCCGDataContext();
            clsInvoiceSetup invoice_setup = new clsInvoiceSetup();
            List <dropdown> cust          = new List <dropdown>();

            invoice_setup.Invoice_num = "[SYSTEM GENERATED]";
            invoice_setup.InvoiceDte  = DateTime.Now.Date.ToShortDateString();

            var q_tccg_customer = from aa in dbcontext.TCCG_CUSTOMERs
                                  where aa.cust_status == "SID005"
                                  select new { aa.CUSTOMER_CODE, aa.CUSTOMER_NAME };



            cust.Add(new dropdown {
                displayvalue = "=Select=", valuemember = "=Select="
            });
            foreach (var row in q_tccg_customer)
            {
                cust.Add(new dropdown {
                    displayvalue = row.CUSTOMER_NAME, valuemember = row.CUSTOMER_CODE
                });
            }

            invoice_setup.customerlist = cust;

            return(View(invoice_setup));
        }
Пример #7
0
        public ActionResult InvoiceTransaction(int?p)
        {
            List <clsInvoiceList> InvoiceList = new List <clsInvoiceList>();
            TCCGDataContext       dbcontext   = new TCCGDataContext();

            var q_invoicelist = from aa in dbcontext.V_INVOICEs
                                orderby aa.INVOICE_DTE descending
                                select aa;


            foreach (var row in q_invoicelist)
            {
                InvoiceList.Add(new clsInvoiceList {
                    Invoice_num   = row.INVOICE_NUM,
                    Invoice_date  = DateTime.Parse(row.INVOICE_DTE.ToString()).ToShortDateString(),
                    Customer_name = row.CUSTOMER_NAME,
                    Total_amt     = string.Format(string.Format("{0:#,#.00}", row.DR_Total)),
                    status        = row.STATUS,
                    PaidStatus    = row.PAID_STATUS
                });
            }

            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(InvoiceList.ToPagedList(pageNumber, pageSize)));
        }
Пример #8
0
        public ActionResult Login(TccgLogin login)
        {
            var    dbcontext = new TCCGDataContext();
            var    security  = new clssecurity();
            bool   logres;
            bool   loginstatus = true;
            string strerrormsg = string.Empty;

            if (string.IsNullOrEmpty(login.uname) || string.IsNullOrEmpty(login.upass))
            {
                @ViewBag.Title = "Admin | Login";
                return(View());
            }


            logres = dbcontext.IsLogin(login.uname.ToUpper(), security.psEncrypt(login.upass)) == true ? true : false;


            if (logres)
            {
                TCCG_USER up = dbcontext.TCCG_USERs.First(aa => aa.username == login.uname);

                if (up.userstatus != true)
                {
                    strerrormsg += "Sorry your account is inactive!";
                    loginstatus  = false;
                }


                if (!loginstatus)
                {
                    ViewBag.error  = strerrormsg;
                    @ViewBag.Title = "TCCG | Login";
                }
                else
                {
                    Session["_cid"]  = up.username;
                    Session["_crol"] = up.usergroup;
                    Session.Timeout  = 30;
                }
            }


            if (!loginstatus)
            {
                return(View());
            }
            else
            {
                this.SetPmsCookie(login.RememberMe, login.uname.ToUpper(), login.upass);

                return(RedirectToAction("Index"));
            }
        }
Пример #9
0
        public ActionResult ModifyBooking(bbooking_setup booksetup)
        {
            TCCGDataContext dbcontext = new TCCGDataContext();

            dbcontext.SPROC_TCCG_BOOKING_SAVE(booksetup.booking_num,
                                              booksetup.invoice_num,
                                              booksetup.bill_landing,
                                              booksetup.shipper,
                                              booksetup.consignee,
                                              booksetup.vessel,
                                              booksetup.port_landing,
                                              booksetup.port_descharge);
            ViewBag.issave = true;
            return(View());
        }
Пример #10
0
        public ActionResult PayoutTransaction()
        {
            List <partedlist> p_list    = new List <partedlist>();
            TCCGDataContext   dbcontext = new TCCGDataContext();

            var q_po = from aa in dbcontext.V_PO_PROFITs
                       select aa;

            foreach (var row in q_po)
            {
                p_list.Add(new partedlist {
                    ponum = row.PO_NUM, total_profit = row.TOTAL_PROFIT
                });
            }
            return(View(p_list));
        }
Пример #11
0
        public ActionResult ModifyPakingList(string id)
        {
            TCCGDataContext dbcon = new TCCGDataContext();

            var q_packinglist = (from aa in dbcon.V_PACKING_LISTs
                                 where aa.PL_NUM == id
                                 select aa).First();

            packinglist pl = new packinglist();

            pl.pl_num      = id;
            pl.pl_date     = DateTime.Parse(q_packinglist.PL_DTE.ToString()).ToShortDateString();
            pl.invoice_num = q_packinglist.INVOICE_NUM;
            pl.gross       = q_packinglist.GROSS_WEIGHT;

            return(View(pl));
        }
Пример #12
0
        public void CreateNewSession()
        {
            var dbcontext = new TCCGDataContext();

            HttpCookie cookie = Request.Cookies["tccg"];
            string     uname = string.Empty, upass = string.Empty;

            if (cookie != null)
            {
                uname = cookie["_00un"].ToString();
                upass = cookie["_00up"].ToString();
            }

            TCCG_USER up = dbcontext.TCCG_USERs.First(aa => aa.username == uname);

            Session["_cid"]  = up.username;
            Session["_crol"] = up.usergroup;
            Session.Timeout  = 30;
        }
Пример #13
0
        public ActionResult BookingewList(string sc, string s, int?p)
        {
            if (s != null)
            {
                p = 1;
            }
            else
            {
                s = sc;
            }

            ViewBag.CurrentFilter = s;

            List <bookinglist> bklst     = new List <bookinglist>();
            TCCGDataContext    dbcontext = new TCCGDataContext();

            var q_booklst = from aa in dbcontext.TCCG_BOOKINGs
                            select aa;

            if (!string.IsNullOrEmpty(s))
            {
                q_booklst = q_booklst.Where(aa => aa.booking_num.Contains(s) || aa.invoice_num.Contains(s));
            }

            foreach (var row in q_booklst)
            {
                bklst.Add(new bookinglist {
                    bookingnum     = row.booking_num,
                    invoicenum     = row.invoice_num,
                    bill_landing   = row.bill_landing,
                    vessel         = row.vessel_voyage,
                    port_landing   = row.port_landing,
                    port_descharge = row.port_descharge
                });
            }



            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(bklst.ToPagedList(pageNumber, pageSize)));
        }
Пример #14
0
        public ActionResult PackingList(int?p)
        {
            TCCGDataContext    dbcon  = new TCCGDataContext();
            List <packinglist> pl_lst = new List <packinglist>();

            var q_pclist = from aa in dbcon.TCCG_PACKING_LISTs
                           select aa;

            foreach (var row in q_pclist)
            {
                pl_lst.Add(new packinglist {
                    pl_num = row.PL_NUM, pl_date = DateTime.Parse(row.PL_DTE.ToString()).ToShortDateString(), gross = row.GROSS_WEIGHT, invoice_num = row.INVOICE_NUM
                });
            }

            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(pl_lst.ToPagedList(pageNumber, pageSize)));
        }
Пример #15
0
        public ActionResult PurchaseOrderList(int?p)
        {
            List <clsPOList> polist    = new List <clsPOList>();
            TCCGDataContext  dbcontext = new TCCGDataContext();

            var q_polist = from aa in dbcontext.V_PO_LISTs
                           orderby aa.PODATE descending
                           select aa;

            foreach (var row in q_polist)
            {
                polist.Add(new clsPOList {
                    pono = row.PO_NO, podate = DateTime.Parse(row.PODATE.ToString()).ToString("MM/dd/yyyy"), customer = row.CUSTOMER_NAME, baseprice = row.BASE_PRICE, sellingprice = row.SELLING_PRICE, PaidStatus = row.Description
                });
            }

            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(polist.ToPagedList(pageNumber, pageSize)));
        }
Пример #16
0
        public ActionResult ExpenseManagement(int?p)
        {
            TCCGDataContext   dbcon   = new TCCGDataContext();
            List <clsExpense> expense = new List <clsExpense>();

            var q_expense = from aa in dbcon.V_EXPENSEs
                            select aa;

            foreach (var row in q_expense)
            {
                expense.Add(new clsExpense {
                    invoicenum = row.INVOICE_NUM, expenseamt = row.EXPENSE_AMT
                });
            }


            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(expense.ToPagedList(pageNumber, pageSize)));
        }
Пример #17
0
        public ActionResult UserList(string sc, string s, int?p)
        {
            if (s != null)
            {
                p = 1;
            }
            else
            {
                s = sc;
            }

            ViewBag.CurrentFilter = s;

            List <Userlist> ulist     = new List <Userlist>();
            var             dbcontext = new TCCGDataContext();

            var q_userlist = from aa in dbcontext.V_USERs
                             select aa;

            if (!string.IsNullOrEmpty(s))
            {
                q_userlist = q_userlist.Where(aa => aa.USERNAME.Contains(s) || aa.FULLNAME.Contains(s) || aa.DESIGNATION.Contains(s) || aa.EMAIL.Contains(s));
            }

            if (q_userlist.Any())
            {
                foreach (var row in q_userlist)
                {
                    ulist.Add(new Userlist {
                        username = row.USERNAME, fullname = row.FULLNAME, email = row.EMAIL, designation = row.DESIGNATION, Group = row.GROUPDES, isactive = row.ISACTIVE.ToString()
                    });
                }
            }

            int pageSize   = 10;
            int pageNumber = (p ?? 1);

            return(View(ulist.ToPagedList(pageNumber, pageSize)));
        }
Пример #18
0
        public ActionResult ModifyBooking(string bk, string invoice)
        {
            TCCGDataContext dbcontext = new TCCGDataContext();

            var q_booking = (from aa in dbcontext.TCCG_BOOKINGs
                             where aa.booking_num == bk && aa.invoice_num == invoice
                             select aa).First();

            bbooking_setup bksetup = new bbooking_setup();

            bksetup.booking_num    = bk;
            bksetup.invoice_num    = invoice;
            bksetup.bill_landing   = q_booking.bill_landing;
            bksetup.shipper        = q_booking.shipper_exporter;
            bksetup.consignee      = q_booking.consignee;
            bksetup.vessel         = q_booking.vessel_voyage;
            bksetup.port_landing   = q_booking.port_landing;
            bksetup.port_descharge = q_booking.port_descharge;

            ViewBag.issave = false;
            return(View(bksetup));
        }
Пример #19
0
        public ActionResult ModifyInvoice(string id)
        {
            TCCGDataContext dbcontext     = new TCCGDataContext();
            clsInvoiceSetup invoice_setup = new clsInvoiceSetup();
            List <dropdown> cust          = new List <dropdown>();

            var q_invoice_dtl = (from aa in dbcontext.TCCG_INVOICE_MSTRs
                                 where aa.DR_num == id
                                 select aa).First();

            invoice_setup.Invoice_num = q_invoice_dtl.DR_num;
            invoice_setup.InvoiceDte  = DateTime.Parse(q_invoice_dtl.DR_date.ToString()).ToShortDateString();
            invoice_setup.Ship        = q_invoice_dtl.DR_Ship;
            invoice_setup.Via         = q_invoice_dtl.DR_via;
            ViewBag.customercode      = q_invoice_dtl.DR_customer;

            var q_tccg_customer = from aa in dbcontext.TCCG_CUSTOMERs
                                  where aa.cust_status == "SID005"
                                  select new { aa.CUSTOMER_CODE, aa.CUSTOMER_NAME };



            cust.Add(new dropdown {
                displayvalue = "=Select=", valuemember = "=Select="
            });
            foreach (var row in q_tccg_customer)
            {
                cust.Add(new dropdown {
                    displayvalue = row.CUSTOMER_NAME, valuemember = row.CUSTOMER_CODE
                });
            }

            invoice_setup.customerlist = cust;

            return(View(invoice_setup));
        }
Пример #20
0
        public ActionResult MenuList()
        {
            bool           islogin = false;
            List <clsMenu> mnulst  = new List <clsMenu>();


            //if the session is count=0 then check the isremember function is equal to true the createnewsession
            if (Session.Count == 0)
            {
                if (isRemenber())
                {
                    this.CreateNewSession();
                }
                else
                {
                    islogin = true;
                }
            }

            if (Session.Count > 0)
            {
                string userid = (string)Session["_cid"];

                var dbcontext = new  TCCGDataContext();


                var q_prntmenu = from aa in dbcontext.V_PARENT_MENUs
                                 where aa.Username == userid orderby aa.MenuOrder
                                 select aa;

                if (q_prntmenu.Any())
                {
                    foreach (var row in q_prntmenu)
                    {
                        List <clsSubMenu> submenu = new List <clsSubMenu>();

                        var q_menu = from aa in dbcontext.V_MENUs
                                     where aa.Username == userid && aa.ParentMenuID == row.MenuID orderby aa.MenuOrder
                                     select aa;

                        if (q_menu.Any())
                        {
                            foreach (var rowmenu in q_menu)
                            {
                                submenu.Add(new clsSubMenu {
                                    submenuid = rowmenu.MenuID, submenuname = rowmenu.MenuText, subcontroller = rowmenu.CONTROLER_NAME
                                });
                            }
                        }

                        mnulst.Add(new clsMenu {
                            menuname = row.MenuText, menuvalue = row.MenuID, menucontroller = row.CONTROLER_NAME, submenulist = submenu
                        });
                    }
                }
            }

            if (islogin)
            {
                return(Content("NotLogin"));
            }
            else
            {
                return(PartialView("_menulist", mnulst));
            }
        }