public static Pos_Color GetPos_ColorByID(int id) { Pos_Color pos_Color = new Pos_Color(); SqlPos_ColorProvider sqlPos_ColorProvider = new SqlPos_ColorProvider(); pos_Color = sqlPos_ColorProvider.GetPos_ColorByID(id); return pos_Color; }
private void showPos_ColorData() { Pos_Color pos_Color = new Pos_Color(); pos_Color = Pos_ColorManager.GetPos_ColorByID(Int32.Parse(Request.QueryString["pos_ColorID"])); txtColorName.Text = pos_Color.ColorName; txtColorCode.Text = pos_Color.ColorCode; }
protected void btnAdd_Click(object sender, EventArgs e) { Pos_Color pos_Color = new Pos_Color(); pos_Color.ColorName = txtColorName.Text; pos_Color.ColorCode = txtColorCode.Text; int resutl = Pos_ColorManager.InsertPos_Color(pos_Color); Response.Redirect("AdminPos_ColorDisplay.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { Pos_Color pos_Color = new Pos_Color(); pos_Color = Pos_ColorManager.GetPos_ColorByID(Int32.Parse(Request.QueryString["pos_ColorID"])); Pos_Color tempPos_Color = new Pos_Color(); tempPos_Color.Pos_ColorID = pos_Color.Pos_ColorID; tempPos_Color.ColorName = txtColorName.Text; tempPos_Color.ColorCode = txtColorCode.Text; bool result = Pos_ColorManager.UpdatePos_Color(tempPos_Color); Response.Redirect("AdminPos_ColorDisplay.aspx"); }
public int InsertPos_Color(Pos_Color pos_Color) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_InsertPos_Color", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ColorID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@ColorName", SqlDbType.NVarChar).Value = pos_Color.ColorName; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Pos_ColorID"].Value); } }
public bool UpdatePos_Color(Pos_Color pos_Color) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdatePos_Color", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Pos_ColorID", SqlDbType.Int).Value = pos_Color.Pos_ColorID; cmd.Parameters.Add("@ColorName", SqlDbType.NVarChar).Value = pos_Color.ColorName; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public Pos_Color GetPos_ColorFromReader(IDataReader reader) { try { Pos_Color pos_Color = new Pos_Color ( (int)reader["Pos_ColorID"], reader["ColorName"].ToString() ); return(pos_Color); } catch (Exception ex) { return(null); } }
public static bool UpdatePos_Color(Pos_Color pos_Color) { SqlPos_ColorProvider sqlPos_ColorProvider = new SqlPos_ColorProvider(); return sqlPos_ColorProvider.UpdatePos_Color(pos_Color); }
public static int InsertPos_Color(Pos_Color pos_Color) { SqlPos_ColorProvider sqlPos_ColorProvider = new SqlPos_ColorProvider(); return sqlPos_ColorProvider.InsertPos_Color(pos_Color); }
public static bool UpdatePos_Color(Pos_Color pos_Color) { SqlPos_ColorProvider sqlPos_ColorProvider = new SqlPos_ColorProvider(); return(sqlPos_ColorProvider.UpdatePos_Color(pos_Color)); }
public static int InsertPos_Color(Pos_Color pos_Color) { SqlPos_ColorProvider sqlPos_ColorProvider = new SqlPos_ColorProvider(); return(sqlPos_ColorProvider.InsertPos_Color(pos_Color)); }