Beispiel #1
0
        public IHttpActionResult Putinfo(string id, info info)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != info.User_Name)
            {
                return(BadRequest());
            }

            db.Entry(info).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!infoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutPersonal(int id, Personal personal)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != personal.Emp_No)
            {
                return(BadRequest());
            }

            db.Entry(personal).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PersonalExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public ActionResult details(string name, string phone, string email, string address, string landmark, string pin, string log_phone)
        {
            Detail det = new Detail();

            det.Name      = name;
            det.Phone     = phone;
            det.Email     = email;
            det.Address   = address;
            det.Landmark  = landmark;
            det.pin       = pin;
            det.log_phone = log_phone;

            db3.Details.Add(det);
            db3.SaveChanges();

            return(View());
        }