public JsonResult GetProductSupplier(string ProductSupplierID)
        {
            BL_Purchase db = new BL_Purchase();

            DataSet dsBalance = new DataSet();
            DataSet ds        = new DataSet();

            dsBalance = objbl.GetProductSupplier(ProductSupplierID);
            ds        = objbl.GetProductSupplier(ProductSupplierID);
            List <Purchase> searchlist = new List <Purchase>();


            foreach (DataRow dr in dsBalance.Tables[0].Rows)
            {
                searchlist.Add(new Purchase
                {
                    ProductSupplierID   = Convert.ToString(dr["ProductSupplierID"]),
                    ProductSupplierName = Convert.ToString(dr["ProductSupplierName"]),
                    Address             = Convert.ToString(dr["Address"]),

                    Balance = dsBalance.Tables[1].Rows[0]["Balance"].ToString(),
                });
            }


            return(new JsonResult {
                Data = searchlist, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public ActionResult AjaxMethod_CheckProduct(string productNameID1, FormCollection fc)
        {
            KeystoneProject.Buisness_Logic.Pharmacy.BL_Purchase BL_obj = new BL_Purchase();
            KeystoneProject.Models.Pharmacy.Purchase            obj    = new Purchase();
            List <string> searchList = new List <string>();

            try
            {
                DataTable dt = new DataTable();
                DataSet   ds = BL_obj.Bind_Newproductdetail("%", productNameID1);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    dt = BL_obj.Bind_PackQtyRate(Convert.ToInt16(ds.Tables[0].Rows[0]["ProductID"].ToString()));
                    obj.HSNSACCode1 = dt.Rows[0]["HSNSACCode"].ToString();
                    obj.gst1        = dt.Rows[0]["GST"].ToString();
                    obj.sgst1       = dt.Rows[0]["SGST"].ToString();
                    obj.cgst1       = dt.Rows[0]["CGST"].ToString();
                    obj.utgst1      = dt.Rows[0]["UTGST"].ToString();

                    searchList.Add(obj.HSNSACCode1);
                    searchList.Add(obj.gst1);
                    searchList.Add(obj.sgst1);
                    searchList.Add(obj.cgst1);
                    searchList.Add(obj.utgst1);
                }
                return(Json(searchList));
            }
            catch (Exception ex)
            {
                return(Json(searchList));
            }
        }
        public JsonResult Delete_Purchase(int ProductPurchaseID)
        {
            string _Del = null;

            try
            {
                KeystoneProject.Buisness_Logic.Pharmacy.BL_Purchase objdb = new BL_Purchase();
                Purchase objSG = new Models.Pharmacy.Purchase();

                int DependaincyName = objdb.DeletePurchase(ProductPurchaseID);

                if (DependaincyName > 0)
                {
                    _Del = "Purchase Deleted Successfully !";
                }
                else
                {
                    _Del = "Purchase Can not be Deleted !";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(new JsonResult {
                Data = _Del, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public JsonResult GetProductPurchaseOLDBillsNO(string ProductSupplierID)
        {
            BL_Purchase db = new BL_Purchase();

            DataSet dsBalance = new DataSet();
            DataSet ds        = new DataSet();

            dsBalance = objbl.GetProductPurchaseOLDBillsNO(ProductSupplierID);
            ds        = objbl.GetProductPurchaseOLDBillsNO(ProductSupplierID);
            List <Purchase> searchlist = new List <Purchase>();


            foreach (DataRow dr in dsBalance.Tables[0].Rows)
            {
                searchlist.Add(new Purchase
                {
                    ProductSupplierID = Convert.ToString(dr["ProductSupplierID"]),
                    BillNo            = Convert.ToString(dr["BillNo"]),
                    BillNoDate        = Convert.ToString(dr["BillNo&Date"]),
                });
            }


            return(new JsonResult {
                Data = searchlist, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }