コード例 #1
0
ファイル: BaseController.cs プロジェクト: dovanduy/LiXin
 /// <summary>
 ///  邮件发送
 /// </summary>
 /// <param name="listEmailAddress">收件人地址和内容</param>
 /// <param name="strTitle">邮件主题</param>
 /// <param name="mailName">邮件名称(考试、培训等)</param>
 public void SendEmail(List <KeyValuePair <string, string> > listEmailAndContent, string strTitle, string mailName = "")
 {
     try
     {
         EmailInforMation emailinf = new EmailInforMation();
         emailinf.listEmailAndContent = listEmailAndContent;
         emailinf.SendFlag            = 1;
         emailinf.Subject             = strTitle;
         if (!string.IsNullOrEmpty(mailName))
         {
             emailinf.mailName = mailName;
         }
         string[] emailStr =
             AllSystemConfigs.Where(p => p.ConfigType == 1).FirstOrDefault().ConfigValue.Split(';');
         if (emailStr.Length > 0)
         {
             emailinf.UserName = emailStr[0];
             emailinf.PassWord = emailStr[1];
             //接收邮件服务器
             emailinf.From = emailStr[2];
             //发送邮件服务器
             emailinf.Host = emailStr[4];
             //端口
             emailinf.IPort = Convert.ToInt32(emailStr[3]);
         }
         new RabbitMQHelper(Rabbit_serverAddress, Rabbit_userName, Rabbit_password, Rabbit_SendEmailHost,
                            email_queue).SendMessage(emailinf);
     }
     catch { }
 }
コード例 #2
0
        public ActionResult FillUpTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 23);

            ViewBag.model = model;
            return(View());
        }
コード例 #3
0
        public ActionResult CourseUpperLimitConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 18);

            ViewBag.model = model;
            return(View());
        }
コード例 #4
0
        public ActionResult YearCourseFillUpNumberConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 20);

            ViewBag.model = model;
            return(View());
        }
コード例 #5
0
        public ActionResult ClassOpingTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 29);

            ViewBag.model = model;
            return(View());
        }
コード例 #6
0
        public ActionResult CompletionOnlineTestTimes()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 33);

            ViewBag.model = model;
            return(View());
        }
コード例 #7
0
        public ActionResult TrainReportingTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 11);

            ViewBag.model = model;
            return(View());
        }
コード例 #8
0
        public ActionResult TestAnswerTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 26);

            ViewBag.model = model;
            return(View());
        }
コード例 #9
0
        public ActionResult TrainLevelAdjustTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 9);

            ViewBag.model = model;
            return(View());
        }
コード例 #10
0
        public ActionResult AllDeptTrainSetTime()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 10);

            ViewBag.model = model;
            return(View());
        }
コード例 #11
0
        public ActionResult CPATrainConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 8);

            ViewBag.model = model;
            return(View());
        }
コード例 #12
0
        /// <summary>
        /// 5:违纪学时
        /// </summary>
        /// <returns></returns>
        public ActionResult DisciplineHoursConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 5);

            ViewBag.model = model;
            string chidao = "";

            if (model.ConfigValue != "")
            {
                for (int i = 0; i < model.ConfigValue.Split(';').Length; i++)
                {
                    if (model.ConfigValue.Split(';')[i].Split(',')[0] == "0")
                    {
                        chidao += "<tr type='chidao'>";
                        chidao += "<td>迟到</td>";
                    }
                    else
                    {
                        chidao += "<tr type='zaotui'>";
                        chidao += "<td>早退</td>";
                    }
                    chidao += "<td>" + model.ConfigValue.Split(';')[i].Split(',')[1] + "</td>";
                    chidao += "<td>" + model.ConfigValue.Split(';')[i].Split(',')[2] + "</td>";
                    chidao += "<td>" + model.ConfigValue.Split(';')[i].Split(',')[3] + "</td>";
                    chidao += "<td><a class='icon idel' title='删除' onclick='fdelete(this)'></a></td>";
                    chidao += "</tr>";
                }
            }
            ViewBag.chidao = chidao;

            return(View());
        }
コード例 #13
0
        public ActionResult MessageConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 2);

            ViewBag.model = model;
            return(View());
        }
コード例 #14
0
        public ActionResult ClassTemplateConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 31);

            ViewBag.model = model;
            return(View());
        }
コード例 #15
0
        public ActionResult TrainTimeLimitConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 14);

            ViewBag.model = model;
            return(View());
        }
コード例 #16
0
        public ActionResult AfterVideoJoinTestConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 25);

            ViewBag.model = model;
            return(View());
        }
