Ejemplo n.º 1
0
        public ActionResult UpdateInvoiceICByFileID(string FileInvoiceList, int fileID)
        {
            try
            {
                int FileId = fileID;
                List <InvoiceICDetail> objInvoiceICDetail = new List <InvoiceICDetail>();
                string[] arr = FileInvoiceList.Split(',');
                for (int i = 0; i < arr.Length - 1; i++)
                {
                    string          _ia          = arr[i];
                    string[]        arrFields    = _ia.Split('-');
                    InvoiceICDetail objInvoiceIC = new InvoiceICDetail
                    {
                        FileID       = Convert.ToInt32(arrFields[0]),
                        InvoiceID    = Convert.ToInt32(arrFields[1]),
                        InvoiceICAmt = Convert.ToDecimal(arrFields[2]),
                    };
                    objInvoiceICDetail.Add(objInvoiceIC);
                }
                var validate = _invoice.UpdateInvoiceICAmt(Mapper.Map <IEnumerable <LMGEDI.Core.Data.Model.InvoiceICDetail> >(objInvoiceICDetail));


                var getAllInvoices = _invoice.GetInvoiceICRecord(FileId);
                InvoiceICViewModel invoiceViewModel = new LMGEDIApp.Domain.Models.InvoiceModel.InvoiceICViewModel();
                invoiceViewModel.InvoiceICDetails = Mapper.Map <IEnumerable <InvoiceICDetail> >(getAllInvoices);
                return(Json(invoiceViewModel));
            }
            catch (Exception ex)
            {
                _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace);
                return(View());
            }
        }
Ejemplo n.º 2
0
 public ActionResult InvoiceIC(int id)
 {
     ViewBag.FileID = id;
     if (id != int.Parse(GlobalConst.ConstantChar.Zero))
     {
         try
         {
             var getAllInvoices = _invoice.GetInvoiceICRecord(id);
             InvoiceICViewModel invoiceViewModel = new LMGEDIApp.Domain.Models.InvoiceModel.InvoiceICViewModel();
             invoiceViewModel.InvoiceICDetails = Mapper.Map <IEnumerable <InvoiceICDetail> >(getAllInvoices);
             return(View(invoiceViewModel));
         }
         catch (Exception ex)
         {
             _arCommonService.CreateErrorLog(ex.Message, ex.StackTrace);
             return(View());
         }
     }
     else
     {
         return(View());
     }
 }