Exemplo n.º 1
0
        private void buttonOtgrZaMesac_Click(object sender, RoutedEventArgs e) //продажи за месяц
        {
            MyContext             db       = new MyContext();
            List <CheckViewModel> lst      = new List <CheckViewModel>();
            List <CheckInfo>      WorkTime = db.CheckInfos.ToList().Where(x => x.Check.Date > DateTime.Now.AddDays(-30)).Where(x => x.Check.Date < DateTime.Now).ToList();

            foreach (CheckInfo s in WorkTime)
            {
                CheckViewModel t = new CheckViewModel();
                t.Id = s.Id;
                string name;
                if (s.Products.Secondary == null)
                {
                    name = s.Products.MainProduct.CodeName;
                }
                else
                {
                    name = s.Products.Secondary.Name;
                }
                t.Name   = name;
                t.Price  = s.Products.SellPrice;
                t.Count  = s.Count;
                t.GoodId = s.Products.Id;
                lst.Add(t);
            }
            dataGrid_useful.ItemsSource = lst;
            dataGrid_goods.Visibility   = Visibility.Hidden;
            dataGrid_useful.Visibility  = Visibility.Visible;
        }
Exemplo n.º 2
0
        public static void NewResolvedCheck(Check check, string disposition)
        {
            // PLB 1/23/2019 Added r.RecordID == check.RecordID.
            // This fxed the problem that Bill reported in an email dated 1/21/2019.
            CheckViewModel alreadyResolved = resolvedChecks.Where(r => (r.RecordID == check.RecordID && (r.Num == check.Num || r.Num == -check.Num))).FirstOrDefault();
            CheckViewModel cvm             = null;

            if (alreadyResolved == null)
            {
                cvm = new CheckViewModel
                {
                    RecordID           = check.RecordID,
                    sRecordID          = check.RecordID.ToString(),
                    InterviewRecordID  = check.InterviewRecordID,
                    sInterviewRecordID = check.InterviewRecordID.ToString(),
                    Name        = check.Name,
                    Num         = check.Num,
                    sNum        = check.Num.ToString(),
                    Date        = check.Date,
                    sDate       = check.Date.ToString("MM/dd/yyyy"),
                    Service     = check.Service,
                    Disposition = disposition
                };

                resolvedChecks.Add(cvm);
            }
        }
Exemplo n.º 3
0
 private void Border_MouseDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (Convert.ToInt32(textBox_Count.Text) <= view.Balance && textBox_Count.Text != "0")
         {
             CheckViewModel ch = new CheckViewModel();
             ch.Count  = Convert.ToInt32(textBox_Count.Text);
             ch.Price  = view.SellPrice;
             ch.Name   = view.Name;
             ch.Id     = i;
             ch.GoodId = view.Id;//все верно там также
             i++;
             Sum += ch.Sum;
             checks.Add(ch);
             AddGoodsGrid.Visibility   = Visibility.Hidden;
             dataGridCheck.ItemsSource = checks.ToList();
             label4.Content            = Convert.ToString(Sum);
             textBox_Count.Text        = null;
             Main.IsEnabled            = true;
         }
         else
         {
             MessageBox.Show("Не хватает на складе", "Ошибка");
         }
     }
     catch
     {
         MessageBox.Show("Error");
     }
 }
Exemplo n.º 4
0
        public IActionResult CheckDetails(string CheckId)
        {
            var userId = userManager.GetUserId(User);

            var Check = context.Checks.Include(c => c.Products).FirstOrDefault(c => c.CheckId.ToString() == CheckId);

            if (Check is null)
            {
                return(View("Error", new ErrorViewModel {
                    RequestId = "Wrong Id"
                }));
            }

            CheckViewModel checkViewModel = new CheckViewModel(Check);

            foreach (var i in context.productUsers)
            {
                if (Check.Products.Contains(i.Product) && i.UserId == userId)
                {
                    checkViewModel.Products.FirstOrDefault(p => p.ProductId == i.ProductId).IsChecked = true;
                }
            }

            return(View(new CheckAndUserViewModel(checkViewModel, context.Users.FirstOrDefault(u => u.Id == userId))));
        }
