Esempio n. 1
0
 public void AddOutbond(Outbond user)
 {
     using (DBOutbondEntities1 db = new DBOutbondEntities1())
     {
         outbond OU = new outbond();
         OU.keterangan = user.keterangan;
         OU.harga      = user.harga;
         db.outbonds.Add(OU);
         db.SaveChanges();
     }
 }
Esempio n. 2
0
        public Outbond GetAllOutbond(string loginName)
        {
            Outbond                    GAO      = new Outbond();
            List <Outbond>             profiles = GetAllOutbond();
            List <LOOKUPAvailableRole> roles    = GetAllRoles();
            int?   userID     = 0;
            string userGender = string.Empty;

            userID = GetUserID(loginName);


            GAO.UserProfile = profiles;
            return(GAO);
        }
Esempio n. 3
0
 public ActionResult Outbond(Outbond PUV)
 {
     if (ModelState.IsValid)
     {
         UserManager UM = new UserManager();
         if (!UM.IsLoginNameExist(PUV.keterangan))
         {
             UM.AddOutbond(PUV);
             FormsAuthentication.SetAuthCookie(PUV.keterangan, false);
             return(RedirectToAction("Welcome", "Home"));
         }
         else
         {
             ModelState.AddModelError("", "Book Name already taken.");
         }
     }
     return(View());
 }
Esempio n. 4
0
        public List <Outbond> GetAllOutbond()
        {
            List <Outbond> profiles = new List <Outbond>();

            using (DBOutbondEntities1 db = new DBOutbondEntities1())
            {
                Outbond UPV;
                var     users = db.outbonds.ToList();
                foreach (outbond u in db.outbonds)
                {
                    UPV            = new Outbond();
                    UPV.keterangan = u.keterangan;
                    UPV.harga      = u.harga;


                    profiles.Add(UPV);
                }
            }
            return(profiles);
        }