public static Pos_Brand GetPos_BrandByID(int id) { Pos_Brand pos_Brand = new Pos_Brand(); SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); pos_Brand = sqlPos_BrandProvider.GetPos_BrandByID(id); return pos_Brand; }
public static Pos_Brand GetPos_BrandByID(int id) { Pos_Brand pos_Brand = new Pos_Brand(); SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); pos_Brand = sqlPos_BrandProvider.GetPos_BrandByID(id); return(pos_Brand); }
private void showPos_BrandData() { Pos_Brand pos_Brand = new Pos_Brand(); pos_Brand = Pos_BrandManager.GetPos_BrandByID(Int32.Parse(Request.QueryString["pos_BrandID"])); txtBrandName.Text = pos_Brand.BrandName; txtDetails.Text = pos_Brand.Details; }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_Brand pos_Brand = new Pos_Brand(); pos_Brand.BrandName = txtBrandName.Text; pos_Brand.Details = txtDetails.Text; int resutl = Pos_BrandManager.InsertPos_Brand(pos_Brand); Response.Redirect("AdminPos_BrandDisplay.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_Brand pos_Brand = new Pos_Brand(); pos_Brand = Pos_BrandManager.GetPos_BrandByID(Int32.Parse(Request.QueryString["pos_BrandID"])); Pos_Brand tempPos_Brand = new Pos_Brand(); tempPos_Brand.Pos_BrandID = pos_Brand.Pos_BrandID; tempPos_Brand.BrandName = txtBrandName.Text; tempPos_Brand.Details = txtDetails.Text; bool result = Pos_BrandManager.UpdatePos_Brand(tempPos_Brand); Response.Redirect("AdminPos_BrandDisplay.aspx"); }
public int InsertPos_Brand(Pos_Brand pos_Brand) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_Brand", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_BrandID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@BrandName", SqlDbType.NVarChar).Value = pos_Brand.BrandName; cmd.Parameters.Add("@Details", SqlDbType.NText).Value = pos_Brand.Details; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Pos_BrandID"].Value); } }
public bool UpdatePos_Brand(Pos_Brand pos_Brand) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_Brand", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_BrandID", SqlDbType.Int).Value = pos_Brand.Pos_BrandID; cmd.Parameters.Add("@BrandName", SqlDbType.NVarChar).Value = pos_Brand.BrandName; cmd.Parameters.Add("@Details", SqlDbType.NText).Value = pos_Brand.Details; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public Pos_Brand GetPos_BrandFromReader(IDataReader reader) { try { Pos_Brand pos_Brand = new Pos_Brand ( (int)reader["Pos_BrandID"], reader["BrandName"].ToString(), reader["Details"].ToString() ); return(pos_Brand); } catch (Exception ex) { return(null); } }
public Pos_Brand GetPos_BrandFromReader(IDataReader reader) { try { Pos_Brand pos_Brand = new Pos_Brand ( (int)reader["Pos_BrandID"], reader["BrandName"].ToString(), reader["Details"].ToString() ); return pos_Brand; } catch(Exception ex) { return null; } }
public static bool UpdatePos_Brand(Pos_Brand pos_Brand) { SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); return(sqlPos_BrandProvider.UpdatePos_Brand(pos_Brand)); }
public static int InsertPos_Brand(Pos_Brand pos_Brand) { SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); return(sqlPos_BrandProvider.InsertPos_Brand(pos_Brand)); }
public static bool UpdatePos_Brand(Pos_Brand pos_Brand) { SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); return sqlPos_BrandProvider.UpdatePos_Brand(pos_Brand); }
public int InsertPos_Brand(Pos_Brand pos_Brand) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_Brand", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_BrandID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@BrandName", SqlDbType.NVarChar).Value = pos_Brand.BrandName; cmd.Parameters.Add("@Details", SqlDbType.NText).Value = pos_Brand.Details; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@Pos_BrandID"].Value; } }
public static int InsertPos_Brand(Pos_Brand pos_Brand) { SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider(); return sqlPos_BrandProvider.InsertPos_Brand(pos_Brand); }
public bool UpdatePos_Brand(Pos_Brand pos_Brand) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_Brand", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_BrandID", SqlDbType.Int).Value = pos_Brand.Pos_BrandID; cmd.Parameters.Add("@BrandName", SqlDbType.NVarChar).Value = pos_Brand.BrandName; cmd.Parameters.Add("@Details", SqlDbType.NText).Value = pos_Brand.Details; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }