Пример #1
0
        public ActionResult ProcessRMAInward(RMAHeader rmaHeader)
        {
            if (rmaHeader.rmaDetails == null)
            {
                return(RedirectToAction("Inward"));
            }
            else
            {
                for (var i = 0; i < rmaHeader.rmaDetails.Count; i++)
                {
                    //Comment by krishna 31/08/2017
                    //  var rmaInwardDTO = new InvoiceDetailBO().GetVendorInvoiceDetailBySerialNo(rmaHeader.rmaDetails[i].SerialNo, BRANCH_ID, UTILITY.CONFIG_INVOICETYPE_VENDOR);//CONFIG_INVOICETYPE_CUSTOMER
                    var rmaInwardDTO = new InvoiceDetailBO().GetVendorInvoiceDetailBySerialNo(rmaHeader.rmaDetails[i].SerialNo, BRANCH_ID, UTILITY.CONFIG_INVOICETYPE_CUSTOMER);//CONFIG_INVOICETYPE_CUSTOMER
                    if (rmaInwardDTO != null)
                    {
                        rmaHeader.rmaDetails[i].DocumentNo         = rmaInwardDTO.DocumentNo;
                        rmaHeader.rmaDetails[i].WarrantyExpiryDate = rmaInwardDTO.InvoiceDate.AddMonths(rmaInwardDTO.WarrantyPeriod);
                        rmaHeader.rmaDetails[i].IsValid            = (UTILITY.SINGAPORETIME < rmaHeader.rmaDetails[i].WarrantyExpiryDate);
                    }
                    else
                    {
                        rmaHeader.rmaDetails[i].IsValid = false;
                    }
                }
            }

            ViewBag.countries = new CountryBO().GetList().Select(x => new
            {
                Value = x.CountryCode,
                Text  = x.CountryName
            }).ToList();

            return(View("Inward", rmaHeader));
        }
Пример #2
0
        public ActionResult GenerateRMA(RMAHeader rmaHeader)
        {
            rmaHeader.rmaDetails   = rmaHeader.rmaDetails.Where(x => x.IsValid == true).ToList();
            rmaHeader.Status       = true;
            rmaHeader.CreatedBy    = USER_ID;
            rmaHeader.CreatedOn    = UTILITY.SINGAPORETIME;
            rmaHeader.ModifiedBy   = USER_ID;
            rmaHeader.ModifiedOn   = UTILITY.SINGAPORETIME;
            rmaHeader.IncidentDate = UTILITY.SINGAPORETIME;
            var              result     = new RMAHeaderBO().SaveRMAHeader(rmaHeader, BRANCH_ID);
            string           documentNo = rmaHeader.rmaDetails.FirstOrDefault().DocumentNo;
            List <RMADetail> rmaDetails = new RMADetailBO().GetListByDocumentNo(documentNo);
            List <string>    serialNos  = rmaDetails.Select(s => s.SerialNo).ToList();
            var              SNo        = string.Empty;

            for (int i = 0; i < serialNos.Count; i++)
            {
                SNo += serialNos[i] + "</br>";
            }
            new EmailGenerator().ConfigMail(rmaHeader.EmailID, true, documentNo, SNo);
            return(Content("<script language='javascript' type='text/javascript'>alert('RMA Number is Sent To Your Mail!');window.location = '/RMA/Inward';</script>"));
            //return RedirectToAction("Inward");
        }
Пример #3
0
 public RMAHeader GetRMAHeaderByDocumentNo(RMAHeader item)
 {
     return((RMAHeader)rmaheaderDAL.GetItemByDocumentNo <RMAHeader>(item));
 }
Пример #4
0
 public RMAHeader GetRMAHeader(RMAHeader item)
 {
     return((RMAHeader)rmaheaderDAL.GetItem <RMAHeader>(item));
 }
Пример #5
0
 public bool DeleteRMAHeader(RMAHeader item)
 {
     return(rmaheaderDAL.Delete(item));
 }
Пример #6
0
 public bool SaveRMAHeader(RMAHeader newItem, Int16 branchID)
 {
     return(rmaheaderDAL.Save(newItem, branchID));
 }