public static Pos_SizeProduct GetPos_SizeProductByID(int id) { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); pos_SizeProduct = sqlPos_SizeProductProvider.GetPos_SizeProductByID(id); return pos_SizeProduct; }
public static Pos_SizeProduct GetPos_SizeProductByID(int id) { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); pos_SizeProduct = sqlPos_SizeProductProvider.GetPos_SizeProductByID(id); return(pos_SizeProduct); }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); pos_SizeProduct.Pos_SizeID = Int32.Parse(ddlPos_Size.SelectedValue); pos_SizeProduct.ProductID = Int32.Parse(ddlProduct.SelectedValue); int resutl = Pos_SizeProductManager.InsertPos_SizeProduct(pos_SizeProduct); Response.Redirect("AdminPos_SizeProductDisplay.aspx"); }
private void showPos_SizeProductData() { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); pos_SizeProduct = Pos_SizeProductManager.GetPos_SizeProductByID(Int32.Parse(Request.QueryString["pos_SizeProductID"])); ddlPos_Size.SelectedValue = pos_SizeProduct.Pos_SizeID.ToString(); ddlProduct.SelectedValue = pos_SizeProduct.ProductID.ToString(); }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); pos_SizeProduct = Pos_SizeProductManager.GetPos_SizeProductByID(Int32.Parse(Request.QueryString["pos_SizeProductID"])); Pos_SizeProduct tempPos_SizeProduct = new Pos_SizeProduct(); tempPos_SizeProduct.Pos_SizeProductID = pos_SizeProduct.Pos_SizeProductID; tempPos_SizeProduct.Pos_SizeID = Int32.Parse(ddlPos_Size.SelectedValue); tempPos_SizeProduct.ProductID = Int32.Parse(ddlProduct.SelectedValue); bool result = Pos_SizeProductManager.UpdatePos_SizeProduct(tempPos_SizeProduct); Response.Redirect("AdminPos_SizeProductDisplay.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct(); pos_SizeProduct.Pos_SizeID = Int32.Parse(ddlPos_Size.SelectedValue); pos_SizeProduct.ProductID = Int32.Parse(ddlProduct.SelectedValue); int resutl = Pos_SizeProductManager.InsertPos_SizeProduct(pos_SizeProduct); showPos_SizeProductGrid(); lblMsg.Text = "Added Successfully"; lblMsg.ForeColor = System.Drawing.Color.Green; //Response.Redirect("AdminPos_SizeProductDisplay.aspx"); }
public bool UpdatePos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_SizeProduct", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_SizeProductID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeProductID; cmd.Parameters.Add("@Pos_SizeID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_SizeProduct.ProductID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public int InsertPos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_SizeProduct", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_SizeProductID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@Pos_SizeID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_SizeProduct.ProductID; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Pos_SizeProductID"].Value); } }
public Pos_SizeProduct GetPos_SizeProductFromReader(IDataReader reader) { try { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct ( (int)reader["Pos_SizeProductID"], (int)reader["Pos_SizeID"], (int)reader["ProductID"] ); return pos_SizeProduct; } catch(Exception ex) { return null; } }
public Pos_SizeProduct GetPos_SizeProductFromReader(IDataReader reader) { try { Pos_SizeProduct pos_SizeProduct = new Pos_SizeProduct ( (int)reader["Pos_SizeProductID"], (int)reader["Pos_SizeID"], (int)reader["ProductID"] ); return(pos_SizeProduct); } catch (Exception ex) { return(null); } }
public bool UpdatePos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_SizeProduct", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_SizeProductID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeProductID; cmd.Parameters.Add("@Pos_SizeID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_SizeProduct.ProductID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public int InsertPos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_SizeProduct", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_SizeProductID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@Pos_SizeID", SqlDbType.Int).Value = pos_SizeProduct.Pos_SizeID; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = pos_SizeProduct.ProductID; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@Pos_SizeProductID"].Value; } }
public static int InsertPos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); return(sqlPos_SizeProductProvider.InsertPos_SizeProduct(pos_SizeProduct)); }
public static bool UpdatePos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); return(sqlPos_SizeProductProvider.UpdatePos_SizeProduct(pos_SizeProduct)); }
public static bool UpdatePos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); return sqlPos_SizeProductProvider.UpdatePos_SizeProduct(pos_SizeProduct); }
public static int InsertPos_SizeProduct(Pos_SizeProduct pos_SizeProduct) { SqlPos_SizeProductProvider sqlPos_SizeProductProvider = new SqlPos_SizeProductProvider(); return sqlPos_SizeProductProvider.InsertPos_SizeProduct(pos_SizeProduct); }