当前位置: 首页>>代码示例>>C#>>正文


C# Eme.EmeEntities类代码示例

本文整理汇总了C#中Eme.Model.Eme.EmeEntities的典型用法代码示例。如果您正苦于以下问题:C# EmeEntities类的具体用法?C# EmeEntities怎么用?C# EmeEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EmeEntities类属于Eme.Model.Eme命名空间,在下文中一共展示了EmeEntities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateClassroom

 /// <summary>
 /// 作者:Vincen
 /// 时间:2014.03.28
 /// 描述:创建教室
 /// </summary>
 /// <param name="model"></param>
 /// <param name="createBy"></param>
 /// <returns></returns>
 public static bool CreateClassroom(Classroom model, int createBy)
 {
     using (var edb = new EmeEntities())
     {
         try
         {
             edb.Entry(model).State = EntityState.Added;
             var result = edb.SaveChanges() > 0;
             return result;
         }
         catch (Exception e)
         {
             Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
             {
                 ExceptionType = CommonHelper.To<int>(ExceptionType.Message),
                 Message = string.Format("BranchBLL-CreateClassroom:{0};{1};{2}", e.Message, e.InnerException, e.HelpLink),
                 IsTreat = false,
                 UserHostAddress = WebHelper.GetCurrentIpAddress(),
                 CreateBy = createBy,
                 CreateTime = DateTime.Now
             });
             return false;
         }
     }
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:33,代码来源:BranchBLL.cs

