Example #1
0
 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;
 }
Example #2
0
    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");
    }
Example #5
0
    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;
    }
Example #6
0
    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");
    }
Example #8
0
    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);
        }
    }
Example #9
0
    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);
        }
    }
Example #10
0
    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");
    }
Example #11
0
 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);
     }
 }
Example #12
0
 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;
     }
 }
Example #13
0
    public static bool UpdatePos_Brand(Pos_Brand pos_Brand)
    {
        SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();

        return(sqlPos_BrandProvider.UpdatePos_Brand(pos_Brand));
    }
Example #14
0
    public static int InsertPos_Brand(Pos_Brand pos_Brand)
    {
        SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();

        return(sqlPos_BrandProvider.InsertPos_Brand(pos_Brand));
    }
Example #15
0
 public static bool UpdatePos_Brand(Pos_Brand pos_Brand)
 {
     SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();
     return sqlPos_BrandProvider.UpdatePos_Brand(pos_Brand);
 }
Example #16
0
    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;
        }
    }
Example #17
0
 public static int InsertPos_Brand(Pos_Brand pos_Brand)
 {
     SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();
     return sqlPos_BrandProvider.InsertPos_Brand(pos_Brand);
 }
Example #18
0
    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;
        }
    }