public nhaxuatban_ett(tbl_nxb nxb) { manxb = nxb.manxb; tennxb = nxb.tennxb; diachi = nxb.diachi; sdt = nxb.sdt; }
public Result <bool> insert_nhaxuatban(nhaxuatban_ett nhaxuatban) { Result <bool> rs = new Result <bool>(); try { // create new tbl_nhaxuatban to insert to database_context tbl_nxb temp = new tbl_nxb(); temp.tennxb = nhaxuatban.tennxb; temp.sdt = nhaxuatban.sdt; temp.diachi = nhaxuatban.diachi; db.tbl_nxbs.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); } }
public Result<bool> insert_nhaxuatban(nhaxuatban_ett nhaxuatban) { Result<bool> rs = new Result<bool>(); try { // create new tbl_nhaxuatban to insert to database_context tbl_nxb temp = new tbl_nxb(); temp.tennxb = nhaxuatban.tennxb; temp.sdt = nhaxuatban.sdt; temp.diachi = nhaxuatban.diachi; db.tbl_nxbs.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; } }