Exemplo n.º 5
0
        private void buttonPoslednProdagi_Click(object sender, RoutedEventArgs e)
        {
            MyContext             db       = new MyContext();
            List <CheckViewModel> lst      = new List <CheckViewModel>();
            List <CheckInfo>      WorkTime = db.CheckInfos.ToList().Where(x => x.Check.Date > DateTime.Now.AddDays(-30)).Where(x => x.Check.Date < DateTime.Now).ToList();

            foreach (CheckInfo s in WorkTime)
            {
                CheckViewModel t = new CheckViewModel();
                t.Id = s.Id;
                string name;
                if (s.Products.Secondary == null)
                {
                    name = s.Products.MainProduct.CodeName;
                }
                else
                {
                    name = s.Products.Secondary.Name;
                }
                t.Name  = name;
                t.Price = s.Products.SellPrice;
                t.Count = s.Count;
                lst.Add(t);
            }
            dataGrid_checks.ItemsSource = lst;
        }
Exemplo n.º 6
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     this.DataContext = MainPageViewModel.CurrentQuiz;
     if (e.Parameter is MainPageViewModel data)
     {
         bool isCorrect = false;
         data.SerialByte.Throttle(TimeSpan.FromMilliseconds(500))
         .Where(x => x != 0x00)
         .Do(async x =>
         {
             isCorrect = (x == 0x01) == MainPageViewModel.CurrentQuiz.Value.Correct;
             if (isCorrect)
             {
                 await Task.Run(async() => await data.SerialManager.SendSign());
             }
         })
         .ObserveOn(SynchronizationContext.Current)
         .Subscribe(_ =>
         {
             Debug.WriteLine("QuizControl Rx");
             checkViewModel = new CheckViewModel(isCorrect, data.SerialByte);
             Frame.Navigate(typeof(CheckPage), checkViewModel);
         });
     }
     base.OnNavigatedTo(e);
 }
Exemplo n.º 7
0
        private List <CheckViewModel> HandleTwoDartFinishes(int score)
        {
            var checks = new List <CheckViewModel>();

            foreach (var field in GetRelevantFields())
            {
                CheckViewModel check;
                var            prop          = 0.0;
                var            oneDartFinish = score == field.Value && field.Type == FieldEnum.Double;
                if (oneDartFinish)
                {
                    check = HandleLastDart(score).Single();
                    prop  = check.Check.Propability;
                }
                else
                {
                    check = HandleLastDart(score - field.Value)?.FirstOrDefault();
                    if (check == null)
                    {
                        continue;
                    }
                    prop = check.Check.Propability * CheckSimulator.GetSuccessRate(field, _config.My, _config.Sigma);
                }


                var subChecks = new List <Check>();
                var dict      = CheckSimulator.GetNeighbors(field, _config.My, _config.Sigma);
                foreach (var neighbor in dict.Keys)
                {
                    if (score - neighbor.Value == 0 && (neighbor.Type == FieldEnum.Double || neighbor.Type == FieldEnum.DoubleBull))
                    {
                        var randomCheck = new CheckViewModel(neighbor, null, null, dict[neighbor], dict[neighbor]);
                        prop += dict[neighbor];
                        subChecks.Add(randomCheck.Check);
                        continue;
                    }

                    var subCheck = HandleLastDart(score - neighbor.Value)
                                   ?.FirstOrDefault();
                    if (subCheck == null)
                    {
                        continue;
                    }
                    subCheck.Check.AufCheckDart = neighbor;
                    subCheck.Check.Propability  = subCheck.Check.Propability * dict[neighbor];
                    prop += subCheck.Check.Propability;
                    subChecks.Add(subCheck.Check);
                }

                var newCheck = new CheckViewModel(field, check.Check.CheckDart, null, prop, check.Check.Propability * CheckSimulator.GetSuccessRate(field, _config.My, _config.Sigma), subChecks);
                if (oneDartFinish)
                {
                    newCheck = new CheckViewModel(field, null, null, prop, prop, subChecks);
                }
                checks.Add(newCheck);
            }

            return(checks.OrderByDescending(x => x.Check.Propability).ToList());
        }
