예제 #1
0
        public static void SuaHDNCT(DTO_HDNCT hdnct)
        {
            SqlCommand cmd = new SqlCommand("sp_suaHDNCT", DataProvider.con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@mahdn", SqlDbType.VarChar, 50);
            cmd.Parameters.Add("@masp", SqlDbType.VarChar, 50);
            cmd.Parameters.Add("@sl", SqlDbType.VarChar, 100);
            cmd.Parameters.Add("@dongianhap", SqlDbType.VarChar, 100);
            cmd.Parameters.Add("@giamgia", SqlDbType.VarChar, 100);
            cmd.Parameters.Add("@thanhtien", SqlDbType.VarChar, 100);

            //Gan gia tri
            cmd.Parameters["@mahdn"].Value      = hdnct.Mahdn;
            cmd.Parameters["@masp"].Value       = hdnct.Masp;
            cmd.Parameters["@sl"].Value         = hdnct.Sl;
            cmd.Parameters["@dongianhap"].Value = hdnct.Dongianhap;
            cmd.Parameters["@giamgia"].Value    = hdnct.Giamgia;
            cmd.Parameters["@thanhtien"].Value  = hdnct.Thanhtien;

            if (DataProvider.con.State == ConnectionState.Closed)
            {
                DataProvider.con.Open();
            }
            cmd.ExecuteNonQuery();
            DataProvider.disconnect();
        }
예제 #2
0
 public static void suaHDNCT(DTO_HDNCT hdnct)
 {
     DAO_HDNCT.SuaHDNCT(hdnct);
 }
예제 #3
0
 public static void themHDNCT(DTO_HDNCT hdnct)
 {
     DAO_HDNCT.ThemHDNCT(hdnct);
 }