Пример #1
0
 public nhaxuatban_ett(tbl_nxb nxb)
 {
     manxb  = nxb.manxb;
     tennxb = nxb.tennxb;
     diachi = nxb.diachi;
     sdt    = nxb.sdt;
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public nhaxuatban_ett(tbl_nxb nxb)
 {
     manxb = nxb.manxb;
     tennxb = nxb.tennxb;
     diachi = nxb.diachi;
     sdt = nxb.sdt;
 }
Пример #4
0
        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;
            }
        }