示例#1
0
        public ActionResult DataList(int id)
        {
            md_seminar_meeting_main meeting = null;

            try
            {
                meeting = smm.GetMeetingById(id);
                if (meeting == null || meeting.Type == 1)
                {
                    return(RedirectToAction("Index", "Error"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }
            string hosturl = System.Configuration.ConfigurationManager.ConnectionStrings["url"].ConnectionString;

            ViewBag.hosturl = hosturl;
            var OpenID = Session["openid"].ToString();
            var user   = new UserInfoService().SelectByOpenid(OpenID);
            var list   = mds.GetMeetingDataByMid(id);

            ViewBag.mTitle = meeting.mtitle;
            ViewBag.mid    = id;
            ViewBag.Email  = user.email;
            return(View(list));
        }
示例#2
0
 /// <summary>
 /// 医生是否存在行程
 /// 会议类型为大型线下会议且存在行程信息
 /// </summary>
 /// <param name="mid"></param>
 /// <param name="openid"></param>
 /// <returns></returns>
 public bool IsExistDoctorSchedule(md_seminar_meeting_main meeting, string openid)
 {
     using (var context = new DBContext())
     {
         return(meeting.meetingmode == (int)MeetingModeTypeEnum.LargeUnderLine && context.travel_information.FirstOrDefault(t => t.mid == meeting.mid && t.openid == openid) != null);
     }
 }
示例#3
0
        public ActionResult MeetingSchedule(int id, bool isToMeetingInfo = false)
        {
            ViewBag.mid = id;
            md_seminar_meeting_main meeting = null;

            try
            {
                meeting = smm.GetMeetingById(id);
                if (meeting == null || meeting.Type == 1)
                {
                    return(RedirectToAction("Index", "Error"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }
            UserInfoService userInfoService = new UserInfoService();
            var             userInfo        = userInfoService.SelectByOpenid(Session["openid"].ToString());

            ViewBag.Userinfo = userInfo;
            using (var context = new DBContext())
            {
                if (meeting.mhyrc_type == "2")
                {
                    var meetingScheduleList = context.agenda.Where(ms => ms.mid == id).OrderBy(m => m.date).ToList();
                    var meetingScheduleInfo = meetingScheduleList.GroupBy(m => new { date = m.date }, (Station, StationGroup) => new MeetingScheduleInfo
                    {
                        MarkTime   = Station.date.Value,
                        AgendaList = StationGroup.OrderBy(a => a.id).ToList()
                    }).ToList();
                    ViewBag.MeetingScheduleInfo = meetingScheduleInfo;
                }
                var workId         = context.sfe_register.FirstOrDefault(r => r.doc_code == userInfo.doctorCode)?.NETWORK_EXTERNAL_ID_BMS_CN__C;
                var tableInputList = context.table_input.Where(t => t.mcode == meeting.mcode && t.networkid == workId).ToList();
                ViewBag.IsImport = tableInputList.Where(t => t.ModelType == "邀请文件").Count() > 0;
                if (tableInputList.Count() > 0 && tableInputList[0].IsInvitation != "是")
                {
                    foreach (var tableInput in tableInputList)
                    {
                        tableInput.IsInvitation = "是";
                    }
                    context.SaveChanges();
                }
                var openid = Session["openid"].ToString();
                var accept = context.td_seminar_meeting_accept.FirstOrDefault(a => a.OPenID == openid && a.MId == meeting.mid);
                ViewBag.IsAccept = accept != null;
            }
            ViewBag.IsToMeetingInfo = isToMeetingInfo;
            if (meeting.meetingmode == (int)MeetingModeTypeEnum.LargeUnderLine && meeting.mhyrc_type == "2")
            {
                return(View("~/Views/Meeting/MeetingScheduleToLargeUnderLine.cshtml", meeting));
            }
            else
            {
                return(View(meeting));
            }
        }
示例#4
0
 public ActionResult Index(int id)
 {
     ViewBag.url = url;
     try
     {
         string          openid          = Session["openid"].ToString();
         UserInfoService userInfoService = new UserInfoService();
         var             userInfo        = userInfoService.SelectByOpenid(openid);
         QRCodeService   qrCodeService   = new QRCodeService();
         QRCode          qrCode          = qrCodeService.Select(id);
         using (DBContext db = new DBContext())
         {
             if (db.MeetingSign.Any(x => x.meetingid == qrCode.meetingid && x.openid == openid))
             {
                 return(RedirectToAction("Success", new { id = qrCode.meetingid }));
             }
             else
             {
                 if (userInfo.statusCode == "Accepted" || userInfo.statusCode == "Registed" || userInfo.statusCode == "Undetermined")
                 {
                     md_seminar_meeting_main meeting = null;
                     try
                     {
                         meeting = db.md_seminar_meeting_main.AsNoTracking().Where(x => x.mid == qrCode.meetingid.Value).SingleOrDefault();
                         if (meeting == null || meeting.Type == 1)
                         {
                             return(RedirectToAction("Index", "Error"));
                         }
                     }
                     catch (Exception ex)
                     {
                         return(RedirectToAction("Index", "Error"));
                     }
                     HandleMeetingSign(meeting, userInfo);
                     return(RedirectToAction("Success", new { id = qrCode.meetingid }));
                 }
                 else
                 {
                     string url = System.Configuration.ConfigurationManager.ConnectionStrings["signregister"].ConnectionString;
                     url = string.Format(url, id);//.IndexOf("?") > 0 ? url + "&id=" + id : url + "?id=" + id;
                     return(Redirect(url));
                     //return RedirectToAction("MeetingRegister", new { id });
                 }
             }
         }
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Success", new { id }));
     }
 }
示例#5
0
        /// <summary>
        /// 处理会议签到
        /// </summary>
        /// <param name="meeting"></param>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        private void HandleMeetingSign(md_seminar_meeting_main meeting, UserInfo userInfo)
        {
            string openid = Session["openid"].ToString();

            using (DBContext db = new DBContext())
            {
                if (db.MeetingSign.Any(x => x.meetingid == meeting.mid && x.openid == openid))
                {
                }
                else
                {
                    var meetingSign = new MeetingSign
                    {
                        createTime = DateTime.Now,
                        meetingid  = meeting.mid,
                        openid     = openid
                    };
                    string[] s1 = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
                    Random   rd = new Random();
                    string   randomInvitationCode = s1[rd.Next(0, s1.Length)] + s1[rd.Next(0, s1.Length)] + rd.Next(100000, 1000000);
                    int      count = 0;
                    while (db.MeetingSign.FirstOrDefault(m => m.randominvitationcode == randomInvitationCode && m.meetingid == meeting.mid) != null)
                    {
                        randomInvitationCode = s1[rd.Next(0, s1.Length)] + s1[rd.Next(0, s1.Length)] + rd.Next(100000, 1000000);
                        count++;
                        if (count > 20)
                        {
                            break;
                        }
                    }
                    meetingSign.randominvitationcode = randomInvitationCode;
                    db.MeetingSign.Add(meetingSign);
                    var workId         = db.sfe_register.FirstOrDefault(r => r.doc_code == userInfo.doctorCode)?.NETWORK_EXTERNAL_ID_BMS_CN__C;
                    var tableInputList = db.table_input.Where(t => t.mcode == meeting.mcode && t.networkid == workId).ToList();
                    if (tableInputList != null && tableInputList.Count() > 0)
                    {
                        foreach (var tableInput in tableInputList)
                        {
                            tableInput.IsSign     = "是";
                            tableInput.CreateTime = DateTime.Now;
                            tableInput.statusCode = userInfo.statusCode;
                        }
                    }
                    db.Commit();
                }
            }
        }
示例#6
0
        public ActionResult Success(int id)
        {
            mdSeminarMeetingMainService service = new mdSeminarMeetingMainService();
            md_seminar_meeting_main     meeting = null;

            try
            {
                meeting = service.GetMeetingById(id);
                if (meeting == null || meeting.Type == 1)
                {
                    return(RedirectToAction("Index", "Error"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }
            ViewBag.Meeting = meeting;
            string          openid          = Session["openid"].ToString();
            UserInfoService userInfoService = new UserInfoService();
            var             userInfo        = userInfoService.SelectByOpenid(openid);

            ViewBag.UserInfo = userInfo;
            MeetingSignService ms = new MeetingSignService();

            ViewBag.MeetingSign = ms.GetMeetingSignInfo(id, openid);
            ViewBag.url         = url;
            ViewBag.id          = id;
            using (DBContext db = new DBContext())
            {
                var workId     = db.sfe_register.FirstOrDefault(r => r.doc_code == userInfo.doctorCode)?.NETWORK_EXTERNAL_ID_BMS_CN__C;
                var inportInfo = db.table_input.FirstOrDefault(t => t.networkid == workId && t.mcode == meeting.mcode && t.ModelType == "邀请文件");
                ViewBag.IsImport = inportInfo != null;
                if (userInfo.statusCode == "Accepted")
                {
                    var sfe = db.sfe_register.FirstOrDefault(s => s.doc_code == userInfo.doctorCode);
                    ViewBag.Sfe = sfe;
                }
            }
            return(View());
        }
示例#7
0
        /// <summary>
        /// 20180428WD
        /// 通过会议Id和用户Id查询行程信息
        /// </summary>
        /// <param name="mid"></param>
        /// <param name="uid"></param>
        /// <returns></returns>
        public ActionResult DoctorSchedule(int mid)
        {
            md_seminar_meeting_main meeting = null;

            try
            {
                meeting = smm.GetMeetingById(mid);
                if (meeting == null || meeting.Type == 1)
                {
                    return(RedirectToAction("Index", "Error"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }
            UserInfoService userInfoService = new UserInfoService();
            var             userInfo        = userInfoService.SelectByOpenid(Session["openid"].ToString());

            using (var context = new DBContext())
            {
                var workId         = context.sfe_register.FirstOrDefault(r => r.doc_code == userInfo.doctorCode)?.NETWORK_EXTERNAL_ID_BMS_CN__C;
                var tableInputList = context.table_input.Where(t => t.mcode == meeting.mcode && t.networkid == workId).ToList();
                if (tableInputList.Count() > 0 && tableInputList[0].browse != "是")
                {
                    foreach (var tableInput in tableInputList)
                    {
                        tableInput.browse = "是";
                    }
                    context.SaveChanges();
                }
            }
            var doctorSchedule = ds.GetDoctorSchedule(mid, Session["openid"].ToString());

            ViewBag.UserInfo       = userInfo;
            ViewBag.Meeting        = meeting;
            ViewBag.DoctorSchedule = doctorSchedule;
            return(View());
        }
示例#8
0
        public ActionResult MeetingInfo(int id)
        {
            string openid = Session["openid"].ToString();
            md_seminar_meeting_main meeting = null;

            try
            {
                meeting = smm.GetMeetingById(id);
                if (meeting == null || meeting.Type == 1)
                {
                    return(RedirectToAction("Index", "Error"));
                }
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }
            bool IsData = mds.GetIsData(id);
            var  user   = new UserInfoService().SelectByOpenid(openid);

            using (var context = new DBContext())
            {
                if (meeting.mhyrc_type == "2")
                {
                    var meetingScheduleList = context.agenda.Where(ms => ms.mid == id).OrderBy(m => m.date).ToList();
                    var meetingScheduleInfo = meetingScheduleList.GroupBy(m => new { date = m.date }, (Station, StationGroup) => new MeetingScheduleInfo
                    {
                        MarkTime   = Station.date.Value,
                        AgendaList = StationGroup.OrderBy(a => a.id).ToList()
                    }).ToList();
                    ViewBag.MeetingScheduleInfo = meetingScheduleInfo;
                }
            }

            if (user != null)
            {
                if (meeting.liveURL != null)
                {
                    var doc = new UserInfoService().GetDocInfo(openid);
                    if (meeting.liveURL.IndexOf('?') < 0)
                    {
                        if (doc != null)
                        {
                            meeting.liveURL = meeting.liveURL + "?username="******"&realName=" + doc.doc_name + "&mobile=" + doc.doc_code + "&mid=" + meeting.mcode;
                        }
                        else
                        {
                            if (user.doctorCode != null)
                            {
                                meeting.liveURL = meeting.liveURL + "?username="******"&realName=" + user.nickname + "&mobile=" + user.doctorCode + "&mid=" + meeting.mcode;
                            }
                            else
                            {
                                meeting.liveURL = meeting.liveURL + "?username="******"&realName=" + user.nickname + "&mobile=" + user.openid + "&mid=" + meeting.mcode;
                            }
                        }
                    }
                    else
                    {
                        if (doc != null)
                        {
                            meeting.liveURL = meeting.liveURL + "&username="******"&realName=" + doc.doc_name + "&mobile=" + doc.doc_code + "&mid=" + meeting.mcode;
                        }
                        else
                        {
                            if (user.doctorCode != null)
                            {
                                meeting.liveURL = meeting.liveURL + "&username="******"&realName=" + user.nickname + "&mobile=" + user.doctorCode + "&mid=" + meeting.mcode;
                            }
                            else
                            {
                                meeting.liveURL = meeting.liveURL + "&username="******"&realName=" + user.nickname + "&mobile=" + user.openid + "&mid=" + meeting.mcode;
                            }
                        }
                    }
                }
            }
            else
            {
                meeting.liveURL = meeting.liveURL + "?username=&realName=&mobile=&mid=";
            }
            @ViewBag.IsData = IsData.ToString().ToLower();
            if (meeting.meetingmode == (int)MeetingModeTypeEnum.LargeUnderLine && meeting.mhyrc_type == "2")
            {
                return(View("~/Views/Meeting/MeetingInfoToLargeUnderLine.cshtml", meeting));
            }
            else
            {
                return(View(meeting));
            }
        }
示例#9
0
        public void QR(int id)
        {
            if (Session["openid"] == null)
            {
                Response.Redirect(OpenWeiXinTools.getWebAuthUrl(System.Configuration.ConfigurationManager.ConnectionStrings["weixin.AppID"].ConnectionString, Request.Url.ToString(), ""));
                return;
            }
            else
            {
                string url = System.Configuration.ConfigurationManager.ConnectionStrings["url"].ConnectionString;

                UserInfoService             userInfoService             = new UserInfoService();
                mdSeminarMeetingMainService mdseminarMeetingMainService = new mdSeminarMeetingMainService();
                UserInfo userInfo = new UserInfo();
                try
                {
                    userInfo = userInfoService.SelectByOpenid(Session["openid"].ToString());
                }
                catch (Exception ex)
                {
                    log.Info("获取用户信息失败!");
                    log.Error(ex);
                    Response.Redirect(url + "/portal/wechat/login");
                    Response.End();
                    return;
                }
                QRCodeService qrCodeService = new QRCodeService();
                QRCode        qrCode        = qrCodeService.Select(id);


                if (userInfo == null)//未获取到用户信息
                {
                    Response.Redirect("/IO/WeiXin/Error/获取用户信息错误!");
                    Response.End();
                    return;
                }
                if (qrCode == null)
                {
                    if (string.IsNullOrWhiteSpace(userInfo.statusCode))
                    {
                        Response.Redirect(url + "/portal/wechat/login");
                        Response.End();
                    }
                    else if (userInfo.statusCode.Equals("Accepted") || userInfo.statusCode.Equals("Undetermined") || userInfo.statusCode.Equals("Rejected"))//已认证跳转到我的会议页面
                    {
                        Response.Redirect("/IO/Meeting/Index");
                        Response.End();
                    }
                    else//未认证跳转到登录页面
                    {
                        Response.Redirect(url + "/portal/wechat/login");
                        Response.End();
                    }
                }
                else
                {
                    if (string.IsNullOrWhiteSpace(userInfo.statusCode) && qrCode.type != 2)
                    {
                        Response.Redirect(url + "/portal/wechat/login");
                        Response.End();
                    }
                    else
                    {
                        md_seminar_meeting_main meeting = mdseminarMeetingMainService.GetMeetingById(qrCode.meetingid.Value);
                        if (qrCode.type == 5)
                        {
                            Response.Redirect("/IO/Sign/Index?id=" + id);
                            Response.End();
                            return;
                        }
                        else if (qrCode.type == 3)                      //医生认证
                        {
                            if (userInfo.statusCode.Equals("Accepted")) //已认证跳转到认证成功页面
                            {
                                Response.Redirect("/IO/Notice/AuthenticationSuccess");
                                Response.End();
                            }
                            else//未认证跳转到登录页面
                            {
                                Response.Redirect(url + "/portal/wechat/login");
                                Response.End();
                            }
                        }
                        else
                        {
                            if (meeting == null || meeting.Type == 1)//会议不存在
                            {
                                //if (userInfo.statusCode.Equals("Accepted"))//已认证跳转到我的会议页面
                                //{
                                //    Response.Redirect("/IO/Meeting/Index");
                                //    Response.End();
                                //}
                                //else//未认证跳转到登录页面
                                //{
                                //    Response.Redirect(url + "/portal/wechat/login");
                                //    Response.End();
                                //}
                                Response.Redirect("/IO/Error/Index");
                                Response.End();
                                return;
                            }
                            if (qrCode.type == 2)//会议互动,只要没有过期都可以进去
                            {
                                if (meeting.mendtime < DateTime.Now)
                                {
                                    Response.Redirect("/IO/WeiXin/Error/会议已过期!");
                                    Response.End();
                                    return;
                                }
                                else
                                {
                                    Response.Redirect("/IO/Vote/Index/" + qrCode.meetingid);
                                    Response.End();
                                }
                            }
                            else//会议邀请函或医生会议邀请函
                            {
                                //认证的用户跳转到会议邀请函,已注册的跳转到会议邀请码页面
                                if (userInfo.statusCode.Equals("Accepted"))//认证的用户跳转到会议邀请函
                                {
                                    Response.Redirect("/IO/Meeting/MeetingSchedule/" + qrCode.meetingid);
                                    Response.End();
                                }
                                else if (userInfo.statusCode.Equals("Rejected") || userInfo.statusCode.Equals("Undetermined"))//已注册的跳转到会议邀请码页面
                                {
                                    if (meeting.meetingmode == (int)MeetingModeTypeEnum.LargeUnderLine && (userInfo.statusCode.Equals("Undetermined") || (userInfo.statusCode.Equals("Rejected"))) && (qrCode.type == 4 || qrCode.type == 1))
                                    {
                                        Response.Redirect("/IO/Meeting/MeetingSchedule/" + qrCode.meetingid);
                                        Response.End();
                                    }
                                    else
                                    {
                                        if (userInfo.statusCode.Equals("Undetermined") && (qrCode.type == 4 || qrCode.type == 1))
                                        {
                                            using (var context = new DBContext())
                                            {
                                                if (!string.IsNullOrEmpty(userInfo.doctorCode))
                                                {
                                                    var sfe = context.sfe_register.FirstOrDefault(s => s.doc_code == userInfo.doctorCode);
                                                    if (sfe != null)
                                                    {
                                                        Response.Redirect("/IO/Meeting/MeetingSchedule/" + qrCode.meetingid);
                                                        Response.End();
                                                    }
                                                    else
                                                    {
                                                        Response.Redirect("/IO/Meeting/MeetingCode/" + qrCode.meetingid);
                                                        //Response.Redirect("/Notice/NOPermission");
                                                        Response.End();
                                                    }
                                                }
                                                else
                                                {
                                                    Response.Redirect("/IO/Meeting/MeetingCode/" + qrCode.meetingid);
                                                    //Response.Redirect("/Notice/NOPermission");
                                                    Response.End();
                                                }
                                            }
                                        }
                                        else
                                        {
                                            Response.Redirect("/IO/Meeting/MeetingCode/" + qrCode.meetingid);
                                            //Response.Redirect("/Notice/NOPermission");
                                            Response.End();
                                        }
                                    }
                                }
                                else//未认证跳转到登录页面
                                {
                                    Response.Redirect(url + "/portal/wechat/login");
                                    Response.End();
                                }
                            }
                        }
                    }
                }
            }
        }