Beispiel #1
0
 public ActionResult Edit(PersonCL.Person person)
 {
     try
     {
         repository.Update(person);
     }
     catch
     {
         throw new ArgumentException("No such field in the DB");
     }
     return RedirectToAction("Index");
 }
Beispiel #2
0
 public ActionResult Delete(PersonCL.Person person)
 {
     Person.Models.PersonViewModel per = new Models.PersonViewModel() { Id = person.ID, Age = person.Age, FirstName = person.FirstName, LastName = person.LastName };
     return View(per);
 }
Beispiel #3
0
 public ActionResult AddPerson(PersonCL.Person person)
 {
     repository.Create(person);
     return RedirectToAction("Index");
 }
        public object PersonsSynchronous(PersonSysn person)
        {
            if (!ModelState.IsValid)
            {
                return(operateContext.RedirectWebApi(WebResultCode.Exception, GlobalConstant.参数异常.ToString(), null));
            }

            var data = operateContext.bllSession.A01.PersonsSynchronous(person.match_timestamp, person.orgid, person.userid, person.deviceid);

            if (data == null)
            {
                return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.操作成功.ToString(), "没有需要同步的数据!"));
            }
            List <PersonCL> userList = new List <PersonCL>();
            PersonCL        user     = new PersonCL();

            foreach (var item in data)
            {
                user                = new PersonCL();
                user.orgid          = person.orgid;
                user.personid       = item.PersonID;
                user.person_name    = item.A0101;
                user.person_sex     = item.A0107;
                user.person_nation  = item.A0121;
                user.person_cardno  = item.A0177;
                user.person_address = item.A0115;
                user.iris_data      = item.A0118;
                user.big_iris_data  = item.big_iris_data;
                user.person_police  = item.A0112;

                if (!string.IsNullOrEmpty(item.A0111.ToString()))
                {
                    user.person_birthday = System.Convert.ToDateTime(item.A0111).ToString("yyyy-MM-dd");
                }
                else
                {
                    user.person_birthday = "";
                }

                if (!string.IsNullOrEmpty(item.A0116.ToString()))
                {
                    user.person_userlifebegin = System.Convert.ToDateTime(item.A0116).ToString("yyyy-MM-dd");
                }
                else
                {
                    user.person_userlifebegin = "";
                }

                if (!string.IsNullOrEmpty(item.A0117.ToString()))
                {
                    user.person_userlifeend = System.Convert.ToDateTime(item.A0117).ToString("yyyy-MM-dd");
                }
                else
                {
                    user.person_userlifeend = "";
                }

                if (item.PersonPhoto != null)
                {
                    user.person_photo = System.Convert.ToBase64String(item.PersonPhoto);
                }
                else
                {
                    user.person_photo = "";
                }

                userList.Add(user);
            }
            return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.操作成功.ToString(), userList));
        }