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 DataSet BindSupplier(string prefix)
        {
            DataSet ds = new DataSet();

            try
            {
                KeystoneProject.Models.Pharmacy.Purchase obj = new Models.Pharmacy.Purchase();
                Connect();
                SqlCommand cmd = new SqlCommand("select ProductSupplierID , ProductSupplierName , ShortName ,ProductSupplier.Address ,DLNo,FoodLicNo,CreditDay,ProductSupplier.CSTNo,ProductSupplier.TINDate,Accounts.AccountName ,ContactPerson from  ProductSupplier  left join Accounts On Accounts.AccountsID = ProductSupplier.AccountsID where  ProductSupplier.RowStatus = 0  and ProductSupplierName  like '" + prefix + "%" + "' and ProductSupplier.HospitalID = " + HospitalID + "  and ProductSupplier.LocationID = " + LocationID + "  order by ProductSupplierName asc", con);
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);
                con.Close();
            }
            catch (Exception ex)
            {
            }
            return(ds);
        }
        public DataSet BindBatchNoOfProduct(string ProductID)
        {
            DataSet ds = new DataSet();

            try
            {
                KeystoneProject.Models.Pharmacy.Purchase obj = new Models.Pharmacy.Purchase();
                Connect();
                SqlCommand cmd = new SqlCommand("select ProductDetailsID ,BatchNo,ExpiryDate, PurchaseRate,MRP,SalesRate,CurrentStock ,CurrentStock1,ProductDetails.BarCode  from ProductDetails left join Product  on  Product .ProductID = ProductDetails.ProductID where Product.HospitalID = " + HospitalID + " and Product.LocationID = " + LocationID + " and ProductDetails.ProductID =" + ProductID + "  and ProductDetails.RowStatus = 0 order by ExpiryDate asc", con);
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds);
                con.Close();
            }
            catch (Exception ex)
            {
            }
            return(ds);
        }