示例2: GetAllStudentScoreOfClassStat

 /// <summary>
 /// 作者:Kylin
 /// 时间:2014.10.05
 /// 描述:授课质量排名
 /// </summary>
 /// <param name="areaId"></param>
 /// <param name="beginDate"></param>
 /// <param name="endDate"></param>
 /// <returns></returns>
 public static List<GetAllStudentScoreOfClassStat_Result> GetAllStudentScoreOfClassStat(int areaId, DateTime beginDate, DateTime endDate)
 {
     using (var edb = new EmeEntities(dbRead))
     {
         return edb.GetAllStudentScoreOfClassStat(areaId, beginDate, endDate).ToList();
     }
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:16,代码来源:ReportBLL.cs

示例3: GetAllTeacherRecordTotal

 /// <summary>
 /// 作者:Kylin
 /// 时间:2014.11.21
 /// 描述:全国上课量汇总表			
 /// </summary>
 /// <param name="branchId"></param>
 /// <param name="beginDate"></param>
 /// <param name="endDate"></param>
 /// <param name="teacherType"></param>
 /// <returns></returns>
 public static List<GetAllTeachRecordStat_Result> GetAllTeacherRecordTotal(int branchId, DateTime beginDate, DateTime endDate, string teacherType)
 {
     using (var edb = new EmeEntities(dbRead))
     {
         return edb.GetAllTeachRecordStat(branchId, beginDate, endDate, teacherType).ToList();
     }
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:17,代码来源:ReportBLL.cs

示例4: IsExistReferralByCrmId

 /// <summary>
 /// 作者:Raymond
 /// 日期:2014-7-22
 /// 描述:是否存在报备信息
 /// </summary>
 /// <param name="crmReferralId"></param>
 /// <returns></returns>
 public static bool IsExistReferralByCrmId(int crmReferralId)
 {
     using (var edb = new EmeEntities(dbRead))
     {
         return edb.Referral.Any(p => p.V3Id == crmReferralId);
     }
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:14,代码来源:ReferralBLL.cs

示例5: CreateMessage

        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.04.30
        /// 描述:创建消息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="loginUserId"></param>
        /// <returns></returns>
        public static bool CreateMessage(MessageModel model, int loginUserId)
        {
            try
            {
                using (var tran = new TransactionScope())
                {
                    using (var edb = new EmeEntities())
                    {
                        var msg = new Message()
                        {
                            MessageType = model.MessageType,
                            Subject = model.Subject,
                            MContent = model.MContent,
                            Receivers = model.Receiver.Count,
                            Openers = 0,
                            Status = ConvertEnum.StatusTypeForActive,
                            CreateBy = model.CreateBy,
                            CreateTime = model.CreateTime
                        };

                        edb.Entry(msg).State = EntityState.Added;
                        edb.SaveChanges();

                        var receiver = from a in model.Receiver
                                       select new MessageReceiver()
                                           {
                                               MessageId = msg.Id,
                                               Receiver = a,
                                               IsRead = false,
                                               Status = ConvertEnum.StatusTypeForActive,
                                               CreateBy = model.CreateBy,
                                               CreateTime = model.CreateTime
                                           };
                        foreach (var messageReceiver in receiver)
                        {
                            edb.Entry(messageReceiver).State = EntityState.Added;
                        }

                        var result = edb.SaveChanges() > 0;

                        tran.Complete();
                        return result;
                    }
                }
            }
            catch (Exception e)
            {
                // 异常日志消息队列
                Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                {
                    ExceptionType = CommonHelper.To<int>(ExceptionType.Function),
                    Message = string.Format("EmeBLL-CreateMessage:{0};{1};{2}", e.Message, e.InnerException.Message, e.HelpLink),
                    IsTreat = false,
                    CreateBy = loginUserId,
                    CreateTime = DateTime.Now
                });

                return false;
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:68,代码来源:EmeBLL.cs

示例6: CreateCourse

        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.04.01
        /// 描述:创建课程
        /// </summary>
        /// <param name="course"></param>
        /// <param name="loginUserId"></param>
        /// <returns></returns>
        public static Course CreateCourse(Course course, int loginUserId)
        {
            using (var edb = new EmeEntities())
            {
                try
                {
                    edb.Entry(course).State = EntityState.Added;
                    edb.SaveChanges();
                    return course;
                }
                catch (Exception e)
                {
                    // 异常日志消息队列
                    Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                    {
                        ExceptionType = CommonHelper.To<int>(ExceptionType.Function),
                        Message = string.Format("CourseBLL-CreateCourse:{0};{1};{2}", e.Message, e.InnerException.Message, e.HelpLink),
                        IsTreat = false,
                        CreateBy = loginUserId,
                        CreateTime = DateTime.Now
                    });

                    return null;
                }
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:34,代码来源:CourseBLL.cs

示例7: AddProductBranch

        /// <summary>
        /// 作者:Raymond
        /// 日期:2014-4-22
        /// 描述:新增中心产品
        /// </summary>
        /// <param name="pBranch"></param>
        /// <param name="loginUserId"></param>
        /// <returns></returns>
        public static bool AddProductBranch(ProductBranch pBranch, int loginUserId)
        {
            using (var edb = new EmeEntities())
            {
                try
                {
                    edb.Entry(pBranch).State = EntityState.Added;
                    var result = edb.SaveChanges() > 0;
                    return result;
                }
                catch (Exception e)
                {
                    // 异常日志消息队列
                    Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                    {
                        ExceptionType = CommonHelper.To<int>(ExceptionType.Function),
                        Message = string.Format("ProductBLL-AddProductBranch:{0};{1};{2}", e.Message, e.InnerException.Message, e.HelpLink),
                        IsTreat = false,
                        CreateBy = loginUserId,
                        CreateTime = DateTime.Now
                    });

                    return false;
                }
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:34,代码来源:ProductBLL.cs

示例8: CheckContractDetail

        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.07.18
        /// 描述:检查合同详情
        /// </summary>
        /// <returns></returns>
        public static bool CheckContractDetail()
        {
            using (var edb = new EmeEntities())
            {
                try
                {
                    foreach (var detail in
                            edb.ContractDetail.Where(
                                p => p.Status == ConvertEnum.StatusTypeForActive && p.EndDate < DateTime.Now && p.ContractStatusType == ConvertEnum.ContractStatusTypeForExcute))
                    {
                        // 更新结束的合同为结束状态
                        detail.ContractStatusType = ConvertEnum.ContractStatusTypeForOver;
                        edb.Entry(detail).State = EntityState.Modified;
                    }

                    var result = edb.SaveChanges() > 0;
                    return result;
                }
                catch (Exception e)
                {
                    // 异常日志消息队列
                    Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                    {
                        ExceptionType = CommonHelper.To<int>(ExceptionType.Function),
                        Message = string.Format("StudentBLL-CheckContractDetail:{0};{1};{2}", e.Message, e.InnerException.Message, e.HelpLink),
                        IsTreat = false,
                        CreateBy = null,
                        CreateTime = DateTime.Now
                    });

                    return false;
                }
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:40,代码来源:StudentBLL.cs

示例9: CreateReferral

 /// <summary>
 /// 作者:Raymond
 /// 日期:2014-6-27
 /// 描述:新增报备
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static bool CreateReferral(Referral model)
 {
     using (var edb = new EmeEntities())
     {
         edb.Entry(model).State = EntityState.Added;
         return edb.SaveChanges() > 0;
     }
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:15,代码来源:ReferralBLL.cs

示例10: GetReviewListByProductLevelId

        /// <summary>
        /// 作者:Vincen
        /// 时间:2013.12.27
        /// 描述:获取复习资料,通过产品经别编号
        /// </summary>
        /// <param name="productLevelId"></param>
        /// <returns></returns>
        public static List<Model.Eme.ReviewForProductLevel> GetReviewListByProductLevelId(int productLevelId)
        {
            var Db = new EmeEntities(dbRead);

            return Db.ReviewForProductLevel.Where(p => p.ProductLevelId == productLevelId && p.Status == ConvertEnum.StatusTypeForActive)
                 .OrderBy(p => p.Review.ReviewType).ThenBy(p => p.Review.CName)
                 .ToList();
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:15,代码来源:DataBLL.cs

示例11: GetMcRecommendationListByProductLevelId

        /// <summary>
        /// 作者:Vincen
        /// 时间:2013.11.18 PM
        /// 描述:获取MC推荐资源列表(指出显示个数),通过产品级别编号
        /// </summary>
        /// <param name="productLevelId"></param>
        /// <param name="showNum"></param>
        /// <returns></returns>
        public static List<McRecommendation> GetMcRecommendationListByProductLevelId(int productLevelId, int showNum)
        {
            var Db = new EmeEntities(dbRead);

            return Db.McRecommendation.Where(p =>
                p.Status == ConvertEnum.StatusTypeForActive &&
                p.ProductLevelId == productLevelId).OrderByDescending(p => p.CreateTime).Distinct().Take(showNum).ToList();
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:16,代码来源:McBLL.cs

示例12: CreateFollow

        /// <summary>
        /// 作者:Kylin
        /// 时间:2014.03.21 PM
        /// 描述:(学员)Follow Up (批量)发送
        /// </summary>
        /// <param name="model"></param>
        /// <param name="followDetailLst"></param>
        /// <param name="followAttachmentLst"></param>
        /// <returns></returns>
        public static bool CreateFollow(Follow model, List<FollowDetail> followDetailLst, List<FollowAttachment> followAttachmentLst)
        {
            using (var edb = new EmeEntities())
            {
                try
                {
                    edb.Entry<Follow>(model).State = EntityState.Added;
                    foreach (var item in followDetailLst)
                    {
                        item.FollowId = model.Id;
                        edb.Entry<FollowDetail>(item).State = EntityState.Added;

                        var student = edb.Student.SingleOrDefault(p => p.Id == item.StudentId);
                        if (student != null)
                        {
                            var studentUserId = student.UserId;
                            // 发送队列消息
                            //EmeBLL.CreateMessageForSFollowUp(studentUserId, model.CreateBy);
                            var msg = new MessageModel()
                            {
                                MessageType = CommonHelper.To<int>(MessageType.System),
                                Subject = "Follow Up 查看提醒",
                                MContent = string.Format("您有SA新发送的FU,请注意查收;"),
                                Receiver = new List<int>(),
                                CreateBy = model.CreateBy,
                                CreateTime = DateTime.Now
                            };
                            msg.Receiver.Add(studentUserId);

                            // 将消息加入队列
                            Common.MSMQ.QueueManager.AddSystemMessage(msg);
                        }
                    }
                    foreach (var attachment in followAttachmentLst)
                    {
                        attachment.FollowId = model.Id;
                        edb.Entry(attachment).State = EntityState.Added;
                    }

                    var result = edb.SaveChanges() > 0;

                    return result;
                }
                catch (Exception ex)
                {
                    Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                    {
                        ExceptionType = CommonHelper.To<int>(ExceptionType.Message),
                        Message = string.Format("FollowBLL-CreateFollow:{0};{1};{2}", ex.Message, ex.InnerException, ex.HelpLink),
                        IsTreat = false,
                        CreateBy = model.CreateBy,
                        CreateTime = DateTime.Now
                    });
                    return false;
                }
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:66,代码来源:FollowBLL.cs

示例13: CheckArrangeCourseForProductLevelCourseTypeSelected

 /// <summary>
 /// 作者:Primo
 /// 日期:2015.02.26
 /// 描述:判断学员选课是否存在已经上过超过一节的课了 
 /// </summary>
 /// <param name="studentId"></param>
 /// <param name="productLevelCourseTypeId"></param>
 /// <returns></returns>
 public static bool CheckArrangeCourseForProductLevelCourseTypeSelected(int studentId, int productLevelCourseTypeId)
 {
     var db = new EmeEntities(dbRead);
     var bookRecordCount = db.BookRecord.Where(a => a.StudentId == studentId
         && a.ArrangeCourse.ProductLevelCourseTypeCourse.ProductLevelCourseTypeId == productLevelCourseTypeId
         && a.IsUnBook == false
         && a.PassStatusType != ConvertEnum.PassStatusTypeForRepeat
         && a.Status == ConvertEnum.StatusTypeForActive).Count();
     var result = bookRecordCount > 1 ? true : false;
     return result;
 }
开发者ID:kylin589,项目名称:EmePro,代码行数:19,代码来源:StudentBLL.cs

示例14: CheckContractFrozenDetail

        /// <summary>
        /// 作者:Vincen
        /// 时间:2014.07.15
        /// 描述:检查合同冻结详情
        /// </summary>
        /// <returns></returns>
        public static bool CheckContractFrozenDetail()
        {
            try
            {
                using (var edb = new EmeEntities())
                {
                    using (var tran = new TransactionScope())
                    {
                        foreach (var detail in
                                edb.ContractFrozenDetail.Where(
                                    p => p.Status == ConvertEnum.StatusTypeForActive && p.EndDate < DateTime.Now))
                        {
                            // 更新合同详情信息
                            var contractDetail = detail.ContractDetail;
                            contractDetail.ContractStatusType = (contractDetail.EndDate < DateTime.Now) ? ConvertEnum.ContractStatusTypeForOver : ConvertEnum.ContractStatusTypeForExcute;
                            edb.Entry(contractDetail).State = EntityState.Modified;

                            // 更新冻结详情信息 ( 将处理完的数据设为无效 )
                            detail.UpdateTime = DateTime.Now;
                            detail.Remark = "系统自动解冻";
                            detail.Status = ConvertEnum.StatusTypeForInactive;
                            edb.Entry(detail).State = EntityState.Modified;
                        }

                        var result = edb.SaveChanges() > 0;
                        tran.Complete();
                        return result;
                    }
                }
            }
            catch (Exception e)
            {
                // 异常日志消息队列
                Common.MSMQ.QueueManager.AddExceptionLog(new ExceptionLogs()
                {
                    ExceptionType = CommonHelper.To<int>(ExceptionType.Function),
                    Message = string.Format("StudentBLL-CheckContractFrozenDetail:{0};{1};{2}", e.Message, e.InnerException.Message, e.HelpLink),
                    IsTreat = false,
                    CreateBy = null,
                    CreateTime = DateTime.Now
                });

                return false;
            }
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:51,代码来源:StudentBLL+-+副本.cs

示例15: CheckTrainingScheduleIsValidate

        /// <summary>
        /// 作者:Kylin
        /// 时间:2015.01.05
        /// 描述: check update training schedule for speaker is validate
        /// </summary>
        /// <param name="trainSchedule"></param>
        /// <param name="checkEnable"></param>
        /// <returns></returns>
        public static int CheckTrainingScheduleIsValidate(TrainSchedule trainSchedule, bool checkEnable)
        {
            using (var edb = new EmeEntities())
            {
                if (!checkEnable)
                {
                    if (
                edb.UserSchedule.Any(
                    p => p.BeginTime < trainSchedule.EndTime && p.EndTime > trainSchedule.BeginTime
                         && p.Status == ConvertEnum.StatusTypeForActive
                         && p.UserId == trainSchedule.SpeakerId))
                    {
                        return 101; //已存在其他安排
                    }
                    if (
                        edb.TrainSchedule.Any(
                            p => p.BeginTime < trainSchedule.EndTime && p.EndTime > trainSchedule.BeginTime
                                 && p.SpeakerId == trainSchedule.SpeakerId &&
                                 p.Status == ConvertEnum.StatusTypeForActive))
                    {
                        return 103; //已存在其他培训
                    }
                    if (edb.TrainRecord.Any(p =>
                        p.TrainSchedule.BeginTime < trainSchedule.EndTime &&
                        p.TrainSchedule.EndTime > trainSchedule.BeginTime
                        && p.Status == ConvertEnum.StatusTypeForActive
                        && p.UserId == trainSchedule.SpeakerId))
                    {
                        return 104; //主讲人已预订其他培训
                    }
                }
                else
                {
                    return 0;
                }

            }

            return -1;
        }
开发者ID:kylin589,项目名称:EmePro,代码行数:48,代码来源:TrainBLL.cs


注:本文中的Eme.Model.Eme.EmeEntities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。