コード例 #1
0
ファイル: Pos_BrandManager.cs プロジェクト: anam/gp-HO
 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;
 }
コード例 #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);
    }
コード例 #3
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;
    }
コード例 #4
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");
    }
コード例 #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;
    }
コード例 #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");
    }
コード例 #7
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");
    }
コード例 #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);
        }
    }
コード例 #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);
        }
    }
コード例 #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");
    }
コード例 #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);
     }
 }
コード例 #12
0
ファイル: SqlPos_BrandProvider.cs プロジェクト: anam/gp-HO
 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;
     }
 }
コード例 #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));
    }
コード例 #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));
    }
コード例 #15
0
ファイル: Pos_BrandManager.cs プロジェクト: anam/gp-HO
 public static bool UpdatePos_Brand(Pos_Brand pos_Brand)
 {
     SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();
     return sqlPos_BrandProvider.UpdatePos_Brand(pos_Brand);
 }
コード例 #16
0
ファイル: SqlPos_BrandProvider.cs プロジェクト: anam/gp-HO
    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;
        }
    }
コード例 #17
0
ファイル: Pos_BrandManager.cs プロジェクト: anam/gp-HO
 public static int InsertPos_Brand(Pos_Brand pos_Brand)
 {
     SqlPos_BrandProvider sqlPos_BrandProvider = new SqlPos_BrandProvider();
     return sqlPos_BrandProvider.InsertPos_Brand(pos_Brand);
 }
コード例 #18
0
ファイル: SqlPos_BrandProvider.cs プロジェクト: anam/gp-HO
    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;
        }
    }