Example #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));
        }
Example #2
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());
        }
Example #3
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;
            }
        }
Example #4
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());
        }
Example #5
0
        public void MyMeeting(string 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;
                }
                if (userInfo == null)//未获取到用户信息
                {
                    Response.Redirect("/IO/WeiXin/Error/获取用户信息错误!");
                    Response.End();
                    return;
                }
                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?id=" + id);
                    Response.End();
                }
                else//未认证跳转到登录页面
                {
                    Response.Redirect(url + "/portal/wechat/login");
                    Response.End();
                }
            }
        }
Example #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());
        }
Example #7
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();
                                }
                            }
                        }
                    }
                }
            }
        }
Example #8
0
        public void MeetingSurvey(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;
                }
                if (userInfo == null)//未获取到用户信息
                {
                    Response.Redirect("/IO/WeiXin/Error/获取用户信息错误!");
                    Response.End();
                    return;
                }
                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"))
                {
                    using (DBContext db = new DBContext())
                    {
                        var meeting = db.md_seminar_meeting_main.FirstOrDefault(m => m.mid == id);
                        if (meeting == null || meeting.Type == 1)
                        {
                            Response.Redirect("/IO/Error/Index");
                            Response.End();
                        }
                        var survayIdList     = db.md_seminar_survey.Where(s => s.mid == id).Select(s => s.sid).ToList();
                        var session          = Session["openid"].ToString();
                        var survayResultList = db.td_seminar_survey_result.FirstOrDefault(sr => survayIdList.Contains(sr.sid) && sr.uid == session);
                        if (survayResultList != null)
                        {
                            Response.Redirect("/IO/Survey/AlreadySurveyPrompt");
                            Response.End();
                        }
                        else
                        {
                            Response.Redirect("/IO/Survey/Index?id=" + id);
                            Response.End();
                        }
                    }
                }
                else//未认证跳转到登录页面
                {
                    Response.Redirect(url + "/portal/wechat/login");
                    Response.End();
                }
            }
        }