public bool CapNhatSummaryDetail(SummarydetailDTO sum)
        {
            string sql = "sp_Summary_Detail_Update";
            List<SqlParameter> ds = new List<SqlParameter>();
            SqlParameter idsum = new SqlParameter("@idsummary", SqlDbType.Int);
            idsum.Value = sum.MaSummary;
            ds.Add(idsum);
            SqlParameter idsumd = new SqlParameter("@idsummarydetail", SqlDbType.Int);
            idsumd.Value = sum.MaSummaryDetail;
            ds.Add(idsumd);
            SqlParameter hangmuc = new SqlParameter("@tenhangmuc", SqlDbType.NVarChar);
            hangmuc.Value = sum.TenHangMuc;
            ds.Add(hangmuc);
            SqlParameter GTkhieunai = new SqlParameter("@giatrikhieunai", SqlDbType.Float);
            GTkhieunai.Value = sum.GiaTriKhieuNai;
            ds.Add(GTkhieunai);
            SqlParameter sl = new SqlParameter("@soluong", SqlDbType.Int);
            sl.Value = sum.SoLuong;
            ds.Add(sl);
            SqlParameter thiethai = new SqlParameter("@thiethaihoply", SqlDbType.Float); ;
            thiethai.Value = sum.ThietHaiHopLy;
            ds.Add(thiethai);
            SqlParameter dexuat = new SqlParameter("@dexuattinhtoan", SqlDbType.Float);
            dexuat.Value = sum.DeXuatTinhToan;
            ds.Add(dexuat);
            SqlParameter ghichu = new SqlParameter("@ghichu", SqlDbType.NVarChar);
            ghichu.Value = sum.GhiChu;
            ds.Add(ghichu);

            return SqlDataAcessHelper.exNonStoreParas(sql, ds);
        }
        public bool Them_Building(SummarydetailDTO sum)
        {
            string sql= "sp_SummaryBuilding_Them";
            List<SqlParameter> ds= new List<SqlParameter>();
            SqlParameter idsum = new SqlParameter("@idsum",SqlDbType.Int);
            idsum.Value = sum.MaSummary;
            ds.Add(idsum);

            SqlParameter idtheloai = new SqlParameter("@idtheloai", SqlDbType.Int);
            idtheloai.Value = sum.MaTheLoai;
            ds.Add(idtheloai);
            SqlParameter hangmuc = new SqlParameter("@hangmuc",SqlDbType.NVarChar);
            hangmuc.Value = sum.TenHangMuc;
            ds.Add(hangmuc);
            SqlParameter GTkhieunai = new SqlParameter("@giatrikhieunai", SqlDbType.Float);
            GTkhieunai.Value = sum.GiaTriKhieuNai;
            ds.Add(GTkhieunai);

            SqlParameter ghichu = new SqlParameter("@ghichu",SqlDbType.NVarChar);
            ghichu.Value = sum.GhiChu;
            ds.Add(ghichu);
            return SqlDataAcessHelper.exNonStoreParas(sql, ds);
        }
        public bool ThemStock(SummarydetailDTO s)
        {
            string sql="sp_Summary_InsertS";
            List<SqlParameter>ds= new List<SqlParameter>();
            SqlParameter idsum = new SqlParameter("@idsum", SqlDbType.Int);
            idsum.Value = s.MaSummary;
            ds.Add(idsum);

            SqlParameter theloai = new SqlParameter("@idtheloaisum", SqlDbType.Int);
            theloai.Value = s.MaTheLoai;
            ds.Add(theloai);

            SqlParameter hangmuc = new SqlParameter("@hangmuc", SqlDbType.NVarChar);
            hangmuc.Value = s.TenHangMuc;
            ds.Add(hangmuc);

            SqlParameter giatrikhieunai = new SqlParameter("@giatrikhieunai", SqlDbType.Float);
            giatrikhieunai.Value = s.GiaTriKhieuNai;
            ds.Add(giatrikhieunai);

            SqlParameter solong = new SqlParameter("@soluong", SqlDbType.Int);
            solong.Value = s.SoLuong;
            ds.Add(solong);

            SqlParameter ghichu = new SqlParameter("@ghichu", SqlDbType.NVarChar);
            ghichu.Value = s.GhiChu;
            ds.Add(ghichu);

            return SqlDataAcessHelper.exNonStoreParas(sql, ds);
        }
 bool CapNhatSum(GridViewRow row, int idsumd)
 {
     //string id = Request.QueryString["Reference"];
     //string id = Session["ThamChieu"].ToString();
     string id = lblThamChieu.Text;
     TextBox tenhangmuc = row.Cells[1].Controls[0] as TextBox;
     TextBox giatrikhieunai = row.Cells[2].Controls[0] as TextBox;
     TextBox soluong = row.Cells[3].Controls[0] as TextBox;
     TextBox thiethaihoply = row.Cells[4].Controls[0] as TextBox;
     TextBox dexuattinhtoan = row.Cells[5].Controls[0] as TextBox;
     TextBox ghichu = row.Cells[7].Controls[0] as TextBox;
     SummarydetailDTO smddt = new SummarydetailDTO();
     int masum = LayMaSummary(id);
     smddt.MaSummary = masum;
     smddt.MaSummaryDetail = idsumd;
     smddt.TenHangMuc = tenhangmuc.Text;
     smddt.GiaTriKhieuNai = float.Parse(giatrikhieunai.Text);
     smddt.ThietHaiHopLy = float.Parse(thiethaihoply.Text);
     smddt.SoLuong = int.Parse(soluong.Text);
     smddt.DeXuatTinhToan = float.Parse(dexuattinhtoan.Text);
     smddt.GhiChu = ghichu.Text;
     return smddao.CapNhatSummaryDetail(smddt);
 }