//医生签到率
        public List <DoctorRegistration> GetDoctorRegistration()
        {
            List <DoctorRegistration> list_Registration = new List <DoctorRegistration>();
            Random random = new Random();

            for (int i = 1; i < 8; i++)
            {
                //Random random = new Random();
                DoctorRegistration registration = new DoctorRegistration();
                //registration.RegistrationRate = (float)random.Next(80,100)/(float)100;
                registration.RegistrationDate = DateTime.Now.Date.AddDays(-0.5 * i + 0.5).ToString();
                registration.DoctorTotal      = random.Next(800, 1000);
                registration.DoctorRegistered = random.Next(500, 800);
                registration.RegistrationRate = (float)Math.Round((float)registration.DoctorRegistered / (float)registration.DoctorTotal, 2);
                if (i % 2 == 0)
                {
                    registration.RegistrationTime = "2";
                }
                else
                {
                    registration.RegistrationTime = "1";
                }
                list_Registration.Add(registration);
            }

            return(list_Registration);
        }
        public ActionResult Registration(DoctorRegistration dr)
        {
            if (ModelState.IsValid)
            {
                DAS.Doctor d = new Doctor()
                {
                    Name         = dr.Name,
                    Designation  = dr.Designation,
                    SpecialityId = dr.SpecialityId,
                    Gender       = dr.Gender,
                    MobileNo     = dr.MobileNo,
                    Email        = dr.Email,
                    BMDCNo       = dr.BMDCNo,
                    Description  = dr.Description,
                    Degree_Spec  = dr.Description
                };
                db.Doctors.Add(d);

                DAS.Models.Login l = new Models.Login();
                l.Email    = dr.Email;
                l.Password = dr.Password;
                l.Role     = "D";

                db.Logins.Add(l);

                db.SaveChanges();
                ViewBag.SpecialityId = new SelectList(db.Specialities, "Id", "Name");
                return(View());
            }
            ViewBag.SpecialityId = new SelectList(db.Specialities, "Id", "Name");
            return(View());
        }
        public ActionResult CreateDoctor(Doctor doctor)
        {
            try
            {
                var userId         = Request.IsAuthenticated ? UserId : Guid.Empty;
                var roles          = new string[] { HospitalManagementSystem.Models.Constants.Roles.DOCTOR };
                var registerHelper = new RegisterHelper(userId, doctor.Person, roles);
                registerHelper.Register();

                if (!registerHelper.Response.Item1)
                {
                    doctor.Person.Error = registerHelper.Response.Item2;
                    return(View(doctor));
                }

                //DoctorRegistration.Register(new Doctor() { PersonId = doctor.Person.Id, PracticeNumber = doctor.PracticeNumber });
                int personId = doctor.Person.Id;
                doctor.PersonId = personId;
                doctor.Person   = null;
                DoctorRegistration.Register(doctor);

                return(RedirectToAction("RegisterSuccess", "Account", new { statusMessage = registerHelper.Response.Item2 }));
            }
            catch
            {
                return(View());
            }
        }
예제 #4
0
        // GET: Register
        public ActionResult Index()
        {
            DoctorRegistration doctorRegistration = new DoctorRegistration();

            doctorRegistration.states          = _commonServices.GetStates().ToList();
            doctorRegistration.specializations = _commonServices.GetSpecializations().ToList();
            doctorRegistration.cities          = new List <CORE.DATAMODEL.Common.City>();
            return(View(doctorRegistration));
        }
예제 #5
0
        public DoctorRegistrationResponse RegisterDoctor(DoctorRegistration Req)
        {
            DoctorRegistrationResponse _resp = new DoctorRegistrationResponse();

            try
            {
            }
            catch (Exception ex) {
                _resp.IsError = true;
                _resp.Message = ex.ToString();
            }
            return(_resp);
        }
예제 #6
0
 public ActionResult Index(DoctorRegistration req)
 {
     if (!ModelState.IsValid)
     {
         req.states          = _commonServices.GetStates().ToList();
         req.specializations = _commonServices.GetSpecializations().ToList();
         req.cities          = _commonServices.GetCities(req.State).ToList();
         return(View(req));
     }
     else
     {
         return(RedirectToAction("Index", "Dashboard", new { }));
     }
 }
예제 #7
0
        //医生签到率
        public List <DoctorRegistration> GetDoctorRegistration()
        {
            List <DoctorRegistration> list_Registration = new List <DoctorRegistration>();
            Random random = new Random();

            for (int i = 7; i > 0; i--)
            {
                DoctorRegistration registration = new DoctorRegistration();
                if (i == 1)
                {
                    registration.RegistrationDate = DateTime.Now.Date.AddDays(-0.5 * i + 0.5).ToString("MM-dd");
                    registration.RegistrationRate = (float)0.96;
                    if (i % 2 == 0)
                    {
                        registration.RegistrationTime = "下午";
                    }
                    else
                    {
                        registration.RegistrationTime = "上午";
                    }
                    list_Registration.Add(registration);
                }
                else
                {
                    registration.RegistrationDate = DateTime.Now.Date.AddDays(-0.5 * i + 0.5).ToString("MM-dd");
                    registration.DoctorTotal      = random.Next(950, 1000);
                    registration.DoctorRegistered = random.Next(900, 950) - 20 * i + 50;
                    if (i % 2 == 0)
                    {
                        registration.RegistrationTime = "下午";
                    }
                    else
                    {
                        registration.RegistrationTime = "上午";
                    }
                    registration.RegistrationRate = (float)Math.Round((float)registration.DoctorRegistered / (float)registration.DoctorTotal, 2);
                    list_Registration.Add(registration);
                }
            }

            return(list_Registration);
        }
