示例#1
0
 public JsonResult GetAllSalesOrder()
 {
     try
     {
         objSalesOrderVM_Property = new SalesOrderVM_Property();
         objSalesOrderBll         = new LP_SalesOrder_BLL(objSalesOrderProperty);
         var Data = JsonConvert.SerializeObject(objSalesOrderBll.SelectAll());
         return(Json(new { data = Data, success = true, statuscode = 200, count = Data.Length }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
     }
 }
        public JsonResult SearchInvoiceForCustomers(int Id)
        {
            try
            {
                LP_SalesOrder_BLL objbll = new LP_SalesOrder_BLL();
                //DataTable tblFiltered;
                if (Id > 0)
                {
                    var selectAllInvoices = objbll.SelectAll();
                    var serializeData     = JsonConvert.SerializeObject(selectAllInvoices);
                    var allData           = Helper.ConvertDataTable <LP_SalesOrder_Master_Property>(selectAllInvoices);

                    if (selectAllInvoices.Rows.Count > 0)

                    {
                        var Data = selectAllInvoices.Select().Where(x => x.Field <int>("customerIdx") == Id).Select(c => new { Value = c["idx"], Text = c["soNumber"] }).ToList();

                        //var result = JsonConvert.SerializeObject(Data,
                        //new JsonSerializerSettings
                        //{
                        //    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                        //});

                        //tblFiltered = selectAllInvoices.AsEnumerable()
                        //        .Where(r => r.Field<int>("VendorID") == Id)
                        //        .CopyToDataTable();
                        //var Data = Helper.ConvertDataTable<LP_P_Invoice_Property>(tblFiltered);
                        return(Json(new { data = Data, invData = serializeData, success = true, statuscode = 200 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        //var Data = Helper.ConvertDataTable<LP_P_Invoice_Property>(tblFiltered);//JsonConvert.SerializeObject(GetAllPIByDate(objsearchPI));
                        return(Json(new { data = "", success = false, statuscode = 200 }, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json(new { data = "Error Occured", success = false, statuscode = 500 }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
        }
示例#3
0
        public DataTable GetAllSalesInvoice()
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    LP_SalesOrder_Master_Property objProperty     = new LP_SalesOrder_Master_Property();
                    LP_SalesOrder_BLL             objvendorcatbll = new LP_SalesOrder_BLL();

                    return(objvendorcatbll.SelectAll());
                }
                catch (Exception ex)
                {
                    return(new DataTable());
                }
            }
            else
            {
                return(new DataTable());
            }
        }
示例#4
0
        public ActionResult SalesReturn()
        {
            LP_SalesReturnVM_Property obj         = new LP_SalesReturnVM_Property();
            LP_SalesOrder_BLL         objSalesBLL = new LP_SalesOrder_BLL();

            obj.CustomerLSt = Helper.ConvertDataTable <Customers_Property>(GetAllCustomers());
            obj.SalesLST    = Helper.ConvertDataTable <LP_SalesOrder_Master_Property>(objSalesBLL.SelectAll());
            return(View(obj));
        }