public void SaveScannedBarcodeToTextFile(string barcode, long salesReturnId)
        {
            SuccessErrorModel model = new SuccessErrorModel();

            try
            {
                int branchId          = Convert.ToInt32(Session["BranchId"]);
                var scannedBarCode    = barcode.ToUpper();
                int productId         = Convert.ToInt32(scannedBarCode.Substring(2, 3));
                var returndetailsbyId = _iProductReturnManager.GetReturnDetailsBySalesReturnId(salesReturnId).ToList().FirstOrDefault(n => n.SalesReturnId == salesReturnId);
                var filePath          = GetReceiveProductFilePath(salesReturnId, branchId);

                //------------read Scanned barcode form text file---------
                var barcodeList = _iProductManager.GetScannedProductListFromTextFile(filePath).ToList();
                //------------Load receiveable product---------
                var receivesProductList     = _iProductReturnManager.GetReturnDetailsBySalesReturnId(salesReturnId).ToList();
                List <ViewProduct> products = _iDeliveryManager.GetDeliveredProductListByTransactionRef(returndetailsbyId.DeliveryRef).ToList();
                var receivesProductCodeList = products.Select(n => n.ProductBarCode).ToList();
                var isvalid = Validator.ValidateProductBarCode(scannedBarCode);

                int requistionQtyByProductId = receivesProductList.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity);

                int scannedQtyByProductId = barcodeList
                                            .FindAll(n => Convert.ToInt32(n.ProductCode.Substring(2, 3)) == productId).Count;

                bool isScannComplete = requistionQtyByProductId.Equals(scannedQtyByProductId);

                if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scanned Complete</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (!isvalid)
                {
                    model.Message = "<p style='color:red'> Invalid Barcode</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }

                else if (receivesProductCodeList.Contains(scannedBarCode))
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                Log.WriteErrorLog(exception);
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }
Beispiel #2
0
        public void SaveScannedBarcodeToTextFile(string barcode, long salesReturnId)
        {
            SuccessErrorModel model = new SuccessErrorModel();
            ViewWriteLogModel log   = new ViewWriteLogModel();

            try
            {
                var filePath = GetSalesReturnProductFilePath(salesReturnId);

                var scannedBarCode      = barcode.ToUpper();
                int productId           = Convert.ToInt32(scannedBarCode.Substring(2, 3));
                var receivesProductList = _iProductReturnManager.GetReturnDetailsBySalesReturnId(salesReturnId).ToList();

                //------------read Scanned barcode form text file---------
                var barcodeList = _iProductManager.GetScannedProductListFromTextFile(filePath).ToList();

                //------------Load receiveable product---------
                var isvalid = Validator.ValidateProductBarCode(scannedBarCode);

                int requistionQtyByProductId = receivesProductList.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity);

                int scannedQtyByProductId = barcodeList
                                            .FindAll(n => Convert.ToInt32(n.ProductCode.Substring(2, 3)) == productId).Count;

                bool isScannComplete = requistionQtyByProductId.Equals(scannedQtyByProductId);

                if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scanned Complete</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (!isvalid)
                {
                    model.Message = "<p style='color:red'> Invalid Barcode</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }
                else
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }
        public void AddProductToTempFile(string barcode)
        {
            SuccessErrorModel successErrorModel = new SuccessErrorModel();

            try
            {
                var    user           = (ViewUser)Session["user"];
                string fileName       = "Production_In_" + user.UserId + "_" + DateTime.Now.ToString("ddMMMyyyy");
                string filePath       = Server.MapPath("~/Files/" + fileName);
                var    scannedBarcode = barcode.ToUpper();
                bool   isValid        = Validator.ValidateProductBarCode(scannedBarcode);
                if (isValid)
                {
                    bool isExists = _iInventoryManager.IsThisProductAlreadyInFactoryInventory(scannedBarcode);

                    //------------If this barcode dose not exits...............
                    if (!isExists)
                    {
                        var result = _iProductManager.AddProductToTextFile(scannedBarcode, filePath);
                        if (!result.Contains("Added"))
                        {
                            successErrorModel.Message = result;
                        }
                    }
                    else
                    {
                        successErrorModel.Message = "<p style='color:red'>This Product already exists!!</p>";
                        // return Json(successErrorModel, JsonRequestBehavior.AllowGet);
                    }
                }
                else
                {
                    successErrorModel.Message = "<p style='color:red'>Invalid Barcode..</p>";
                    //return Json(successErrorModel, JsonRequestBehavior.AllowGet);
                }
            }
            catch (FormatException exception)
            {
                successErrorModel.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                // return Json(successErrorModel, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                successErrorModel.Message = "<p style='color:red'>" + exception.Message + "</p>";
                // return Json(successErrorModel, JsonRequestBehavior.AllowGet);
            }
            //return Json(successErrorModel, JsonRequestBehavior.AllowGet);
        }
Beispiel #4
0
        public void SaveScannedBarcodeToTextFile(string barcode, long receiveId)
        {
            SuccessErrorModel model = new SuccessErrorModel();

            try
            {
                List <ViewBranchStockModel> products = (List <ViewBranchStockModel>)Session["Branch_stock"];
                // var id = receiveId;
                // var replace = _iProductReplaceManager.GetReplaceById(id);
                var    product        = _iServiceManager.GetDeliverableServiceProductById(receiveId);
                string scannedBarCode = barcode.ToUpper();
                int    productId      = Convert.ToInt32(scannedBarCode.Substring(2, 3));
                var    filePath       = GetTempReplaceProductXmlFilePath(receiveId);
                var    barcodeList    = _iProductManager.ScannedProducts(filePath);

                if (barcodeList.Count != 0)
                {
                    foreach (ScannedProduct scannedProduct in barcodeList)
                    {
                        var p = products.Find(n => n.ProductBarCode.Equals(scannedProduct.ProductCode));
                        products.Remove(p);
                        Session["Branch_stock"] = products;
                    }
                }

                // DateTime date = _iCommonManager.GenerateDateFromBarCode(scannedBarCode);
                // var oldestProducts = products.ToList().FindAll(n => n.ProductionDate < date && n.ProductId == productId).ToList();
                bool isInInventory   = products.Select(n => n.ProductBarCode).Contains(scannedBarCode);
                bool isScannedBefore = _iProductManager.IsScannedBefore(barcodeList, scannedBarCode);

                bool isSold = _iInventoryManager.IsThisProductSold(scannedBarCode);
                //------------Get invoced products-------------
                // var replaceDetails = _iProductReplaceManager.GetReplaceProductListById(id).ToList();
                // List<ViewReplaceDetailsModel> list = new List<ViewReplaceDetailsModel>();
                //var deliveredProducts = _iProductReplaceManager.GetDeliveredProductsByReplaceRef(product.ReceiveRef);

                var list = new List <ViewReplaceDetailsModel>
                {
                    new ViewReplaceDetailsModel
                    {
                        ExpiryDate  = product.ExpiryDate,
                        ProductId   = product.ProductId,
                        SaleDate    = product.SaleDate,
                        ProductName = product.ProductName,
                        Quantity    = 1
                    }
                };

                //foreach (var item in replaceDetails)
                //{
                //    var replaceQty = item.Quantity;
                //    var deliveredQty = deliveredProducts.ToList().FindAll(n => n.ProductId == item.ProductId).Count;
                //    if (replaceQty != deliveredQty)
                //    {
                //        item.Quantity = replaceQty - deliveredQty;
                //        list.Add(item);
                //    }

                //}
                bool isValied        = list.Select(n => n.ProductId).Contains(productId);
                bool isScannComplete = list.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity) == barcodeList.FindAll(n => n.ProductId == productId).Count;
                if (isScannedBefore)
                {
                    model.Message = "<p style='color:red'> Already Scanned</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scan Completed.</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }

                //else if (oldestProducts.Count > 0)
                //{
                //    model.Message = "<p style='color:red'>There are total " + oldestProducts.Count + " Old product of this type .Please deliver those first .. </p>";
                //   // return Json(model, JsonRequestBehavior.AllowGet);
                //}
                else if (isSold)
                {
                    model.Message = "<p style='color:green'> This product Scanned for one of previous invoice... </p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isValied && isInInventory)
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }
Beispiel #5
0
        public void SaveScannedBarcodeToTextFile(string barcode, long requisitionId)
        {
            SuccessErrorModel model = new SuccessErrorModel();

            try
            {
                var products = (List <ViewFactoryStockModel>)Session["Factory_Stock"];
                // var invoice = _iProductManager.GetGeneralRequisitionById(requisitionId);
                string scannedBarCode = barcode.ToUpper();
                int    productId      = Convert.ToInt32(scannedBarCode.Substring(2, 3));
                string fileName       = "Scanned_GR_Product_List_For_" + requisitionId;
                var    filePath       = Server.MapPath("~/Files/" + fileName);
                var    barcodeList    = _iProductManager.ScannedProducts(filePath);

                if (barcodeList.Count != 0)
                {
                    foreach (ScannedProduct scannedProduct in barcodeList)
                    {
                        var p = products.Find(n => n.ProductBarCode.Equals(scannedProduct.ProductCode));
                        products.Remove(p);
                        Session["Factory_Stock"] = products;
                    }
                }


                bool isInInventory     = products.Select(n => n.ProductBarCode).Contains(scannedBarCode);
                bool isScanedBefore    = _iProductManager.IsScannedBefore(barcodeList, scannedBarCode);
                bool isDeliveredBefore = _iInventoryManager.IsThisProductDispachedFromFactory(scannedBarCode);
                //bool isSold = _iInventoryManager.IsThisProductSold(scannedBarCode);
                //------------Get invoced products-------------
                var requisitionsById = _iProductManager.GetGeneralRequisitionDetailsById(requisitionId);
                //List<InvoiceDetails> list = new List<InvoiceDetails>();

                bool isValied        = requisitionsById.Select(n => n.ProductId).Contains(productId);
                bool isScannComplete = requisitionsById.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity) == barcodeList.FindAll(n => n.ProductId == productId).Count;
                if (isScanedBefore)
                {
                    model.Message = "<p style='color:red'> Already Scanned</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scan Completed.</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }


                else if (isDeliveredBefore)
                {
                    model.Message = "<p style='color:green'> This product Scanned  previous  delivery... </p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isValied && isInInventory)
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                Log.WriteErrorLog(exception);
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                Log.WriteErrorLog(exception);

                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }
        public void SaveScannedBarcodeToTextFile(string barcode, int invoiceId)
        {
            SuccessErrorModel model = new SuccessErrorModel();

            try
            {
                List <ViewBranchStockModel> products = (List <ViewBranchStockModel>)Session["Branch_stock"];
                var    id             = invoiceId;
                var    invoice        = _iInvoiceManager.GetInvoicedOrderByInvoiceId(id);
                string scannedBarCode = barcode.ToUpper();
                int    productId      = Convert.ToInt32(scannedBarCode.Substring(0, 3));
                string fileName       = "Ordered_Product_List_For_" + id;
                var    filePath       = Server.MapPath("~/Files/" + fileName);
                var    barcodeList    = _iProductManager.ScannedProducts(filePath);

                if (barcodeList.Count != 0)
                {
                    foreach (ScannedProduct scannedProduct in barcodeList)
                    {
                        var p = products.Find(n => n.ProductBarCode.Equals(scannedProduct.ProductCode));
                        products.Remove(p);
                        Session["Branch_stock"] = products;
                    }
                }

                // DateTime date = _iCommonManager.GenerateDateFromBarCode(scannedBarCode);
                // var oldestProducts = products.ToList().FindAll(n => n.ProductionDate < date && n.ProductId == productId).ToList();
                bool isInInventory   = products.Select(n => n.ProductBarCode).Contains(scannedBarCode);
                bool isScannedBefore = _iProductManager.IsScannedBefore(barcodeList, scannedBarCode);

                bool isSold = _iInventoryManager.IsThisProductSold(scannedBarCode);
                //------------Get invoced products-------------
                var invoicedOrders         = _iInvoiceManager.GetInvoicedOrderDetailsByInvoiceRef(invoice.InvoiceRef).ToList();
                List <InvoiceDetails> list = new List <InvoiceDetails>();
                var deliveredProducts      = _iInvoiceManager.GetDeliveredProductsByInvoiceRef(invoice.InvoiceRef);

                foreach (InvoiceDetails invoiceDetailse in invoicedOrders)
                {
                    var invoiceQty   = invoiceDetailse.Quantity;
                    var deliveredQty = deliveredProducts.ToList().FindAll(n => n.ProductId == invoiceDetailse.ProductId).Count;
                    if (invoiceQty != deliveredQty)
                    {
                        invoiceDetailse.Quantity = invoiceQty - deliveredQty;
                        list.Add(invoiceDetailse);
                    }
                }
                bool isValied        = list.Select(n => n.ProductId).Contains(productId);
                bool isScannComplete = list.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity) == barcodeList.FindAll(n => n.ProductId == productId).Count;
                if (isScannedBefore)
                {
                    model.Message = "<p style='color:red'> Already Scanned</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scan Completed.</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }

                //else if (oldestProducts.Count > 0)
                //{
                //    model.Message = "<p style='color:red'>There are total " + oldestProducts.Count + " Old product of this type .Please deliver those first .. </p>";
                //   // return Json(model, JsonRequestBehavior.AllowGet);
                //}
                else if (isSold)
                {
                    model.Message = "<p style='color:green'> This product Scanned for one of previous invoice... </p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isValied && isInInventory)
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }
Beispiel #7
0
        public void SaveScannedBarcodeToTextFile(string barcode, long tripId)
        {
            SuccessErrorModel model = new SuccessErrorModel();
            ViewWriteLogModel log   = new ViewWriteLogModel();

            try
            {
                var    products       = (List <ViewFactoryStockModel>)Session["Factory_Stock"];
                string scannedBarCode = barcode.ToUpper();
                int    productId      = Convert.ToInt32(scannedBarCode.Substring(0, 3));
                string fileName       = "Deliverable_Product_For_" + tripId;
                var    filePath       = Server.MapPath("~/Files/" + fileName);
                var    barcodeList    = _iProductManager.ScannedProducts(filePath);
                if (barcodeList.Count != 0)
                {
                    foreach (ScannedProduct scannedProduct in barcodeList)
                    {
                        var p = products.Find(n => n.ProductBarCode.Equals(scannedProduct.ProductCode));
                        products.Remove(p);
                        Session["Factory_Stock"] = products;
                    }
                }
                bool exists            = barcodeList.Select(n => n.ProductCode).Contains(scannedBarCode);
                bool isDeliveredBefore = _iInventoryManager.IsThisProductDispachedFromFactory(scannedBarCode);
                bool isInfactory       = products.ToList().Select(n => n.ProductBarCode).Contains(scannedBarCode);
                // DateTime date = _iCommonManager.GenerateDateFromBarCode(scannedBarCode);
                // var oldestProducts = products.ToList().FindAll(n=>n.ProductionDate<date && n.ProductId==productId).ToList();
                var issuedProducts = _iProductManager.GetDeliverableProductListByTripId(tripId);

                var isValied = Validator.ValidateProductBarCode(scannedBarCode);

                bool isContains      = issuedProducts.Select(n => n.ProductId).Contains(productId);
                int  reqQty          = issuedProducts.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity);
                int  scannedQty      = barcodeList.FindAll(n => Convert.ToInt32(n.ProductCode.Substring(0, 3)) == productId).Count;
                bool isScannComplete = reqQty.Equals(scannedQty);
                bool isComplete      = issuedProducts.Sum(n => n.Quantity).Equals(barcodeList.Count);

                if (!isContains)
                {
                    model.Message = "<p style='color:red'> Invalid Product Scanned.....</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }

                else if (exists)
                {
                    model.Message = "<p style='color:red'> Already Scanned.</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scan Completed.</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }

                //if (oldestProducts.Count > 0)
                //{
                //    model.Message = "<p style='color:red'>There are total "+oldestProducts.Count+" Old product of this type .Please deliver those first .. </p>";
                //    return Json(model, JsonRequestBehavior.AllowGet);
                //}
                else if (isValied && !isDeliveredBefore && isInfactory && !isComplete)
                {
                    var result = _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                    if (result.Contains("Added"))
                    {
                        var p = products.Find(n => n.ProductBarCode.Equals(scannedBarCode));
                        products.Remove(p);
                        Session["Factory_Stock"] = products;
                    }
                }
            }
            catch (FormatException exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>Invalid Barcode</p>";
                // return  Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                //return  Json(model, JsonRequestBehavior.AllowGet);
            }
            //return Json(model, JsonRequestBehavior.AllowGet);
        }
Beispiel #8
0
        public void SaveScannedBarcodeToTextFile(string barcode, long tripId)
        {
            SuccessErrorModel model = new SuccessErrorModel();
            ViewWriteLogModel log   = new ViewWriteLogModel();

            try
            {
                int    branchId       = Convert.ToInt32(Session["BranchId"]);
                var    scannedBarCode = barcode.ToUpper();
                int    productId      = Convert.ToInt32(scannedBarCode.Substring(0, 3));
                string fileName       = "Received_Product_For_" + tripId + branchId;
                var    filePath       = Server.MapPath("~/Files/" + fileName);

                //------------read Scanned barcode form text file---------
                var barcodeList = _iProductManager.GetScannedProductListFromTextFile(filePath).ToList();
                //------------Load receiveable product---------
                var receivesProductList     = _iInventoryManager.GetAllReceiveableProductToBranchByTripId(tripId, branchId);
                var receivesProductCodeList = _iInventoryManager.GetAllReceiveableItemsByTripAndBranchId(tripId, branchId).Select(n => n.ProductBarcode).ToList();
                var isvalid = Validator.ValidateProductBarCode(scannedBarCode);

                int requistionQtyByProductId = receivesProductList.ToList().FindAll(n => n.ProductId == productId).Sum(n => n.Quantity);

                int scannedQtyByProductId = barcodeList
                                            .FindAll(n => Convert.ToInt32(n.ProductCode.Substring(0, 3)) == productId).Count;

                bool isScannComplete = requistionQtyByProductId.Equals(scannedQtyByProductId);

                if (isScannComplete)
                {
                    model.Message = "<p style='color:green'> Scanned Complete</p>";
                    // return Json(model, JsonRequestBehavior.AllowGet);
                }
                else if (!isvalid)
                {
                    model.Message = "<p style='color:red'> Invalid Barcode</p>";
                    //return Json(model, JsonRequestBehavior.AllowGet);
                }

                else if (receivesProductCodeList.Contains(scannedBarCode))
                {
                    _iProductManager.AddProductToTextFile(scannedBarCode, filePath);
                }
            }
            catch (FormatException exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>" + exception.GetType() + "</p>";
                //return Json(model, JsonRequestBehavior.AllowGet);
            }
            catch (Exception exception)
            {
                log.Heading    = exception.GetType().ToString();
                log.LogMessage = exception.StackTrace;
                Log.WriteErrorLog(log);
                model.Message = "<p style='color:red'>" + exception.Message + "</p>";
                // return Json(model, JsonRequestBehavior.AllowGet);
            }
            // return Json(model, JsonRequestBehavior.AllowGet);
        }