Exemple #1
0
        public ActionResult GetMeetingInfo(RequestModel request)
        {
            object obj = new object();

            try
            {
                QRCodeService qrCodeService         = new QRCodeService();
                QRCode        qrCode                = qrCodeService.Select(request.id);
                mdSeminarMeetingMainService service = new mdSeminarMeetingMainService();
                var meeting = service.GetMeetingById(qrCode.meetingid.Value);
                var data    = new
                {
                    title     = meeting.mtitle,
                    starttime = meeting.mbegintime.Value.ToString("yyyy-MM-dd HH:mm"),
                    endtime   = meeting.mendtime.Value.ToString("yyyy-MM-dd HH:mm"),
                    address   = meeting.msite,
                    meeting.InvitationCode
                };
                obj = new { success = true, data };
            }
            catch (Exception ex)
            {
                obj = new { success = false, message = "参数错误!" };
            }
            return(Json(obj, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        //
        // GET: /Vote/

        public ActionResult Index(int id)
        {
            var meeting = smm.GetMeetingById(id);
            var list    = vs.GetVoteByMid(id);

            @ViewBag.mTitle = meeting.mtitle;
            return(View(list));
        }
Exemple #3
0
        public ActionResult MeetingRegister(int id)
        {
            ViewBag.url = url;
            string openid = Session["openid"].ToString();
            mdSeminarMeetingMainService service = new mdSeminarMeetingMainService();
            var meeting = service.GetMeetingById(id);

            ViewBag.meeting = meeting;
            return(View());
        }
Exemple #4
0
        //private string ReadRemoteFile(string c,string doctorCode,string extension)
        //{
        //    //if (!Directory.Exists(Server.MapPath("~/Files/") + doctorCode))
        //    //{
        //    //    Directory.CreateDirectory(Server.MapPath("~/Files/") + doctorCode);
        //    //}
        //    //DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/Files/") + doctorCode);
        //    //FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();  //返回目录中所有文件和子目录
        //    //foreach (FileSystemInfo i in fileinfo)
        //    //{
        //    //    if (i is DirectoryInfo)            //判断是否文件夹
        //    //    {
        //    //        DirectoryInfo subdir = new DirectoryInfo(i.FullName);
        //    //        subdir.Delete(true);          //删除子目录和文件
        //    //    }
        //    //    else
        //    //    {
        //    //        System.IO.File.Delete(i.FullName);      //删除指定文件
        //    //    }
        //    //}

        //    //HttpWebRequest req = WebRequest.Create(path) as HttpWebRequest;
        //    //req.Accept = @"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
        //    ////req.Referer = oldurl;
        //    //req.UserAgent = @" Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36";
        //    //req.ContentType = "application/octet-stream";
        //    //HttpWebResponse response = req.GetResponse() as HttpWebResponse;
        //    //Stream stream = response.GetResponseStream();
        //    //string fileName = Guid.NewGuid().ToString();
        //    //FileStream fs = new FileStream(Server.MapPath("~/Files/"+doctorCode+"/"+ fileName + "."+ extension), FileMode.Create);
        //    //try
        //    //{
        //    //    long length = response.ContentLength;
        //    //    int i = 0;
        //    //    do
        //    //    {
        //    //        byte[] buffer = new byte[1024];
        //    //        i = stream.Read(buffer, 0, 1024);
        //    //        fs.Write(buffer, 0, i);
        //    //    } while (i > 0);
        //    //}
        //    //finally
        //    //{
        //    //    fs.Close();
        //    //}
        //    //return fileName;
        //}

        public ActionResult JoinMeeting(td_seminar_meeting_accept _sma)
        {
            try
            {
                if (Session["openid"] == null)
                {
                    return(Json(new { success = false, msg = "参数错误" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    mdSeminarMeetingMainService service = new mdSeminarMeetingMainService();
                    var             meeting             = service.GetMeetingById(_sma.MId);
                    UserInfoService userInfoService     = new UserInfoService();
                    var             userInfo            = userInfoService.SelectByOpenid(Session["openid"].ToString());
                    _sma.OPenID   = Session["openid"].ToString();
                    _sma.CreateOn = DateTime.Now;
                    var i = sma.Insert(_sma);
                    if (i > 0)
                    {
                        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)
                            {
                                foreach (var tableInput in tableInputList)
                                {
                                    tableInput.IsAppointments = "是";
                                    tableInput.meetingtime    = DateTime.Now;
                                    tableInput.participation  = "微信确认";
                                }
                                context.SaveChanges();
                            }
                        }
                        return(Json(new { success = true, msg = "预约成功,可以从“我的会议”查看。页面跳转中,请稍等" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        string msg = "会议已过期。页面跳转中,请稍等";
                        if (i == -1)
                        {
                            msg = "您已预约成功,请勿重复点击。页面跳转中,请稍等";
                        }
                        return(Json(new { success = false, msg = msg }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        public ActionResult MeetingSign(int id)
        {
            ViewBag.url = url;
            string openid = Session["openid"].ToString();
            mdSeminarMeetingMainService service = new mdSeminarMeetingMainService();
            var             meeting             = service.GetMeetingById(id);
            UserInfoService userInfoService     = new UserInfoService();
            var             userInfo            = userInfoService.SelectByOpenid(openid);

            ViewBag.meeting  = meeting;
            ViewBag.userInfo = userInfo;
            return(View());
        }
Exemple #6
0
        //
        // GET: /Survey/

        public ActionResult Index(int id)
        {
            ViewBag.id = id;

            string openid    = Session["openid"].ToString();
            var    meeting   = smm.GetMeetingById(id);
            var    list      = ss.GetSurveyByMid(id);
            int    datacount = mds.GetMeetingDataByMid(id).Count;

            ViewBag.datacount   = datacount;
            ViewBag.SurvayTitle = meeting.survaytitle;
            //return View("Index_old",list);
            return(View(list));
        }
Exemple #7
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());
        }
Exemple #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));
            }
        }
Exemple #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();
                                }
                            }
                        }
                    }
                }
            }
        }