public void Grade(LandRecord record, GradeAction action)
 {
     if (record.SystemData == SystemData.Enterprise)
     {
         Core.EnterpriseManager.Grade(record.ELID, record.ID, action);
     }
     else if (record.SystemData == SystemData.Lawyer)
     {
         Core.LawyerManager.Grade(record.ELID, record.ID, action);
     }
 }
Ejemplo n.º 2
0
 public void Grade(Land land, int conductId, GradeAction action)
 {
     if (land.SystemData == SystemData.Enterprise)
     {
         Core.EnterpriseManager.Grade(land.ELID, conductId, action);
     }
     else if (land.SystemData == SystemData.Lawyer)
     {
         Core.LawyerManager.Grade(land.ELID, conductId, action);
     }
 }
        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);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 作用:对一个自然人进行信用评级
        /// 作者:王健林
        /// 编写时间:2017年4月6日10:58:27;
        /// </summary>
        /// <param name="id"></param>
        /// <param name="conductId"></param>
        /// <param name="action"></param>
        public void Grade(int id, int conductId, GradeAction action)
        {
            var lawyer = Db.Lawyers.Find(id);

            if (lawyer == null)
            {
                return;
            }
            var score = Db.LawyerScores.Find(id);

            if (score == null)
            {
                return;
            }

            Feed feed = null;

            if (lawyer.Degree != score.Degree)
            {
                feed = new Feed
                {
                    ELID       = lawyer.ID,
                    SystemData = SystemData.Lawyer,
                    Old        = lawyer.Degree,
                    New        = score.Degree,
                    ConductID  = conductId,
                    Action     = action
                };
            }
            lawyer.Degree    = score.Degree;
            lawyer.Times     = score.Times;
            lawyer.Values    = score.ScoreValue;
            lawyer.Record    = score.Record;
            lawyer.GradeTime = DateTime.Now;
            if (feed != null)
            {
                Db.Feeds.Add(feed);
            }
            Db.SaveChanges();
        }
        /// <summary>
        /// 作用:对某一个企业进行信用评级
        /// 作者:汪建龙
        /// 编写时间:2017年3月31日14:11:15
        /// </summary>
        /// <param name="id"></param>
        public void Grade(int id, int conductId, GradeAction action)
        {
            var enterprise = Db.Enterprises.Find(id);

            if (enterprise == null)
            {
                return;
            }
            var score = Db.EnterpriseScores.Find(id);

            if (score == null)
            {
                return;
            }
            Feed feed = null;

            if (enterprise.Degree != score.Degree)
            {
                feed = new Feed
                {
                    ELID       = enterprise.ID,
                    SystemData = SystemData.Enterprise,
                    Old        = enterprise.Degree,
                    New        = score.Degree,
                    ConductID  = conductId,
                    Action     = action
                };
            }
            enterprise.Degree    = score.Degree;
            enterprise.Times     = score.Times;
            enterprise.Values    = score.ScoreValue;
            enterprise.Record    = score.Record;
            enterprise.GradeTime = DateTime.Now;
            if (feed != null)
            {
                Db.Feeds.Add(feed);
            }
            Db.SaveChanges();
        }