private bool IsValidate()
        {
            if (Progress.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Progress is Required.", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Progress.Focus();
                return(false);
            }

            if (Conduct.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Conduct is Required.", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Conduct.Focus();
                return(false);
            }

            if (ReasonForLeaving.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Reason for Leave is Required.", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                ReasonForLeaving.Focus();
                return(false);
            }

            if (Remark.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Remark is Required.", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Remark.Focus();
                return(false);
            }
            return(true);
        }
        public ActionResult Create(Conduct conduct)
        {
            #region  验证数据
            if (conduct == null)
            {
                return(ErrorJsonResult("未获取诚信记录信息"));
            }
            var standard = Core.StandardManager.Get(conduct.StandardId);
            if (standard == null || standard.Credit != conduct.Credit)
            {
                return(ErrorJsonResult(string.Format("未找到ID为{0}的诚信行为,或者当前诚信行为不属于环节{1}", conduct.StandardId, conduct.Credit.GetDescription())));
            }
            if (conduct.SystemData == SystemData.Enterprise)
            {
                var enterprise = Core.EnterpriseManager.Get(conduct.DataId);
                if (enterprise == null)
                {
                    return(ErrorJsonResult(string.Format("未找到ID为{0}的企业信息", conduct.DataId)));
                }
            }
            else
            {
                var lawyer = Core.LawyerManager.Get(conduct.DataId);
                if (lawyer == null)
                {
                    return(ErrorJsonResult(string.Format("未找到ID为{0}的自然人信息", conduct.DataId)));
                }
            }
            #endregion
            conduct.UserID = Identity.UserID;

            if (conduct.ID > 0)
            {
                if (!Core.ConductManager.Edit(conduct))
                {
                    return(ErrorJsonResult("编辑更新失败,未找到编辑更新的诚信记录"));
                }
            }
            else
            {
                var id = Core.ConductManager.Save(conduct);
                if (id <= 0)
                {
                    return(ErrorJsonResult("保存失败"));
                }
                if (!Core.ConductManager.UpdateCredit(conduct.DataId, conduct.Degree, conduct.SystemData, true))
                {
                    Core.DailyManager.Save(new Daily
                    {
                        Name        = "更新企业自然人诚信次数",
                        Description = string.Format("更新的类型:{0};ID:{1}", conduct.SystemData.GetDescription(), conduct.DataId),
                        UserID      = Identity.UserID
                    });
                }
            }

            return(SuccessJsonResult());
        }
Example #3
0
 public Student(string firstName, string lastName, int age, double height, int tuition, DateTime date, long phone, Conduct studentConduct)
 {
     Name           = firstName;
     Surname        = lastName;
     Age            = age;
     Height         = height;
     Tuition        = tuition;
     Date           = date;
     Phone          = phone;
     StudentConduct = studentConduct;
 }
Example #4
0
        public ActionResult Edit(long?id)
        {
            var viewmodel = new Conduct();

            if (id.HasValue)
            {
                viewmodel = db.conducts.Single(x => x.id == id.Value).ToModel();
            }

            return(View(viewmodel));
        }
Example #5
0
 public Student(string name, string lastname, int age, double height, double tuition, DateTime startDate, string phone, Country country, Conduct studentContact)
 {
     this.Name           = name;
     this.Lastname       = lastname;
     this.Age            = age;
     this.Height         = height;
     this.Tuition        = tuition;
     this.StartDate      = startDate;
     this.Phone          = phone;
     this.Country        = country;
     this.StudentConduct = studentContact;
 }
        public void Grade(Conduct conduct, GradeAction action)
        {
            var land = Core.LandManager.Get(conduct.LandID);

            if (land != null)
            {
                if (land.SystemData == SystemData.Enterprise)
                {
                    Core.EnterpriseManager.Grade(land.ELID, conduct.ID, action);
                }
                else if (land.SystemData == SystemData.Lawyer)
                {
                    Core.LawyerManager.Grade(land.ELID, conduct.ID, action);
                }
            }
        }
        /// <summary>
        /// 作用:编辑
        /// 作者:汪建龙
        /// 编写时间:2017年3月6日20:38:05
        /// </summary>
        /// <param name="conduct"></param>
        /// <returns></returns>
        public bool Edit(Conduct conduct)
        {
            var model = Db.Conducts.Find(conduct.ID);

            if (model == null)
            {
                return(false);
            }
            if (model.Degree != conduct.Degree)
            {
                UpdateCredit(conduct.DataId, model.Degree, conduct.SystemData, false);
                UpdateCredit(conduct.DataId, conduct.Degree, conduct.SystemData, true);
            }
            Db.Entry(model).CurrentValues.SetValues(conduct);
            Db.SaveChanges();

            return(true);
        }
        public ActionResult Save(Conduct conduct)
        {
            #region   验证数据
            if (conduct == null)
            {
                return(ErrorJsonResult("未获取诚信记录信息"));
            }
            var standard = Core.StandardManager.Get(conduct.StandardId);
            if (standard == null || standard.Credit != conduct.Credit)
            {
                return(ErrorJsonResult(string.Format("未找到ID为{0}的诚信行为,或者当前诚信行为不属于环节{1}", conduct.StandardId, conduct.Credit.GetDescription())));
            }
            var land = Core.LandManager.Get(conduct.LandID);
            if (land == null)
            {
                return(ErrorJsonResult(string.Format("未找到ID为{0}的供地信息", conduct.LandID)));
            }
            #endregion

            if (conduct.ID > 0)
            {
                if (!Core.ConductManager.Edit(conduct))
                {
                    return(ErrorJsonResult("编辑更新失败,请刷新再次尝试"));
                }
            }
            else
            {
                var id = Core.ConductManager.Save(conduct);
                if (id <= 0)
                {
                    return(ErrorJsonResult("保存诚信记录失败,请刷新再次尝试"));
                }
            }
            return(SuccessJsonResult(conduct.LandID));
        }
 public ConductResponseDto(Conduct conduct)
 {
     Id      = conduct.Id;
     Conduct = conduct.ConductType;
 }
Example #10
0
 public void SetConduct(Conduct conduct)
 {
     StudentConduct = conduct;
 }
 /// <summary>
 /// 作用:保存诚信记录
 /// 作者:汪建龙
 /// 编写时间:2017年3月6日20:34:37
 /// </summary>
 /// <param name="conduct"></param>
 /// <returns></returns>
 public int Save(Conduct conduct)
 {
     Db.Conducts.Add(conduct);
     Db.SaveChanges();
     return(conduct.ID);
 }
Example #12
0
 } 
                                                                                                                                                                                                                                                                                                                                                                //static mporeis na kaleseis thn methodo 'h to enum apo opoiodipote shmeio tou kwdika!
        static Conduct Conduct { get; set; }

        public student(string name, string lastname, int age, double height, double tuition, DateTime date, string phone,Conduct conduct)
        {
            Name = name;
            LastName = lastname;
            Age = age;
            Phone = phone;
            Height = height;
            Tuition = tuition;
            Date = date;
            Conduct = conduct;
        }
        public override string ToString()
Example #13
0
 // Method to Set Conduct
 public void SetConduct(Conduct conduct)
 {
     // use of this keyword points directly to this class
     this.conduct = conduct;
 }