Exemplo n.º 1
0
        /*Name of Function : <<getAsnList>>  Author :<<Prasanna>>
         * Date of Creation <<07-12-2020>>
         * Purpose : <<function is used to  get getAsnList>>
         * Review Date :<<>>   Reviewed By :<<>>*/
        public List <ASNShipmentHeader> getAsnList(ASNfilters ASNfilters)
        {
            List <ASNShipmentHeader> asnList = new List <ASNShipmentHeader>();

            try
            {
                using (YSCMEntities Context = new YSCMEntities())
                {
                    Context.Configuration.ProxyCreationEnabled = false;
                    var query = default(string);
                    if (ASNfilters.ReportType == "Insurance")
                    {
                        query = "select * from ASNShipmentHeader asn inner join InvoiceDetails inv on inv.ASNId=asn.ASNId where ( Deleteflag=0 or Deleteflag is null)";
                    }
                    else
                    {
                        query = "select * from ASNShipmentHeader asn where ( Deleteflag=0 or Deleteflag is null)";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.ToDate) && ASNfilters.Type == "CreatedDate")
                    {
                        query += " and asn.CreatedDate <= '" + ASNfilters.ToDate + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.FromDate) && ASNfilters.Type == "CreatedDate")
                    {
                        query += "  and asn.CreatedDate >= '" + ASNfilters.FromDate + "'";
                    }

                    if (!string.IsNullOrEmpty(ASNfilters.ToDate) && ASNfilters.Type == "InvoiceDate")
                    {
                        query += " and asn.InvoiceDate <= '" + ASNfilters.ToDate + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.FromDate) && ASNfilters.Type == "InvoiceDate")
                    {
                        query += "  and asn.InvoiceDate >= '" + ASNfilters.FromDate + "'";
                    }

                    if (!string.IsNullOrEmpty(ASNfilters.ToDate) && ASNfilters.Type == "ShippingDate")
                    {
                        query += " and asn.ShippingDate <= '" + ASNfilters.ToDate + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.FromDate) && ASNfilters.Type == "ShippingDate")
                    {
                        query += "  and asn.ShippingDate >= '" + ASNfilters.FromDate + "'";
                    }

                    if (!string.IsNullOrEmpty(ASNfilters.Vendorid))
                    {
                        query += "  and asn.VendorId = '" + ASNfilters.Vendorid + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.InvoiceNo))
                    {
                        query += "  and asn.InvoiceNo = '" + ASNfilters.InvoiceNo + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.VendorName))
                    {
                        query += "  and asn.VendorName like'%" + ASNfilters.VendorName + "%'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.ASNNo))
                    {
                        query += "  and asn.ASNNo = '" + ASNfilters.ASNNo + "'";
                    }
                    if (!string.IsNullOrEmpty(ASNfilters.PONo))
                    {
                        query += "  and asn.PONos = '" + ASNfilters.PONo + "'";
                    }
                    query  += " order by asn.ASNId desc ";
                    asnList = Context.ASNShipmentHeaders.SqlQuery(query).ToList <ASNShipmentHeader>();
                }
            }
            catch (Exception ex)
            {
                log.ErrorMessage("ASNDA", "getAsnList", ex.Message + "; " + ex.StackTrace.ToString());
            }
            return(asnList);
        }
Exemplo n.º 2
0
 public IHttpActionResult getAsnList(ASNfilters ASNfilters)
 {
     return(Ok(_asnBusinessAccess.getAsnList(ASNfilters)));
 }
Exemplo n.º 3
0
 public List <RemoteASNShipmentHeader> getAsnList(ASNfilters ASNfilters)
 {
     return(_asnDataAcess.getAsnList(ASNfilters));
 }