예제 #8
0
        /// <summary>
        /// 医生签到率
        /// </summary>
        /// <param name="startDateTime"></param>
        /// <param name="endDateTime"></param>
        /// <param name="registrationTime">登陆时间(1上午,2下午)</param>
        /// <param name="type">数量类型(1总数,2签到数)</param>
        /// <returns></returns>
        //2.1医生签到率
        public List <DoctorRegistration> GetDoctorRegistration()
        {
            #region 注释

            /*
             * DateTime startDateTime, endDateTime, baseDateTime;
             * baseDateTime = DateTime.Now.Date;
             #region 基准时间处理
             * if (DateTime.Now < DateTime.Now.Date.AddHours(8))//还没到今天签到时间
             * {
             *  baseDateTime = DateTime.Now.Date;
             * }
             * else if (DateTime.Now >= DateTime.Now.Date.AddHours(8) && DateTime.Now <= DateTime.Now.Date.AddHours(14))//已经到今天早上签到时间
             * {
             *  baseDateTime = DateTime.Now.Date.AddHours(12);
             * }
             * else if (DateTime.Now > DateTime.Now.Date.AddHours(14))//已经到下午签到时间
             * {
             *  baseDateTime = DateTime.Now.Date.AddDays(1);
             * }
             #endregion
             * int[] registrationTime = new int[7];
             * String[] type = { "S", "R" };//S总数 R已签到人数
             * List<DoctorRegistration> List_doctorRegistration = new List<DoctorRegistration>();
             * for (int i = 1; i < registrationTime.Count() + 1; i++)
             * {
             *  startDateTime = baseDateTime.AddDays(-0.5 * i);
             *  endDateTime = baseDateTime.AddDays(-0.5 * i + 0.5);
             *  DoctorRegistration doctorRegistration = new DoctorRegistration();
             *  for (int j = 0; j < type.Count(); j++)
             *  {
             #region 总数
             *      if (type[j] == "S") //总数
             *      {
             *          String command = GetCommandForDoctorRegistrations(startDateTime, endDateTime, type[j]);
             *          DbCommand queryCommand = db.GetSqlStringCommand(command);
             *          using (IDataReader reader = db.ExecuteReader(queryCommand))
             *          {
             *              while (reader.Read())
             *              {
             *                  doctorRegistration.DoctorTotal = reader["DoctorTotal"] is DBNull ? 0 : Convert.ToInt32(reader["DoctorTotal"]);
             *              }
             *          }
             *      }
             #endregion
             #region 签到人数
             *      if (type[j] == "R") //签到人数
             *      {
             *          String command = GetCommandForDoctorRegistrations(startDateTime, endDateTime, type[j]);
             *          DbCommand queryCommand = db.GetSqlStringCommand(command);
             *          using (IDataReader reader = db.ExecuteReader(queryCommand))
             *          {
             *              while (reader.Read())
             *              {
             *                  doctorRegistration.DoctorRegistered = reader["DoctorRegistered"] is DBNull ? 0 : Convert.ToInt32(reader["DoctorRegistered"]);
             *              }
             *          }
             *
             *      }
             #endregion
             *  }
             *  if (doctorRegistration.DoctorTotal != 0)
             *      doctorRegistration.RegistrationRate = (float)Math.Round((float)doctorRegistration.DoctorRegistered / (float)doctorRegistration.DoctorTotal, 2);
             *  else { doctorRegistration.RegistrationRate = 0; }
             #region 上午下午处理
             *  if (startDateTime.ToString("HH:mm:ss") == "00:00:00")
             *  {
             *      doctorRegistration.RegistrationTime = "上午";
             *  }
             *  else
             *  {
             *      doctorRegistration.RegistrationTime = "下午";
             *  }
             #endregion
             *  doctorRegistration.RegistrationDate = startDateTime.ToString("MM-dd");
             *  List_doctorRegistration.Add(doctorRegistration);
             *
             * }
             *
             *
             *
             * return List_doctorRegistration;
             */
            #endregion

            #region 测试
            List <DoctorRegistration> list_Registration = new List <DoctorRegistration>();
            Random random = new Random();
            for (int i = 7; i > 0; i--)
            {
                DoctorRegistration registration = new DoctorRegistration();
                if (i == 1)
                {
                    registration.RegistrationDate = DateTime.Now.Date.AddDays(-0.5 * i + 0.5).ToString("MM-dd");
                    registration.RegistrationRate = (float)0.96;
                    if (i % 2 == 0)
                    {
                        registration.RegistrationTime = "下午";
                    }
                    else
                    {
                        registration.RegistrationTime = "上午";
                    }
                    list_Registration.Add(registration);
                }
                else
                {
                    registration.RegistrationDate = DateTime.Now.Date.AddDays(-0.5 * i + 0.5).ToString("MM-dd");
                    registration.DoctorTotal      = random.Next(950, 1000);
                    registration.DoctorRegistered = random.Next(900, 950) - 20 * i + 50;
                    if (i % 2 == 0)
                    {
                        registration.RegistrationTime = "下午";
                    }
                    else
                    {
                        registration.RegistrationTime = "上午";
                    }
                    registration.RegistrationRate = (float)Math.Round((float)registration.DoctorRegistered / (float)registration.DoctorTotal, 2);
                    list_Registration.Add(registration);
                }
            }

            return(list_Registration);

            #endregion
        }