Example #1
0
        public static void ThemBaoCao(BC_DOANHSO baoCao)
        {
            DataAccessHelper db  = new DataAccessHelper();
            SqlCommand       cmd = db.Command("THEMBCDS");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@MABC", baoCao.MaBaoCaoDoanhSo);
            cmd.Parameters.AddWithValue("@THANG", baoCao.Thang);
            cmd.Parameters.AddWithValue("@NAM", baoCao.Nam);

            SqlDataAdapter da = new SqlDataAdapter(cmd);

            db.dt = new DataTable();
            da.Fill(db.dt);
        }
Example #2
0
        public static string GetMaBaoCao(int thang, int nam)
        {
            DataAccessHelper db  = new DataAccessHelper();
            SqlCommand       cmd = db.Command("GETBAOCAODOANHSO");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@THANG", thang);
            cmd.Parameters.AddWithValue("@NAM", nam);

            SqlDataAdapter da = new SqlDataAdapter(cmd);

            db.dt = new DataTable();
            da.Fill(db.dt);

            foreach (DataRow row in db.dt.Rows)
            {
                return(row.ItemArray[0].ToString());
            }
            return("");
        }