예제 #1
0
        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);
            }
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public linhvuc_ett(tbl_linhvuc lv)
 {
     malinhvuc  = lv.malinhvuc;
     tenlinhvuc = lv.tenlinhvuc;
 }
예제 #4
0
 public linhvuc_ett(tbl_linhvuc lv)
 {
     malinhvuc = lv.malinhvuc;
     tenlinhvuc = lv.tenlinhvuc;
 }