コード例 #1
0
        public JsonResult SendInvoiceApproval(string htmlTableValue)
        {
            var message           = string.Empty;
            var format            = "dd-MM-yyyy"; // your datetime format
            var dateTimeConverter = new IsoDateTimeConverter {
                DateTimeFormat = format
            };
            List <UnbilledDetail> myDeserializedObjList = (List <UnbilledDetail>)JsonConvert.DeserializeObject(htmlTableValue, typeof(List <UnbilledDetail>), dateTimeConverter);

            var lstApprovedInvoices = myDeserializedObjList;

            lstApprovedInvoices.Where(dt => dt.ApprovalStatus == null).Update(dt => { dt.ApprovalStatus = ""; });
            lstApprovedInvoices = lstApprovedInvoices.Where(x => x.InvoiceNo != null).ToList();
            //lstApprovedInvoices = myDeserializedObjList.Where(dt => dt.ApprovalStatus.Length > 0).ToList();

            if (lstApprovedInvoices == null || lstApprovedInvoices.Count == 0)
            {
                message = "failure";
            }
            else
            {
                var result = new NetStock.BusinessFactory.InvoiceHeaderBO().ApproveInvoice(lstApprovedInvoices, Session["DEFAULTUSER"].ToString());

                message = "Success";
                return(Json(new { success = result, Message = message }));
            }


            return(Json(new { success = true, Message = message }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult InvoiceList()
        {
            try
            {
                var lstInvoice = new NetStock.BusinessFactory.InvoiceHeaderBO().GetList(Convert.ToInt16(Session["BranchId"]));

                return(View("InvoiceList", lstInvoice));
            }
            catch (Exception ex)
            {
                return(View(""));
            }
        }
コード例 #3
0
        public ActionResult InvoiceEntry(string invoiceNo)
        {
            try
            {
                NetStock.Contract.InvoiceHeader invoiceheader = new Contract.InvoiceHeader();

                if (invoiceNo == "NEW")
                {
                    invoiceNo = "";
                }

                if (invoiceNo != null && invoiceNo.Length > 0)
                {
                    invoiceheader = new NetStock.BusinessFactory.InvoiceHeaderBO().GetInvoiceHeader(new Contract.InvoiceHeader {
                        InvoiceNo = invoiceNo
                    });


                    if (invoiceheader.InvoiceDetails == null)
                    {
                        invoiceheader.InvoiceDetails = new List <Contract.InvoiceDetail>();
                    }
                }
                else
                {
                    invoiceheader.InvoiceNo      = invoiceNo;
                    invoiceheader.InvoiceDate    = DateTime.Today.Date;
                    invoiceheader.InvoiceDetails = new List <Contract.InvoiceDetail>();
                }
                invoiceheader.CustomersList = Utility.GetCustomerList(false);

                return(View("InvoiceEntry", invoiceheader));
            }
            catch (Exception ex)
            {
                return(View(""));
            }

            //return View(Products);
        }