Exemplo n.º 8
0
        public CheckPage(FriendCheckViewModel vm)
        {
            InitializeComponent();
            vm.CurrentPage = this;
            vm.SyncCheckItemsWithItems();

            BindingContext = viewModel = vm;
        }
Exemplo n.º 9
0
        public IActionResult CheckValidation(CheckViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", model));
            }

            return(null);
        }
Exemplo n.º 10
0
 private void dataGridCheck_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (dataGridCheck.SelectedItem != null)
     {
         CheckViewModel dataforlabel = dataGridCheck.SelectedItem as CheckViewModel;
         label_Selected.Content      = dataforlabel.Name;
         label_SummaSelected.Content = Convert.ToString(dataforlabel.Price) + " X " + Convert.ToString(dataforlabel.Count) + " = " + Convert.ToString(dataforlabel.Sum);
     }
 }
Exemplo n.º 11
0
        public async Task <IActionResult> Checkphpay([FromBody] CheckViewModel body)
        {
            var model = await db.Phtest_Pays.FirstOrDefaultAsync(x => x.Number == body.num && x.Type == body.type);

            if (model == null)
            {
                return(Json("pay"));
            }
            return(Json("sucess"));
        }
Exemplo n.º 12
0
        public WaiterWnd()
        {
            InitializeComponent();
            CheckViewModel vm      = new CheckViewModel();
            NewChekControl newChek = new NewChekControl();

            vm.Update          += newChek.Update;
            newChek.DataContext = vm;
            content.Children.Add(newChek);
        }
Exemplo n.º 13
0
        public async Task <IActionResult> Checknum([FromBody] CheckViewModel request)
        {
            AppUsern reUser = await userManager.FindByNameAsync(request.num);

            if (reUser == null)
            {
                return(Json(Ok()));
            }

            return(Json(BadRequest()));
        }
Exemplo n.º 14
0
        public ViewResult Check(CheckViewModel model)
        {
            if (this.ModelState.IsValid)
            {
                var parsedIssns = ParseISSNs(model.ISSNs);
                model.FoundISSNs    = this.journalRepository.SearchByISSN(parsedIssns).Select(j => j.ISSN).ToSet();
                model.NotFoundISSNs = parsedIssns.Except(model.FoundISSNs).ToSet();
            }

            return(this.View(model));
        }
Exemplo n.º 15
0
        public CheckViewModel MakeOrder(string pin)
        {
            if (string.IsNullOrEmpty(pin))
            {
                _logger.Warn("Incorrect Pin in MakeOrder");
                return(null);
            }

            return(this.InvokeInUnitOfWorkScope(uow =>
            {
                var buyer = uow.Repository <Buyer>().FirstOrDefault(b => b.Pin.ToUpper().Equals(pin.ToUpper(), StringComparison.OrdinalIgnoreCase));
                if (buyer == null)
                {
                    _logger.Warn($"Buyer with PIN={pin} not found");
                    return null;
                }

                var cart = this.GetCartById(buyer.Id);
                var result = new CheckViewModel();

                if (!cart.CartCollection.Any())
                {
                    result.Balance = buyer.Balance;
                    return result;
                }

                uow.BeginTransaction();
                foreach (var item in cart.CartCollection)
                {
                    var ordereditem = this.AddOrderFromCartItem(item, ref uow, ref buyer);
                    if (ordereditem != null)
                    {
                        result.CheckLines.Add(ordereditem);
                    }
                }

                buyer = uow.Repository <Buyer>().AddOrUpdate(buyer);

                try
                {
                    uow.Save();
                    uow.Commit();
                }
                catch (Exception ex)
                {
                    _logger.Warn($"DB Error while saving order PIN={buyer.Pin}. Exception Message: {ex.Message} ");
                    return null;
                }

                result.Balance = buyer.Balance;

                return result;
            }));
        }
