Пример #1
0
        //[System.Web.Services.WebMethod]
        //public static string CheckDouble(string useroremail, string productid)
        //{
        //    try
        //    {
        //        if (HttpContext.Current.Session["company_id"] != null)
        //        {
        //            SqlHelper helper = new SqlHelper();
        //            int data = helper.GetStockQuantity(Convert.ToInt32(HttpContext.Current.Session["company_id"]), Convert.ToInt32(productid));

        //            if (data < Convert.ToInt32(useroremail))
        //            {

        //                return "true";
        //            }
        //            else
        //            {
        //                return "false";
        //            }
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        ErrorLog.saveerror(ex);
        //    }
        //    return "true";
        //}
        public void batchbind(int product_id)
        {
            ddlBatch.DataTextField  = "batch_name";
            ddlBatch.DataValueField = "batch_id";
            var batchs = context.sp_selectbatchbyproduct(companyId, branchId, product_id);

            ddlBatch.DataSource = batchs;
            ddlBatch.DataBind();
            ddlBatch.Items.Insert(0, new ListItem("--Select Batch--", "0"));
            if (batchs == null)
            {
                //TODO
                lblbatcherror.Text = "No purchase for the product";
            }
            else
            {
                lblbatcherror.Text = string.Empty;
            }
        }