Exemplo n.º 1
0
        public bool UpdatePersonStatus(PersonReport personDetails)
        {
            bool isUpdated = false;

            try
            {
                using (EVO_PersonDBEntities context = new EVO_PersonDBEntities())
                {
                    Person person = (from P in context.Person
                                     where P.ID == personDetails.PersonID
                                     select P).FirstOrDefault();
                    if (person != null)
                    {
                        person.IsActive = personDetails.IsActive;
                        context.SaveChanges();
                        isUpdated = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(isUpdated);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 生成个体报告
        /// </summary>
        public long ReportInsert(int UID, string Record, string AnswerJson, string Acode, string AName, AnswerAddEntity entityInfo)
        {
            try
            {
                long ss = -1;
                WebPages.projrem.PersonReport obj = new PersonReport(Acode, AnswerJson, Record, AName, entityInfo._answeradd_score);
                WebPages.DistributeRecordService.R_ReportEntity entityInfos = new WebPages.DistributeRecordService.R_ReportEntity();
                string strjosn = JsonConvert.SerializeObject(obj);
                entityInfos._reportjson = strjosn;
                entityInfos._createuid  = UID;

                //entityInfo._answeid = answerid;
                entityInfos._r_createdate = DateTime.Now;
                if (obj.DimensionEntitys != null && obj.UserINfos != null)
                {
                    ss = MgrServices.DistributeRecordService.InsetsAnswerPTwo(entityInfo, entityInfos);
                }
                else
                {
                    throw new CustomException("添加出错", " ReportInsert", "添加我的测验");
                }



                return(ss);
            }
            catch (Exception ex)
            {
                throw new CustomException(ex.Message, "long ReportInsert(int UID, string Record, string AnswerJson, string Acode, string AName, AnswerAddEntity entityInfo)", "生成个体报告");;
            }
        }
Exemplo n.º 3
0
        public bool AddPerson(PersonReport personDetails)
        {
            PersonProvider provider = null;
            bool           isAdded  = false;

            try
            {
                provider = new PersonProvider();
                isAdded  = provider.AddPerson(personDetails);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(isAdded);
        }
Exemplo n.º 4
0
        public bool UpdatePersonStatus(PersonReport personDetails)
        {
            bool isUpdated = false;

            PersonProvider provider = null;

            try
            {
                provider  = new PersonProvider();
                isUpdated = provider.UpdatePersonStatus(personDetails);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(isUpdated);
        }
Exemplo n.º 5
0
        public ActionResult UpdatePerson(PersonReport person)
        {
            PersonManager manager = null;
            bool          isAdded = false;

            try
            {
                manager = new PersonManager();
                isAdded = manager.UpdatePerson(person);
            }
            catch (Exception ex)
            {
                throw;
            }

            return(Json(isAdded, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public bool UpdatePerson(PersonReport personDetails)
        {
            bool          isUpdated     = false;
            PersonContact personContact = null;

            try
            {
                using (EVO_PersonDBEntities context = new EVO_PersonDBEntities())
                {
                    Person person = (from P in context.Person
                                     where P.ID == personDetails.PersonID
                                     select P).FirstOrDefault();

                    if (person != null)
                    {
                        person.FirstName = personDetails.FirstName;
                        person.LastName  = personDetails.LastName;
                        person.Gender    = personDetails.Gender;
                        //  person.DateOfBirth = personDetails.DateOfBirth;
                        personDetails.IsActive = personDetails.IsActive;

                        context.SaveChanges();

                        personContact = new PersonContact();


                        personContact.PersonID         = person.ID;
                        personContact.EmailAddress     = personDetails.EmailAddress;
                        personContact.PrimaryContactNo = personDetails.PhoneNumber;

                        UpdatePersonContact(personContact);


                        isUpdated = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(isUpdated);
        }
Exemplo n.º 7
0
        public bool AddPerson(PersonReport personDetails)
        {
            bool          isAdded       = false;
            Person        person        = null;
            PersonContact personContact = null;

            try
            {
                using (EVO_PersonDBEntities context = new EVO_PersonDBEntities())
                {
                    person = new Person();

                    person.FirstName = personDetails.FirstName;
                    person.LastName  = personDetails.LastName;
                    person.Gender    = personDetails.Gender;
                    //       person.DateOfBirth = personDetails.DateOfBirth;
                    person.IsActive     = personDetails.IsActive;
                    person.CreatedBy    = 0;
                    person.ModifiedBy   = 0;
                    person.CreatedDate  = DateTime.UtcNow;
                    person.ModifiedDate = DateTime.UtcNow;

                    context.Person.Add(person);
                    context.SaveChanges();

                    personContact = new PersonContact();


                    personContact.PersonID         = person.ID;
                    personContact.EmailAddress     = personDetails.EmailAddress;
                    personContact.PrimaryContactNo = personDetails.PhoneNumber;
                    AddPersonContact(personContact);

                    isAdded = true;
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(isAdded);
        }
        public void UpdateReportInsert(string Acode, string AnswerJson, string Record, string AName, int Score, out string strjosn)
        {
            WebPages.projrem.PersonReport obj = new PersonReport(Acode, AnswerJson, Record, AName, Score);
            WebPages.PersonalReportService.R_ReportEntity entityInfos = new WebPages.PersonalReportService.R_ReportEntity();
            strjosn = JsonConvert.SerializeObject(obj);
            entityInfos._reportjson = strjosn;
            //entityInfos._createuid = UID;
            ////entityInfo._answeradd_id = answerid;
            //entityInfos._answeid = answerid;
            entityInfos._r_createdate = DateTime.Now;
            long ss = -1;

            if (obj.UserINfos != null && obj.DimensionEntitys != null)
            {
                ss = MgrServices.PersonalReportService.R_ReportInsert(entityInfos);
            }
            else
            {
                throw new CustomException("更新出错", " UpdateReportInsert", "更新我数据导出");
            }
        }
Exemplo n.º 9
0
 //GET: AddPersonView
 public ActionResult Add(PersonReport personDetails)
 {
     return(View("Add"));
 }