コード例 #1
0
        protected void grvLoaiHD_InsertCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item   = e.Item as GridEditableItem;
            Hashtable        values = new Hashtable();

            item.ExtractValues(values);
            LoaiHopDong obj = new LoaiHopDong();

            obj.NgayTao  = obj.NgayCapNhat = DateTime.Now;
            obj.NguoiTao = obj.NguoiCapNhat = idNhanVien;
            item.UpdateValues(obj);
            _entities.AddToLoaiHopDongs(obj);
            _entities.SaveChanges();
        }