public Result <bool> insert_linhvuc(linhvuc_ett linhvuc) { Result <bool> rs = new Result <bool>(); try { // create new tbl_linhvuc to insert to database_context tbl_linhvuc temp = new tbl_linhvuc(); temp.tenlinhvuc = linhvuc.tenlinhvuc; db.tbl_linhvucs.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_linhvuc(linhvuc_ett linhvuc) { Result<bool> rs = new Result<bool>(); try { // create new tbl_linhvuc to insert to database_context tbl_linhvuc temp = new tbl_linhvuc(); temp.tenlinhvuc = linhvuc.tenlinhvuc; db.tbl_linhvucs.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 linhvuc_ett(tbl_linhvuc lv) { malinhvuc = lv.malinhvuc; tenlinhvuc = lv.tenlinhvuc; }