private void textBox1_TextChanged(object sender, EventArgs e) { int Fosc, FoscMul, T, Tdiv; string text1 = "", text2 = "", text3 = "", text4 = ""; bool AllData = ReadGUI(out Fosc, out FoscMul, out T, out Tdiv); // ReadGUI is true when no var is null, i.e we can culculate TMR0 TimerCalculator Tcalc = new TimerCalculator(Fosc, FoscMul, T, Tdiv); if (AllData) { int Presc; if (Tcalc.CalcPrescaler(out Presc)) { double TMR0 = Tcalc.CalcTimer(Presc); if (TMR0 > 0) { text3 = Presc.ToString(); text4 = Math.Round(TMR0).ToString(); } } } if (Fosc != 0 && FoscMul != 0) { double max = Tcalc.maxTimeForPresc(256); double min = Tcalc.minTimeForPresc(1); text1 = (max > 0 && min > 0) ? string.Format(CultureInfo.InvariantCulture, "Min : {0:#.#####E0} s", min) : "-"; text2 = (max > 0 && min > 0) ? string.Format("Max : {0:#.#####E0} s", max) : "-"; } label5.Text = text1; label6.Text = text2; textBox3.Text = text3; textBox4.Text = text4; }
public async Task <IActionResult> RegisterNewPrescription(Presc input) { var doc = await _dbService.GetDoctor(input.IdPatient); var pat = await _dbService.GetPatient(input.IdDoctor); if (input.DueDate < input.Date) { return(BadRequest()); } if (doc == null) { return(BadRequest()); } if (pat == null) { return(BadRequest()); } else { await _dbService.Register(input.Date, input.DueDate, input.IdPatient, input.IdDoctor); return(StatusCode(201)); } }
//显示待配处方 private void ShowWait() { string sel = ""; if (lvWait.SelectedItems.Count > 0) { Presc p = lvWait.SelectedItems[0] as Presc; sel = p.PrescNo; } List <Presc> ps = null; string wins = GetWins(Config.Soft.MacCode); string sql = "select prescno,windowno,patname from pat_prescinfo where windowno in ({0}) and doflag in('N','Y','W') and paytime>=convert(varchar(100),getdate(),23) order by toptime desc,paytime "; sql = string.Format(sql, wins); DataTable dtWait; csSql.ExecuteSelect(sql, Config.Soft.ConnString, out dtWait); if (dtWait != null && dtWait.Rows.Count > 0) { ps = new List <Presc>(); foreach (DataRow row in dtWait.Rows) { ps.Add(new Presc { PrescNo = row["prescno"].ToString(), WindowNo = int.Parse(row["windowno"].ToString()), PatName = row["patname"].ToString() }); } } lvWait.ItemsSource = ps; }
private void lvOver_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lvOver.SelectedItems.Count > 0) { Presc p = lvOver.SelectedItems[0] as Presc; tbPresc_Over.Text = p.PrescNo; tbTitle_Over.Text = p.WindowNo + "号窗口 " + p.PatName; ShowDetails(p.PrescNo, lvOver_Details); } }
private void lvWait_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lvWait.SelectedItems.Count > 0) { Presc p = lvWait.SelectedItems[0] as Presc; tbPresc.Text = p.PrescNo; tbTitle.Text = p.WindowNo + " " + p.PatName; ShowWaitDetails(p.PrescNo); } }
//显示完成处方 private void ShowOver() { string sel = ""; if (lvOver.SelectedItems.Count > 0) { Presc p = lvOver.SelectedItems[0] as Presc; sel = p.PrescNo; } List <Presc> ps = null; string sql = "select distinct prescno,windowno,patname,ledflag from view_presc_window where windowno='{0}' and prescdoflag in('O','H') order by prescdotime "; sql = string.Format(sql, Config.Soft.WindowNo); DataTable dtOver; csSql.ExecuteSelect(sql, Config.Soft.ConnString, out dtOver); if (dtOver != null && dtOver.Rows.Count > 0) { ps = new List <Presc>(); foreach (DataRow row in dtOver.Rows) { Presc p = new Presc { PrescNo = row["prescno"].ToString(), WindowNo = int.Parse(row["windowno"].ToString()), PatName = row["patname"].ToString(), Status = row["ledflag"].ToString(), }; switch (p.Status) { case "Y": p.Status = "显示"; break; case "N": p.Status = "隐藏"; break; } ps.Add(p); } } else { tbPresc_Over.Text = tbTitle_Over.Text = ""; lvOver_Details.ItemsSource = null; } lvOver.ItemsSource = ps; }
//显示待配处方 private void ShowWait() { string sel = ""; if (lvWait.SelectedItems.Count > 0) { Presc p = lvWait.SelectedItems[0] as Presc; sel = p.PrescNo; } List <Presc> ps = null; string sql = "select distinct prescno,windowno,patname from view_presc_window where windowno='{0}' and doflag in('N','Y','W') order by toptime desc,paytime "; sql = string.Format(sql, Config.Soft.WindowNo); DataTable dtWait; csSql.ExecuteSelect(sql, Config.Soft.ConnString, out dtWait); if (dtWait != null && dtWait.Rows.Count > 0) { ps = new List <Presc>(); foreach (DataRow row in dtWait.Rows) { ps.Add(new Presc { PrescNo = row["prescno"].ToString(), WindowNo = int.Parse(row["windowno"].ToString()), PatName = row["patname"].ToString() }); } } else { tbPresc.Text = tbTitle.Text = ""; lvWait_Details.Items.Clear(); } lvWait.ItemsSource = ps; }