Exemplo n.º 1
0
        private void loadDataTable()
        {
            //SqlCommand cmd = new SqlCommand();
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.CommandText = "sp_SelectProduct";
            //cmd.Parameters.AddWithValue("@company_id", c_id);
            //cmd.Parameters.AddWithValue("@branch_id", b_id);
            //cmd.Connection = con;

            try
            {
                //con.Open();
                //DataSet ds = new DataSet();
                //SqlDataAdapter da = new SqlDataAdapter(cmd);
                //da.Fill(ds);
                GridView1.DataSource = context.sp_SelectProduct(companyId, branchId); //ds.Tables[0];
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
Exemplo n.º 2
0
 public void ddlproductbind()
 {
     //context.tbl_product.Where(x => x.status == true && x.company_id == c_id).ToList();
     ddlproduct.DataTextField  = "product_name";
     ddlproduct.DataValueField = "product_id";
     ddlproduct.DataSource     = context.sp_SelectProduct(companyId, branchId);
     ddlproduct.DataBind();
     ddlproduct.Items.Insert(0, new ListItem("--Select Product--", "0"));
 }