Exemplo n.º 16
0
        CreateCheck([Bind(checkProperties)] CheckViewModel c)
        {
            if (!ModelState.IsValid)
            {
                return(View(c));
            }
            c.ID = Guid.NewGuid().ToString();
            var o = PaymentObjectFactory.CreateCheck(c.ID, c.Amount, c.Currency, c.Memo, c.Payer, c.PayerAccountNumber,
                                                     c.Payee, c.PayeeAccountNumber, c.CheckNumber, c.ValidFrom, c.ValidTo);
            await payments.AddObject(o);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 17
0
        public async Task <ContentResult> Check(CheckViewModel viewModel)
        {
            if (!ModelState.IsValid || viewModel == null)
            {
                return(Content("Make sure you have filled up the fields"));
            }

            string url = viewModel.Url;

            var content = new FormUrlEncodedContent(new Dictionary <string, string>()
            {
                { "num_red_wool", "1" },
                { "num_green_wool", "1" },
                { "num_blue_wool", "1" },
            });
            var uriB = new UriBuilder(url);

            uriB.Path = "/request_price";
            using var httpResponse = await _httpClient.PostAsync(uriB.Uri, content);

            httpResponse.EnsureSuccessStatusCode();
            CheckPriceResponse checkPriceResponse = JsonConvert.DeserializeObject <CheckPriceResponse>(await httpResponse.Content.ReadAsStringAsync());

            if (checkPriceResponse != null && checkPriceResponse.Price == 111)
            {
                var leaderBoardRow = await _context.LeaderboardRow
                                     .FirstOrDefaultAsync(m => m.HackerrankUsername == viewModel.Username);

                if (leaderBoardRow == null)
                {
                    return(Content("Your application is working great, but are you sure your username is correct?"));
                }

                leaderBoardRow.LabScore = int.Parse(Configuration["Scores:Lab"]);

                try
                {
                    _context.Update(leaderBoardRow);
                    await _context.SaveChangesAsync();
                } catch (DbUpdateConcurrencyException)
                {
                    return(Content("Unknown Error occured"));
                }

                return(Content("Your Lab score has been updated to 200! Multiple submissions will not get you more marks btw"));
            }
            else
            {
                return(Content("Couldn't reach your application"));
            }
        }
Exemplo n.º 18
0
        public async Task <IActionResult> Offquite([FromBody] CheckViewModel request)
        {
            var user = await userManager.FindByNameAsync(request.num);

            if (user == null)
            {
                return(Json(BadRequest()));
            }
            user.offenable = true;

            await db.SaveChangesAsync();

            return(Json(Ok()));
        }
Exemplo n.º 19
0
        private static ImportRow NewImportRow(List <Check> researchChecks, CheckViewModel resolvedCheck, string disposition)
        {
            ImportRow importRow = new ImportRow
            {
                RecordID          = resolvedCheck.RecordID,
                InterviewRecordID = resolvedCheck.InterviewRecordID
            };

            PrepopulateImportRow(researchChecks, importRow);

            PopulateImportRow(resolvedCheck, importRow);

            return(importRow);
        }
Exemplo n.º 20
0
        private static void PrepopulateImportRow(List <Check> researchChecks, ImportRow importRow)
        {
            List <Check> rChecks = researchChecks.FindAll(r => r.RecordID == importRow.RecordID && r.InterviewRecordID == importRow.InterviewRecordID).ToList();

            foreach (Check resolvedCheck in rChecks)
            {
                CheckViewModel cvm = new CheckViewModel();
                cvm.Num         = resolvedCheck.Num;
                cvm.Disposition = resolvedCheck.Disposition;
                cvm.Service     = resolvedCheck.Service;

                PopulateImportRow(cvm, importRow);
            }
        }
Exemplo n.º 21
0
        private List <CheckViewModel> HandleLastDart(int score)
        {
            if (!IsAFinish(score, 1))
            {
                return(null);
            }
            var doubleField = GetAllDoubles().Single(x => x.Value == score);
            var doubleProp  = CheckSimulator.GetSuccessRate(doubleField, _config.My, _config.Sigma);
            var check       = new CheckViewModel(doubleField, null, null, doubleProp, doubleProp);

            return(new List <CheckViewModel> {
                check
            });
        }
Exemplo n.º 22
0
 private void Border_MouseDown_2(object sender, MouseButtonEventArgs e)
 {
     //delete select
     if (dataGridCheck.SelectedItem != null)
     {
         CheckViewModel s = dataGridCheck.SelectedItem as CheckViewModel;
         checks.Remove(s);
         dataGridCheck.ItemsSource = null;
         dataGridCheck.ItemsSource = checks;
     }
     else
     {
         MessageBox.Show("Вы не выбрали ничего", "Ошибка");
     }
 }
Exemplo n.º 23
0
        public ResponseModel <bool> OilOrder_Check(CheckViewModel model)
        {
            var oilOrder = _db.OilMaterialOrder.Where(x => x.Id.ToString().ToLower() == model.Id).FirstOrDefault();

            oilOrder.No = model.CheckNo;
            int num = _db.SaveChanges();

            if (num > 0)
            {
                return(new ResponseModel <bool> {
                    code = (int)code.Success, data = true, message = "审核油料订单成功"
                });
            }
            return(new ResponseModel <bool> {
                code = (int)code.UpdateCheckOilOrderFail, data = false, message = "审核油料订单失败"
            });
        }
Exemplo n.º 24
0
        public ResponseModel <bool> Leave_Check(CheckViewModel model)
        {
            var leave = db.LeaveOffice.Where(x => x.Id.ToString().ToLower() == model.id).FirstOrDefault();

            leave.No = model.CheckNo;
            db.LeaveOffice.Update(leave);
            int num = db.SaveChanges();

            if (num > 0)
            {
                return(new ResponseModel <bool> {
                    code = (int)code.Success, data = true, message = "审核离职信息成功"
                });
            }
            return(new ResponseModel <bool> {
                code = (int)code.UpdaateCheckLeaveFail, data = false, message = "审核离职信息失败"
            });
        }
Exemplo n.º 25
0
        public ActionResult Check()
        {
            CheckViewModel checkViewModel = new CheckViewModel();
            int            weekOfYear     = DateTimeHelper.GetWeekOfYear(DateTime.Now);

            checkViewModel.CurrentWeekOfYear = weekOfYear;
            int    year = DateTime.Now.Year;
            string text = Request.QueryString["year"];

            if (!string.IsNullOrEmpty(text))
            {
                int.TryParse(text, out year);
            }
            int    month = DateTime.Now.Month;
            string text2 = Request.QueryString["month"];

            if (!string.IsNullOrEmpty(text2))
            {
                int.TryParse(text2, out month);
            }
            if (year == DateTime.Now.Year && month > DateTime.Now.Month)
            {
                month = DateTime.Now.Month;
            }
            checkViewModel.WeekList = DateTimeHelper.GetWeekListOfMonth(year, month);
            int weekOfYear2 = DateTimeHelper.GetWeekOfYear(Request.QueryString["week"], checkViewModel.WeekList);

            checkViewModel.Year       = year;
            checkViewModel.Month      = month;
            checkViewModel.WeekOfYear = weekOfYear2;
            string        value = Request.QueryString["checkViewType"];
            CheckViewType checkViewType;

            if (!string.IsNullOrEmpty(value) && Enum.TryParse <CheckViewType>(value, out checkViewType))
            {
                checkViewModel.CheckViewType = checkViewType;
            }
            checkViewModel.WeeklyReportList = _weeklyReportManager.GetWeeklyReportListForCheck(UserContext.Domain.Id, UserContext.User.Id, year, weekOfYear2, checkViewModel.CheckViewType);

            ViewBag.CurrentWeekOfYear = checkViewModel.CurrentWeekOfYear;

            return(View(checkViewModel));
        }
Exemplo n.º 26
0
        public ResponseModel <bool> Entry_Check(CheckViewModel model)
        {
            var entry = db.Entry.Where(x => x.Id.ToString().ToLower() == model.id).FirstOrDefault();

            entry.No    = model.CheckNo;
            entry.Title = model.CheckTitle;
            db.Entry.Update(entry);
            int num = db.SaveChanges();

            if (num > 0)
            {
                return(new ResponseModel <bool> {
                    code = (int)code.Success, data = true, message = "审核入职信息成功"
                });
            }
            return(new ResponseModel <bool> {
                code = (int)code.UpdateCheckEntryFail, data = false, message = "审核入职信息失败"
            });
        }
        public ActionResult Checkout()
        {
            var CartProductsCookie = Request.Cookies["CartDrugs"];

            CheckViewModel checkViewModel = new CheckViewModel();

            if (CartProductsCookie != null)
            {
                //var productIds = CartProductsCookie.Value;

                //var ids = productIds.Split('-');

                //List<int> pIds = ids.Select(x=> int.Parse(x)).ToList();

                checkViewModel.cartProductds = CartProductsCookie.Value.Split('-').Select(x => int.Parse(x)).ToList();

                checkViewModel.cartProducts = ProductsServices.Instance.GetProducts(checkViewModel.cartProductds);
            }
            return(View(checkViewModel));
        }
Exemplo n.º 28
0
        private void SetProductUsersChanges(CheckViewModel model)
        {
            var userId = userManager.GetUserId(User);

            foreach (var i in model.Products)
            {
                var productUser = context.productUsers.FirstOrDefault(pu => pu.ProductId == i.ProductId && pu.UserId == userId);

                var user    = context.Users.FirstOrDefault(u => u.Id == userId);
                var product = context.Product.FirstOrDefault(p => p.ProductId == i.ProductId);

                if (productUser == null && i.IsChecked == true)
                {
                    context.productUsers.Add(new ProductUser(user, product));
                }
                if (productUser != null && i.IsChecked == false)
                {
                    context.productUsers.Remove(productUser);
                }
            }
        }
Exemplo n.º 29
0
        public async Task <IActionResult> EditCheck([Bind(checkProperties)] CheckViewModel c)
        {
            if (!ModelState.IsValid)
            {
                return(View("EditCheck", c));
            }
            var o = await payments.GetObject(c.ID) as CheckObject;

            o.DbRecord.Payer = c.Payer;
            o.DbRecord.PayerAccountNumber = c.PayerAccountNumber;
            o.DbRecord.Payee = c.Payee;
            o.DbRecord.PayeeAccountNumber = c.PayeeAccountNumber;
            o.DbRecord.Amount             = c.Amount;
            o.DbRecord.Currency           = c.Currency;
            o.DbRecord.CheckNumber        = c.CheckNumber;
            o.DbRecord.Memo      = c.Memo;
            o.DbRecord.ValidFrom = c.ValidFrom ?? DateTime.MinValue;
            o.DbRecord.ValidTo   = c.ValidTo ?? DateTime.MaxValue;
            await payments.UpdateObject(o);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 30
0
        public async Task <IActionResult> Kurseacces([FromBody] CheckViewModel port)
        {
            var model = await db.Allowkurs.FirstOrDefaultAsync(x => x.UserPhone == port.num);



            if (model == null)
            {
                var mmm = await db.Allowkurs.AddAsync(new Allowkurs
                {
                    UserPhone = port.num
                });

                await db.SaveChangesAsync();

                var nmodel = await db.Allowkurs.FirstOrDefaultAsync(x => x.UserPhone == port.num);

                return(Json(nmodel));
            }

            return(Json(model));
        }
Exemplo n.º 31
0
        private static object m_SyncRoot = new Object(); //互斥对象

        #endregion Fields

        #region Methods

        /// <summary>
        /// 病历页面初始化
        /// </summary>
        /// <param name="TaskCode">任务编码</param>
        /// <param name="PatientOrder">序号</param>
        /// <param name="state">填写状态</param>
        /// <returns></returns>
        public ActionResult AddPatientRecord(string TaskCode, int PatientOrder, string state)
        {
            //, int PatientOrder//测试
            M_PatientRecordBLL prBLL = new M_PatientRecordBLL();
            M_DictionaryBLL dBLL = new M_DictionaryBLL();
            //int PatientOrder = 1;//测试

            M_AttemperData result = prBLL.GetAttemperData(TaskCode, state);//根据任务编码获取调度信息
            ViewBag.Attemper = result;

            ViewData["TaskCode"] = TaskCode == null ? "2012102023555200020101" : TaskCode;
            M_PatientRecord prInfo;//病历主表信息
            M_PatientRecordAppend pra;//病历附表--体检等信息
            M_PatientRecordCPR prCPR;//病历附表--心肺复苏
            if (state == "new")
            {
                int AddPatientOrder = prBLL.GetPatientMaxOrder(TaskCode);
                ViewData["PatientOrder"] = AddPatientOrder;
                prInfo = new M_PatientRecord();
                pra = new M_PatientRecordAppend();
                prCPR = new M_PatientRecordCPR();
                ViewBag.PRInfo = prInfo;//病历主表信息--传到页面
                ViewBag.PRAppendInfo = pra;//病历附表--体检等信息--传到页面
                ViewBag.PRCPRInfo = prCPR;//病历附表--心肺复苏--传到页面

            }
            else
            {
                object oPatientInfo;//病历主表
                prBLL.GetPatientInfo(TaskCode, PatientOrder, out oPatientInfo, out pra, out prCPR);
                if (PatientOrder > 0)
                {
                    prInfo = (M_PatientRecord)oPatientInfo;
                    ViewBag.PRInfo = prInfo;//病历主表信息--传到页面
                    ViewBag.PRAppendInfo = pra;//病历附表--体检等信息--传到页面
                    ViewBag.PRCPRInfo = prCPR;//病历附表--心肺复苏--传到页面
                    ViewData["PatientOrder"] = PatientOrder;
                    if (SuperRole("SuperRole"))
                    {
                        this.ViewData["SuperRole"] = "SuperRole";//登录人有超级权限
                    }
                    else
                        this.ViewData["SuperRole"] = "";

                    string role = UserOperateContext.Current.getMaxPerForRole();//获取登录人角色(医生、护士、司机)
                    this.ViewData["PatientRole"] = role;//
                }
            }
            ViewData["state"] = state == null ? "new" : state;

            if (SuperRole("PRAuditCPR"))
            {
                this.ViewData["PRAuditCPR"] = "PRAuditCPR";//登录人有“心肺复苏审核”权限
            }
            else
                this.ViewData["PRAuditCPR"] = "";

            if (SuperRole("SubCenterSpotChecks"))
            {
                this.ViewData["SubCenterSpotChecks"] = "SubCenterSpotChecks";//登录人有"分中心抽查"权限
            }
            else
                this.ViewData["SubCenterSpotChecks"] = "";

            if (SuperRole("CenterSpotChecks"))
            {
                this.ViewData["CenterSpotChecks"] = "CenterSpotChecks";//登录人有"中心抽查"权限
            }
            else
                this.ViewData["CenterSpotChecks"] = "";

            P_User pUser = new P_User();
            pUser = UserOperateContext.Current.Session_UsrInfo;//获取登录人信息
            ViewData["AgentCode"] = pUser.ID;
            ViewData["AgentWorkID"] = pUser.WorkCode;
            ViewData["AgentName"] = pUser.Name;
            ViewData["BeginFillPatientTime"] = DateTime.Now.ToString();//开始填写病历时间

            #region 为病历页面的CheckBoxList项目赋值
            CheckViewModel model = new CheckViewModel();
            //model.DiseasesClassification = dBLL.GetCheckBoxModelByTableName("M_ZCaseTemplate");//病种分类
            //model.GongShiRen = dBLL.GetCheckBoxModel("GongShiRen");//供史人
            //model.AnamnesisllnessHistory = dBLL.GetCheckBoxModel("PastMedicalHistory");//既往病史
            model.BodyFigure = dBLL.GetCheckBoxModel("PiFu");//皮肤
            model.Head = dBLL.GetCheckBoxModel("Head");//头部
            model.Neck = dBLL.GetCheckBoxModel("Neck");//颈部
            model.Chest = dBLL.GetCheckBoxModel("Chest");//胸部
            model.Lung = dBLL.GetCheckBoxModel("Lung");//肺脏
            model.LungLeft = dBLL.GetCheckBoxModel("LungLeft");//左肺
            model.LungRight = dBLL.GetCheckBoxModel("LungLeft");//右肺
            model.FuBu = dBLL.GetCheckBoxModel("FuBu");//腹部
            model.JiZhu = dBLL.GetCheckBoxModel("JiZhu");//脊柱
            model.Limb = dBLL.GetCheckBoxModel("Limb");//四肢
            #endregion

            #region 为病历页面的RadioButtonList从数据库传值

            var ProvideMedicalHistoryPeople = new object();//供史人
            var DiseasesClassification = new object();//病种分类
            var PastMedicalHistory = new object();//既往病史
            var BabinskiSign = new object();//神经系统--巴氏征
            var ChestExtrusionTest = new object();//胸廓挤压试验
            var PelvicExtrusionTest = new object();//骨盆挤压试验

            lock (m_SyncRoot)
            {
                ProvideMedicalHistoryPeople = CacheHelper.GetCache("ProvideMedicalHistoryPeople");
                DiseasesClassification = CacheHelper.GetCache("DiseasesClassification");
                PastMedicalHistory = CacheHelper.GetCache("PastMedicalHistory");
                BabinskiSign = CacheHelper.GetCache("BabinskiSign");
                ChestExtrusionTest = CacheHelper.GetCache("ChestExtrusionTest");
                PelvicExtrusionTest = CacheHelper.GetCache("PelvicExtrusionTest");
                if (ProvideMedicalHistoryPeople == null)
                {
                    ProvideMedicalHistoryPeople = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "ProvideMedicalHistoryPeople", "checkbox");
                    CacheHelper.SetCache("ProvideMedicalHistoryPeople", ProvideMedicalHistoryPeople);
                }
                if (DiseasesClassification == null)
                {
                    DiseasesClassification = dBLL.GetCheckBoxListByTableName("M_ZCaseTemplate", "DiseasesClassification", "checkbox");
                    CacheHelper.SetCache("DiseasesClassification", DiseasesClassification);
                }
                if (PastMedicalHistory == null)
                {
                    PastMedicalHistory = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "PastMedicalHistory", "checkbox");
                    CacheHelper.SetCache("PastMedicalHistory", PastMedicalHistory);
                }
                if (BabinskiSign == null)
                {
                    BabinskiSign = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "BabinskiSign", "checkbox");
                    CacheHelper.SetCache("BabinskiSign", BabinskiSign);
                }
                if (ChestExtrusionTest == null)
                {
                    ChestExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "ChestExtrusionTest", "radio");
                    CacheHelper.SetCache("ChestExtrusionTest", ChestExtrusionTest);
                }
                if (PelvicExtrusionTest == null)
                {
                    PelvicExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "PelvicExtrusionTest", "radio");
                    CacheHelper.SetCache("PelvicExtrusionTest", PelvicExtrusionTest);
                }
            }
            this.ViewData["ProvideMedicalHistoryPeople"] = ProvideMedicalHistoryPeople;
            this.ViewData["DiseasesClassification"] = DiseasesClassification;
            this.ViewData["PastMedicalHistory"] = PastMedicalHistory;
            this.ViewData["BabinskiSign"] = BabinskiSign;
            this.ViewData["ChestExtrusionTest"] = ChestExtrusionTest;
            this.ViewData["PelvicExtrusionTest"] = PelvicExtrusionTest;

            #endregion

            return View(model);
        }