protected void LoginProving(string user, string pwd) { if (user == "") { MessageBox.Show("请输入登录用户名"); } else { DataSet ds = db.GetPIVAsDB("select top 1 DEmployeeID,AccountID,Pas,DEmployeeCode,DEmployeeName from DEmployee where AccountID='" + user + "' and Pas='******'"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count <= 0) { MessageBox.Show(" 登录失败,输入用户名与密码不匹配 !!!(连接成功) "); } else if (ds.Tables[0].Rows.Count > 0) { string User = cbox_user.Text; if (user.Length >= 4 && user.Substring(0, 4) != "7777")//扫描二维码不保存本地 { db.SaveXML(cbox_user.Text, txt_pwd.Text); } db.IniWriteValuePivas("User", "pwd", ""); //信息保存,返回给主窗体使用 _DEmployeeID = ds.Tables[0].Rows[0]["DEmployeeID"].ToString(); _EmpCode = ds.Tables[0].Rows[0]["DEmployeeCode"].ToString(); _EmpName = ds.Tables[0].Rows[0]["DEmployeeName"].ToString(); this.DialogResult = DialogResult.OK; this.Close(); } } }
private void PackCollect_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(db.IniReadValuePivas("TimeShowType", "IsshowHS"))) { db.IniWriteValuePivas("TimeShowType", "IsshowHS", "1"); isshowHS = "1"; } else { isshowHS = db.IniReadValuePivas("TimeShowType", "IsshowHS"); } datetimeType(); bddvg(); bdbatch(); dbcob(); //foreach (Control ctr in panel2.Controls) //{ // if (ctr is CheckBox) // { // CheckBox cb = ctr as CheckBox; // cb.Checked = true; // } //} //if (checkedListBox1.Items.Count != 0) { // this.button1_Click(null, null); //} }
private void PIVASMate_Load(object sender, EventArgs e) { try { this.ControlBox = false; this.Text = this.Text + " (" + EmpName + ")"; this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); this.WindowState = FormWindowState.Maximized; NowDate.Text = "PIVAS MATE 3.0 " + DateTime.Now.ToString(); FormPath(DEmployeeID); labelLoginer.Text = EmpName + "(" + EmpCode + ")"; //*****************张建双2014-07-16**********************// try { IniRemTime = Convert.ToInt32(dbHelp.IniReadValuePivas("Remind", "RemindTime")) * 60; keeptime = Convert.ToInt32(dbHelp.IniReadValuePivas("Remind", "KeepTime")); remindtime = IniRemTime; } catch { IniRemTime = 180; remindtime = IniRemTime; keeptime = 5; dbHelp.IniWriteValuePivas("Remind", "RemindTime", "3"); dbHelp.IniWriteValuePivas("Remind", "KeepTime", "5"); } //判断气泡消息框是否可用 if (dbHelp.GetPivasAllSet("主画面_气泡消息框") == "0") { QiPao = true;//执行不可用 } else { QiPao = false; } //判断气泡消息框是否可用 if (dbHelp.GetPivasAllSetValue2("主画面_气泡消息框") == "0") { QiPaoShuangJi = true;//执行不可用 } else { QiPaoShuangJi = false; } ShanShuo(); } catch (Exception ex) { ShowMsgHelper.ShowError("主窗体加载出错:" + ex.Message); } }
private void checkBox1_Click(object sender, EventArgs e) { if (checkBox1.Checked) { db.IniWriteValuePivas("PivasBatch", "AllDrugDossage", "1"); } else { db.IniWriteValuePivas("PivasBatch", "AllDrugDossage", "0"); } }
private void AddCondition_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(db.IniReadValuePivas("ConsumableIsCharge", "ChargeValue"))) { db.IniWriteValuePivas("ConsumableIsCharge", "ChargeValue", "-1"); } else { textBox1.Text = db.IniReadValuePivas("ConsumableIsCharge", "ChargeValue"); } }
protected void LoginProving(string user, string pwd) { if (user == "") { MessageBox.Show("请输入登录用户名"); } else { DataSet ds = db.GetPIVAsDB("select top 1 DEmployeeID,AccountID,Pas,DEmployeeCode,DEmployeeName from DEmployee where AccountID='" + user + "' and Pas='******'"); if (ds == null || ds.Tables[0].Rows.Count <= 0) { MessageBox.Show("登录失败,输入密码错误或网络错误"); } else if (ds.Tables[0].Rows.Count > 0) { label1.BackColor = Color.FromArgb(19, 179, 253); if (user.Length >= 4 && user.Substring(0, 4) != "7777")//扫描二维码不保存本地 { con.PreserveLog(cbox_user.Text, txt_pwd.Text); } db.IniWriteValuePivas("User", "Ward", txt_word.Text); DataSet dss = db.GetPIVAsDB("select wardcode from dward where wardname ='" + txt_word.Text + "'"); if (dss != null && dss.Tables[0].Rows.Count > 0) { txt_word.Tag = dss.Tables[0].Rows[0]["wardcode"].ToString(); } else { MessageBox.Show("不存在该病区"); } NurseFormSet(); EmployeeID = ds.Tables[0].Rows[0]["DEmployeeID"].ToString(); if (GetPivasLimit.Instance.Limit(EmployeeID, "08000")) { NurseWorkStation IForm = new NurseWorkStation(); IForm.Owner = this; IForm.Txt_ward.Text = txt_word.Text; IForm.Txt_ward.Tag = txt_word.Tag; IForm.Login_Name.Text = ds.Tables[0].Rows[0]["DEmployeeName"].ToString(); IForm.EmployeeID = this.EmployeeID; IForm.Show(); this.Hide(); } } } }
private void cbbtime_SelectedIndexChanged(object sender, EventArgs e) { try { if (!Init) { dbHelp.IniWriteValuePivas("Remind", "RemindTime", cbbtime.Text); dbHelp.IniWriteValuePivas("Remind", "KeepTime", cbbKeeptime.Text); setRemindTime(Convert.ToInt32(cbbtime.Text.Trim()) * 60, Convert.ToInt32(cbbKeeptime.Text.Trim())); } } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void DengLu() { dbHelp.IniWriteValuePivas("LastKind", "LastKind", comboBox1.Text); if (string.IsNullOrEmpty(comboBox1.Text)) { MessageBox.Show("请选择扫描类别!"); comboBox1.Focus(); return; } if (string.IsNullOrEmpty(txtDoc.Text)) { MessageBox.Show("工号为空!"); txtDoc.Focus(); return; } DataTable dt = dbHelp.GetPIVAsDB("SELECT * FROM DEmployee WHERE AccountID='" + txtDoc.Text + "' and [Pas]='" + txtPas.Text.Trim() + "'").Tables[0]; if (dt.Rows.Count <= 0) { MessageBox.Show("用户名或者密码错误!"); txtPas.Text = null; txtDoc.Focus(); return; } loginUser(dt.Rows[0], comboBox1.Text); this.Dispose(); }
void SaveConfig() { switch (DBType) { case DatabaseType.PivasDB: db.IniWriteValuePivas("Database", "Data Source", tbDataSource.Text); db.IniWriteValuePivas("Database", "Initial Catalog", tbDBName.Text); db.IniWriteValuePivas("Database", "User ID", db.Encrypt(tbUserID.Text)); db.IniWriteValuePivas("Database", "Password", db.Encrypt(tbPassword.Text)); break; case DatabaseType.HISDB: db.IniWriteValueHIS("Database", "Data Source", tbDataSource.Text); db.IniWriteValueHIS("Database", "Initial Catalog", tbDBName.Text); db.IniWriteValueHIS("Database", "User ID", db.Encrypt(tbUserID.Text)); db.IniWriteValueHIS("Database", "Password", db.Encrypt(tbPassword.Text)); break; default: break; } }
private void GetConsum() { string ischarge = string.Empty; if (string.IsNullOrEmpty(db.IniReadValuePivas("ConsumableIsCharge", "ChargeValue"))) { db.IniWriteValuePivas("ConsumableIsCharge", "ChargeValue", "-1"); ischarge = "-1"; } else { ischarge = db.IniReadValuePivas("ConsumableIsCharge", "ChargeValue"); } string sql = string.Format("exec bl_ConsumablesStatistics '{0}','{1}',{2}" , dateTimePicker1.Value.ToString("yyyy-MM-dd") + " 00:00:00", dateTimePicker2.Value.ToString("yyyy-MM-dd") + " 23:59:00", ischarge); DataSet ds = db.GetPIVAsDB(sql); if (ds != null && ds.Tables[0].Rows.Count > 0) { dtprint = ds.Tables[0]; foreach (DataRow dr in dtprint.Rows) { int a = 0; for (int i = 3; i < dr.ItemArray.Length; i++) { a = a + Convert.ToInt32(dr[i]); } dr["总计"] = a; } } else { if (dtprint != null) { dtprint.Rows.Clear(); } MessageBox.Show("此段时间没有耗材数据!"); } }
////插入LongOrder表 //private void button_SC_Click(object sender, EventArgs e) //{ // SetTimeNO(); // string InsertSql = " insert into LongOrder(WardCode,OrderDate,DCode) values ('" + Txt_ward.Tag + "', GETDATE(),'" + EmployeeID + "')"; // int a = db.SetPIVAsDB(InsertSql); // IsEnble(); //} private void NurseWorkStation_Load(object sender, EventArgs e) { try { if (!JugeRight()) { Application.Exit(); } //label7_Click(null, null); IsEnble(); } catch (Exception ex) { MessageBox.Show(ex.Message); } try { IniRemTime = Convert.ToInt32(dbHelp.IniReadValuePivas("Remind", "RemindTime")) * 60; keeptime = Convert.ToInt32(dbHelp.IniReadValuePivas("Remind", "KeepTime")); remindtime = IniRemTime; } catch (Exception ex) { IniRemTime = 180; remindtime = IniRemTime; keeptime = 5; dbHelp.IniWriteValuePivas("Remind", "RemindTime", "3"); dbHelp.IniWriteValuePivas("Remind", "KeepTime", "5"); } if (dbHelp.GetPivasAllSet("护士站_气泡消息框") == "0") { QiPao = false; } else { QiPao = true; } if (dbHelp.GetPivasAllSetValue2("护士站-按钮一") == "1") { btn1.Visible = true; btn1.Text = dbHelp.GetPivasAllSet("护士站-按钮一"); Match m = Regex.Match(dbHelp.GetPivasAllSetValue3("护士站-按钮一"), "^([0-9]{0,3},){2}[0-9]{0,3}$"); if (m.Success) { string[] a = dbHelp.GetPivasAllSetValue3("护士站-按钮一").Split(','); btn1.ForeColor = Color.FromArgb(Convert.ToInt32(a[0]), Convert.ToInt32(a[1]), Convert.ToInt32(a[2])); } } if (dbHelp.GetPivasAllSetValue2("护士站-按钮二") == "1") { btn2.Visible = true; btn2.Text = dbHelp.GetPivasAllSet("护士站-按钮二"); Match m = Regex.Match(dbHelp.GetPivasAllSetValue3("护士站-按钮二"), "^([0-9]{0,3},){2}[0-9]{0,3}$"); if (m.Success) { string[] a = dbHelp.GetPivasAllSetValue3("护士站-按钮二").Split(','); btn2.ForeColor = Color.FromArgb(Convert.ToInt32(a[0]), Convert.ToInt32(a[1]), Convert.ToInt32(a[2])); } } if (dbHelp.GetPivasAllSetValue2("护士站-按钮三") == "1") { btn3.Visible = true; btn3.Text = dbHelp.GetPivasAllSet("护士站-按钮三"); Match m = Regex.Match(dbHelp.GetPivasAllSetValue3("护士站-按钮三"), "^([0-9]{0,3},){2}[0-9]{0,3}$"); if (m.Success) { string[] a = dbHelp.GetPivasAllSetValue3("护士站-按钮三").Split(','); btn3.ForeColor = Color.FromArgb(Convert.ToInt32(a[0]), Convert.ToInt32(a[1]), Convert.ToInt32(a[2])); } } if (dbHelp.GetPivasAllSet("护士站-标题显示-1") == "0") { label3.Visible = false; } else { label3.Visible = true; } if (dbHelp.GetPivasAllSetValue2("护士站-标题显示-1") == "0") { label5.Visible = false; } else { label5.Visible = true; } if (dbHelp.GetPivasAllSetValue3("护士站-标题显示-1") == "0") { label6.Visible = false; } else { label6.Visible = true; } if (dbHelp.GetPivasAllSet("护士站-标题显示-2") == "0") { label7.Visible = false; } else { label7.Visible = true; } if (dbHelp.GetPivasAllSetValue2("护士站-标题显示-2") == "0") { label8.Visible = false; } else { label8.Visible = true; } if (dbHelp.GetPivasAllSetValue3("护士站-标题显示-2") == "0") { label4.Visible = false; } else { label4.Visible = true; } //是否闪烁 ShanShuo(); }
public void LoadINI() { string Moxa = DB.IniReadValuePivas("SCREEN", "type"); switch (Moxa) { case "0": cbxScreenType.SelectedIndex = 0; break; case "1": cbxScreenType.SelectedIndex = 1; break; case "2": cbxScreenType.SelectedIndex = 2; break; default: MessageBox.Show("屏版本未设置,默认使用旧版"); cbxScreenType.SelectedIndex = 0; DB.IniWriteValuePivas("SCREEN", "type", "0"); break; } string RedValue = DB.IniReadValuePivas("doublelight", "openred"); if (RedValue == "1") { checkBoxUseRed.Checked = true; } else if (RedValue == "0") { checkBoxUseRed.Checked = false; } else { MessageBox.Show("初始红灯未设置,默认使用"); DB.IniWriteValuePivas("doublelight", "openred", "1"); checkBoxUseRed.Checked = true; } string GreenValue = DB.IniReadValuePivas("doublelight", "opengreen"); if (GreenValue == "1") { checkBoxUseGreen.Checked = true; } else if (GreenValue == "0") { checkBoxUseGreen.Checked = false; } else { MessageBox.Show("初始绿灯未设置,默认使用"); DB.IniWriteValuePivas("doublelight", "opengreen", "1"); checkBoxUseGreen.Checked = true; } if (cbxMoxaGroup.Text != "") { string MoxaGroup = DB.IniReadValuePivas("MOXA", "Group"); if (string.IsNullOrEmpty(MoxaGroup)) { MessageBox.Show("Moxa组号,默认使用1"); DB.IniWriteValuePivas("MOXA", "Group", "1"); } else { cbxMoxaGroup.Text = MoxaGroup; } } }
private void ChangeWard_Click(object sender, EventArgs e) { db.IniWriteValuePivas("User", "Ward", ""); }
private void button1_Click(object sender, EventArgs e) { db.IniWriteValuePivas("Printer", "EmpReportWe", comboBox2.SelectedIndex.ToString()); if (report.Pages.Count != 0) { string printerName = db.IniReadValuePivas("Printer", "LabelPrinter"); using (PrintDocument printDocument = new PrintDocument()) { string Mprint = printDocument.PrinterSettings.PrinterName; if (string.IsNullOrEmpty(printerName)) { if (printDocument.PrinterSettings.IsValid) { report.PrintSettings.Printer = Mprint; report.PrintSettings.ShowDialog = false; if (previewControlFR.Print()) { db.SetPIVAsDB(string.Format("UPDATE [dbo].[QRcodeLog]SET [DelDT] = GETDATE() WHERE [DelDT] is null and [DEmployeeID]='{0}'", DEmployeeID)); db.SetPIVAsDB(string.Format("INSERT INTO [dbo].[QRcodeLog]([DEmployeeID],[QRcode],[QRcodeDT])VALUES('{0}','{1}',GETDATE())", DEmployeeID, value)); if (comboBox1.Text != "1") { int g = Convert.ToInt32(comboBox1.Text); for (int i = 1; i < g; i++) { previewControlFR.Print(); } } MessageBox.Show("打印成功"); } else { MessageBox.Show("打印失败"); } } else { MessageBox.Show("打印机配置为空且系统默认打印机不可用"); } } else { printDocument.PrinterSettings.PrinterName = printerName; if (printDocument.PrinterSettings.IsValid) { report.PrintSettings.Printer = printerName; report.PrintSettings.ShowDialog = false; if (previewControlFR.Print()) { db.SetPIVAsDB(string.Format("UPDATE [dbo].[QRcodeLog]SET [DelDT] = GETDATE() WHERE [DelDT] is null and [DEmployeeID]='{0}'", DEmployeeID)); db.SetPIVAsDB(string.Format("INSERT INTO [dbo].[QRcodeLog]([DEmployeeID],[QRcode],[QRcodeDT])VALUES('{0}','{1}',GETDATE())", DEmployeeID, value)); if (comboBox1.Text != "1") { int g = Convert.ToInt32(comboBox1.Text); for (int i = 1; i < g; i++) { previewControlFR.Print(); } } MessageBox.Show("打印成功"); } else { MessageBox.Show("打印失败"); } } else { MessageBox.Show("当前配置的打印机不可用,若使用系统默认打印机,请将打印机配置为空"); } } } } }
/// <summary> /// 加载ini文件中的是否调用计费接口的信息 /// </summary> public void LoadInIFile() { string NodeValue = service.ReadInIFile("IsCharge", IVName); if (NodeValue == "") { MessageBox.Show("初始配置文件没有计费接口,默认为不需要调用!!!"); dbHelper.IniWriteValuePivas("IsCharge", IVName, "0"); chkBoxJiFei.Checked = false; } else { if (NodeValue == "0") { chkBoxJiFei.Checked = false; } else { chkBoxJiFei.Checked = true; } } string NodeValue1 = service.ReadInIFile("BatchChecked", IVName); if (NodeValue1 == "") { MessageBox.Show("初始配置文件没有批次是否全选,默认为不需要全选!!!"); dbHelper.IniWriteValuePivas("BatchChecked", IVName, "0"); chkBoxBatches.Checked = false; } else { if (NodeValue1 == "0") { chkBoxBatches.Checked = false; } else { chkBoxBatches.Checked = true; } } string NodeValue2 = service.ReadInIFile("IsUseRule", IVName); if (NodeValue2 == "") { MessageBox.Show("初始配置文件没有规则是否使用,默认为不需要使用!!!"); dbHelper.IniWriteValuePivas("IsUseRule", IVName, "0"); chkBoxBatches.Checked = false; } else { if (NodeValue2 == "0") { checkBox1.Checked = false; } else { checkBox1.Checked = true; } } string NodeValue3 = service.ReadInIFile("IsShowAllDward", IVName); if (NodeValue3 == "") { MessageBox.Show("初始配置文件没有规则是否提示全病区扫描完毕信息,默认为不需要使用!!!"); dbHelper.IniWriteValuePivas("IsShowAllDward", IVName, "0"); chkBoxBatches.Checked = false; } else { if (NodeValue3 == "0") { checkBox2.Checked = false; } else { checkBox2.Checked = true; } } string NodeValue4 = service.ReadInIFile("FontSize", "Size"); if (NodeValue4 == "") { MessageBox.Show("初始配置文件没有指定字号,默认为18!!!"); dbHelper.IniWriteValuePivas("FontSize", "Size", "18"); comboBox11.Text = "18"; } else { comboBox11.Text = NodeValue4; } string NodeValue5 = service.ReadInIFile("FontSize", "Blank"); if (NodeValue5 == "") { MessageBox.Show("初始配置文件没有指定间距 ,默认为5!!!"); dbHelper.IniWriteValuePivas("FontSize", "Blank", "5"); comboBox11.Text = "5"; } else { textBox1.Text = NodeValue5; } string NodeValue6 = service.ReadInIFile("IsBreak", "All"); if (NodeValue6 == "") { MessageBox.Show("初始配置文件没有瓶签失败是否暂停,默认为不需要中断!!!"); dbHelper.IniWriteValuePivas("IsBreak", "All", "0"); checkBox3.Checked = false; } else { if (NodeValue6 == "0") { checkBox3.Checked = false; } else { checkBox3.Checked = true; } } string co = string.Empty; co = service.ReadInIFile("advanceColor", "adcolorR") + "," + service.ReadInIFile("advanceColor", "adcolorG") + "," + service.ReadInIFile("advanceColor", "adcolorB"); try { button1.BackColor = ColorTranslator.FromHtml(co); colorDialog1.Color = ColorTranslator.FromHtml(co); } catch { MessageBox.Show("初始配置文件没有提前打包配色,默认为白!!!"); colorDialog1.Color = Color.White; button1.BackColor = Color.White; dbHelper.IniWriteValuePivas("advanceColor", "adcolorR", colorDialog1.Color.R.ToString()); dbHelper.IniWriteValuePivas("advanceColor", "adcolorG", colorDialog1.Color.G.ToString()); dbHelper.IniWriteValuePivas("advanceColor", "adcolorB", colorDialog1.Color.B.ToString()); } string NodeValue7 = service.ReadInIFile("Voice", "Use"); if (NodeValue7 == "") { MessageBox.Show("初始配置文件没有选择语音使用,默认为详细语音播报!!!"); dbHelper.IniWriteValuePivas("Voice", "Use", "0"); radioButton1.Checked = true; } else { if (NodeValue7 == "0") { radioButton1.Checked = true; } else { radioButton2.Checked = true; } } string NodeValue8 = service.ReadInIFile("IsUselblstatus", "Use"); if (NodeValue8 == "") { MessageBox.Show("初始配置文件没有扫描结果是否使用当前状态,默认为使用!!!"); dbHelper.IniWriteValuePivas("IsUselblstatus", "Use", "1"); checkBox4.Checked = true; } else { if (NodeValue8 == "0") { checkBox4.Checked = false; } else { checkBox4.Checked = true; } } }