コード例 #17
0
        public ActionResult CPAYealTargetHoursConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 16);

            ViewBag.model = model;
            return(View());
        }
コード例 #18
0
        public ActionResult TestMaxNumberConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 27);

            ViewBag.model = model;
            return(View());
        }
コード例 #19
0
        public ActionResult CPATargetTrainCycleTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 17);

            ViewBag.model = model;
            return(View());
        }
コード例 #20
0
        public ActionResult EvaluationRewardTimeLimitConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 30);

            ViewBag.model = model;
            return(View());
        }
コード例 #21
0
        public ActionResult QueuechangeNormalNumberConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 21);

            ViewBag.model = model;
            return(View());
        }
コード例 #22
0
 /// <summary>
 /// 获取配置当中的年度设定
 /// </summary>
 /// <param name="year"></param>
 /// <param name="IsPublishMonth">0: 读取配置中的月份 1 读取已经发布的月份</param>
 /// <returns>月份  形如 2013-5</returns>
 public JsonResult GetMonthByYear(int year, int IsPublishMonth = 0)
 {
     try
     {
         var monthList = new List <string>();
         if (IsPublishMonth == 0)
         {
             monthList = Imonth.GetMonthOfConfig(AllSystemConfigs.Where(p => p.ConfigType == 7).FirstOrDefault(), year);
         }
         if (IsPublishMonth == 1)
         {
             int total = 0;
             monthList = Imonth.GetMonthPlan(out total, 1, int.MaxValue, year, "-1", 1, "").Select(i => i.Month).ToList();
         }
         return(Json(new
         {
             result = 1,
             monthList = monthList
         }, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(Json(new
         {
             result = 0,
             monthList = new List <string>()
         }, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #23
0
        public ActionResult ConcentrationTeachTimeConfig()
        {
            var model = AllSystemConfigs.Find(p => p.ConfigType == 24);

            ViewBag.model = model;
            return(View());
        }
コード例 #24
0
        public ActionResult SurveyEdit(int id = 0)
        {
            Survey_Survey survey = new Survey_Survey();

            ViewBag.id = id;
            if (id > 0)
            {
                survey = surveyBL.Get(id);

                if (survey.OpenGroupFlag == 1)//群组
                {
                    int    total    = 0;
                    string strWhere = " GroupId in (select id from dbo.F_SplitIDs('" + survey.OpenGroup + "')) ";
                    ViewBag.Groups = sys_GroupBL.GetAllList(out total, 1, int.MaxValue, strWhere);
                }
                if (survey.OpenDepartFlag == 1)//组织结构
                {
                    string strWhere = " DepartmentId in (select id from dbo.F_SplitIDs('" + survey.OpenDepart + "')) ";
                    ViewBag.Departs = deptBL.GetAllList(strWhere);
                }
            }
            else
            {
                string star;
                string end;

                var TrainGradeTime = trainBL.IsUpdateTrain(out star, out end, AllSystemConfigs.Where(p => p.ConfigType == 11).FirstOrDefault(), DateTime.Now.Date);
                ViewBag.start = star == "" ? "" : Convert.ToDateTime(star).ToString("yyyy-MM-dd");
                ViewBag.end   = end == "" ? "" : Convert.ToDateTime(end).ToString("yyyy-MM-dd");
            }
            return(View(survey));
        }
コード例 #25
0
 /// <summary>
 /// 培训级别变更
 /// </summary>
 public JsonResult GetTarinUpdate(string realName = "", string payGrade = "", string DeptName = "", int status = -1, int pageIndex = 1, int pageSize = int.MaxValue)
 {
     try
     {
         int    totalCount = 0;
         string star;
         string end;
         var    TrainGradeTime = trainBL.IsUpdateTrain(out star, out end, AllSystemConfigs.Where(p => p.ConfigType == 9).FirstOrDefault(), DateTime.Now.Date);
         var    list           = trainBL.GetTarinUpdate(out totalCount, star, end, realName.ReplaceSql(), payGrade.ReplaceSql(),
                                                        DeptName.ReplaceSql(), status, pageIndex, pageSize);
         return(Json(new
         {
             result = 1,
             dataList = list,
             recordCount = totalCount
         }, JsonRequestBehavior.AllowGet));
     }
     catch
     {
         return(Json(new
         {
             result = 0,
             dataList = new List <Sys_TrainGrade>(),
             recordCount = 0
         }, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #26
0
        public ActionResult EmailConfig()
        {
            //Sys_ParamConfig model = paramconfigBL.GetSys_ParamConfig(1);
            var model = AllSystemConfigs.Find(p => p.ConfigType == 1);

            ViewBag.model = model;
            return(View());
        }
コード例 #27
0
ファイル: HomeController.cs プロジェクト: dovanduy/LiXin
        /// <summary>
        /// 我的培训首页
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult MyTrainIndex()
        {
            var uid       = CurrentUser == null ? 0 : CurrentUser.UserId;
            var usermodel = InitSuper;
            //所内目标学时
            string result = "0";
            //CPA目标学时
            string CPAresult = "0";
            //个人总学时(除CPA)
            decimal userscore = 0;
            //全年补预定次数
            int ordercount = 0;

            if (uid != 0)
            {
                //CPA目标学时
                Sys_ParamConfig cpazq1 = AllSystemConfigs.Where(p => p.ConfigType == 16).FirstOrDefault();
                CPAresult = cpazq1.ConfigValue;

                //计算个人学时
                Sys_ParamConfig cpazq2 = AllSystemConfigs.Where(p => p.ConfigType == 14).FirstOrDefault();
                userscore = UserBL.GetUserScore(uid, cpazq2);

                usermodel = UserBL.GetmodelCAP(uid);
                Sys_ParamConfig cpazq   = AllSystemConfigs.Where(p => p.ConfigType == 13).FirstOrDefault();
                string          mianstr = cpazq.ConfigValue + ";";
                string          substr  = "(?<=" + usermodel.TrainGrade + "-).*?(?=;)";
                //string substr = "(?<=B-).*?(?=;)";
                result = Regex.Match(mianstr, substr).Value;



                //全年补预定次数
                Sys_ParamConfig cpazq3 = AllSystemConfigs.Where(p => p.ConfigType == 20).FirstOrDefault();
                ordercount = Convert.ToInt32(cpazq3.ConfigValue);
                if (usermodel.ordertimes > ordercount)
                {
                    usermodel.ordertimes = ordercount;
                }
            }
            ViewData["model"] = usermodel;
            ViewBag.PayGrade  = CurrentUser.PayGrade;

            var Sys_ParamConfig = AllSystemConfigs.Find(p => p.ConfigType == 33);

            //读参数配置获取全年在线测试完成次数
            ViewBag.ALLOnLineTestNum = Sys_ParamConfig.ConfigValue;

            ViewBag.PassOnLineTestNum = IAttendce.GetMyExamListPassCount(CurrentUser.UserId, CurrentUser.TrainGrade, CurrentUser.DeptId, " ((way=1 and PassStatus=1) or (way=2 and IsPass=1))");
            ViewBag.CourseLe          = result;
            ViewBag.UserScore         = userscore;
            ViewBag.CPACourseLe       = CPAresult;
            ViewBag.OrderCount        = ordercount;

            return(View());
        }
コード例 #28
0
ファイル: BaseController.cs プロジェクト: dovanduy/LiXin
        /// <summary>
        /// 短信发送
        /// </summary>
        /// <param name="telephone">号码</param>
        /// <param name="content">内容</param>
        public void SendMessage(List <string> telephone, string content)
        {
            SmsMessage message = new SmsMessage();

            message.telePhoneList = telephone;
            message.message       = content;
            message.config        = (new Sys_ParamConfigBL()).GetSmsConfing(AllSystemConfigs.Where(p => p.ConfigType == 2).FirstOrDefault());
            new RabbitMQHelper(Rabbit_serverAddress, Rabbit_userName, Rabbit_password, Rabbit_fileTrans, Rabbit_queue).SendMessage(message);
            //RabbitMQHelper.Instance.SendMessage(message);
        }
コード例 #29
0
        /// <summary>
        ///  CPA周期课程列表呈现
        /// </summary>
        public ViewResult CPACourse()
        {
            List <string> itemArray = Imonth.CPAStartAndEnd(AllSystemConfigs.Where(p => p.ConfigType == 8).FirstOrDefault());

            ViewData["StrCPAYear"] = itemArray;
            Sys_ParamConfig cpazq  = AllSystemConfigs.Where(p => p.ConfigType == 17).FirstOrDefault();
            string          result = cpazq.ConfigValue;

            ViewData["allsum"] = result;
            return(View());
        }
コード例 #30
0
        /// <summary>
        /// 年度培训课程列表呈现
        /// </summary>
        /// <returns></returns>
        public ActionResult CPAYearCourse()
        {
            List <Tr_YearPlan> itemArray = Iyear.GetAllYear("IsDelete=0 and PublishFlag=1");

            ViewData["StrYear"] = itemArray;

            Sys_ParamConfig cpazq  = AllSystemConfigs.Where(p => p.ConfigType == 16).FirstOrDefault();
            string          result = cpazq.ConfigValue;

            ViewData["allsum"] = result;
            return(View());
        }