Пример #1
0
 public tacgia_ett(tbl_tacgia tg)
 {
     matacgia = tg.matg;
     tentacgia = tg.tentg;
     diachi = tg.diachi;
     gioitinh = tg.gioitinh;
 }
Пример #2
0
        public Result <bool> insert_tacgia(tacgia_ett tacgia)
        {
            Result <bool> rs = new Result <bool>();

            try
            {
                // create new tbl_tacgia to insert to database_context
                tbl_tacgia temp = new tbl_tacgia();
                temp.tentg    = tacgia.tentacgia;
                temp.gioitinh = tacgia.gioitinh;
                temp.diachi   = tacgia.diachi;

                db.tbl_tacgias.InsertOnSubmit(temp);
                db.SubmitChanges();

                rs.data    = true;
                rs.errcode = ErrorCode.sucess;
                return(rs);
            }
            catch (Exception e)
            {
                rs.data     = false;
                rs.errcode  = ErrorCode.fail;
                rs.errInfor = e.ToString();
                return(rs);
            }
        }
Пример #3
0
 public tacgia_ett(tbl_tacgia tg)
 {
     matacgia  = tg.matg;
     tentacgia = tg.tentg;
     diachi    = tg.diachi;
     gioitinh  = tg.gioitinh;
 }
Пример #4
0
        public Result<bool> insert_tacgia(tacgia_ett tacgia)
        {
            Result<bool> rs = new Result<bool>();

            try
            {
                // create new tbl_tacgia to insert to database_context
                tbl_tacgia temp = new tbl_tacgia();
                temp.tentg = tacgia.tentacgia;
                temp.gioitinh = tacgia.gioitinh;
                temp.diachi = tacgia.diachi;

                db.tbl_tacgias.InsertOnSubmit(temp);
                db.SubmitChanges();

                rs.data = true;
                rs.errcode = ErrorCode.sucess;
                return rs;
            }
            catch (Exception e)
            {
                rs.data = false;
                rs.errcode = ErrorCode.fail;
                rs.errInfor = e.ToString();
                return rs;
            }
        }