コード例 #1
0
        private ctLothuoc getLothuocupdate(int i)
        {
            ctLothuoc c = new ctLothuoc();

            c.Mathuoc   = dg_ctiet.Rows[i].Cells[0].Value.ToString().Trim();
            c.Soluong   = dg_ctiet.Rows[i].Cells[2].Value.ToString().Trim();
            c.Solothuoc = dg_ctiet.Rows[i].Cells[6].Value.ToString().Trim();

            return(c);
        }
コード例 #2
0
        private ctLothuoc getCTLoThuoc(int i)
        {
            ctLothuoc l = new ctLothuoc();

            l.Solothuoc = txt_solo.Text;
            l.Mathuoc   = dg_ctiet.Rows[i].Cells[0].Value.ToString().Trim();
            l.Soluong   = dg_ctiet.Rows[i].Cells[2].Value.ToString().Trim();
            l.NgaySX    = dg_ctiet.Rows[i].Cells[4].Value.ToString().Trim();
            l.HanSD     = dg_ctiet.Rows[i].Cells[5].Value.ToString().Trim();
            l.Gianhap   = dg_ctiet.Rows[i].Cells[3].Value.ToString().Trim();
            return(l);
        }
コード例 #3
0
        public void delete(ctLothuoc c)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_delete_ctLothuoc", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@solothuoc", c.Solothuoc));

            cmd.ExecuteNonQuery();

            closeC();
        }
コード例 #4
0
        public void insert(ctLothuoc c)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_insert_ctLothuoc", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@solothuoc", c.Solothuoc));
            cmd.Parameters.Add(new SqlParameter("@mathuoc", c.Mathuoc));
            cmd.Parameters.Add(new SqlParameter("@soluong", c.Soluong));
            cmd.Parameters.Add(new SqlParameter("@ngaySX", c.NgaySX));
            cmd.Parameters.Add(new SqlParameter("@hanSD", c.HanSD));
            cmd.Parameters.Add(new SqlParameter("@gianhap", c.Gianhap));

            cmd.ExecuteNonQuery();

            closeC();
        }
コード例 #5
0
 public void delete(ctLothuoc c)
 {
     ct.delete(c);
 }
コード例 #6
0
 public void update(ctLothuoc c)
 {
     ct.update(c);
 }
コード例 #7
0
 public void insert(ctLothuoc c)
 {
     ct.insert(c);
 }