/// <summary> /// /// </summary> private void fillBack() { ClinicarItem entity = null; //项目管理实体类 if (this.dgrdView.CurrentRow != null && this.dgrdView.CurrentRow.Index >= 0 && f_CheckId != 0) { entity = ((BindingList <ClinicarItem>) this.dgrdView.DataSource)[this.dgrdView.CurrentRow.Index]; SResult rst = new SResult(); ClinicarCheckItem clinicarCheckItem = new ClinicarCheckItem(); clinicarCheckItem.ItemCode = entity.Id; clinicarCheckItem.ItemName = entity.Name; clinicarCheckItem.DptCode = entity.DptCode; clinicarCheckItem.DptName = entity.DptName; clinicarCheckItem.CheckId = f_CheckId; rst = clinicarCheckItemBiz.Insert(clinicarCheckItem); if (rst.success) { UcMessageBox.Information("添加成功!", "提示"); } else { UcMessageBox.Error(rst.message, "提示"); } //刷新登记界面中的检查项目表 SPagintion <ClinicarCheckItem> page = clinicarCheckItemBiz.FindByPagination(1, 999, f_CheckId); IList <ClinicarCheckItem> list = page != null ? page.Data : new List <ClinicarCheckItem>(); SGridViewUtil.BindingData <ClinicarCheckItem>(list, this.dataGridViewTranmit, displayPropertiesTranmit); } else { UcMessageBox.Warning("请先选择一行数据", "提示"); } }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (this.uTxt_code.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入项目代码!", "提示"); this.uTxt_code.Focus(); return(false); } if (this.uTxt_name.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入项目名称!", "提示"); this.uTxt_name.Focus(); return(false); } if (this.uTxt_unit.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入单位!", "提示"); this.uTxt_unit.Focus(); return(false); } return(true); }
/// <summary> /// 生成条码(检查号+项目编号) /// </summary> private void createBarCode(string checkNum, string itemCode, int x, int y) { try { // 1.设置条形码规格 EncodingOptions encodeOption = new EncodingOptions(); encodeOption.Height = 82; // 必须制定高度、宽度 encodeOption.Width = 179; // 2.生成条形码图片 ZXing.BarcodeWriter wr = new BarcodeWriter(); wr.Options = encodeOption; //条形码规格:CODE_128,能包含数字字母特殊字符; wr.Format = BarcodeFormat.CODE_128; //生成图片 Bitmap bitmap = wr.Write(checkNum + itemCode); PictureBox pictureBox = new PictureBox(); pictureBox.Location = new Point(x, y); pictureBox.Height = 82; pictureBox.Width = 179; pictureBox.Image = new Bitmap(bitmap); panel3.Controls.Add(pictureBox); } catch { UcMessageBox.Warning("检查号或项目编号含有特殊字符,条码生成失败.", "提示!"); } }
/// <summary> /// 生成条码(检查号) /// </summary> private void createLeftBarCode(string checkNum) { if (string.IsNullOrEmpty(checkNum)) { return; } try { // 1.设置条形码规格 EncodingOptions encodeOption = new EncodingOptions(); encodeOption.Height = 44; // 必须制定高度、宽度 encodeOption.Width = 98; // 2.生成条形码图片 ZXing.BarcodeWriter wr = new BarcodeWriter(); wr.Options = encodeOption; //条形码规格:CODE_128,能包含数字字母特殊字符; wr.Format = BarcodeFormat.CODE_128; //生成图片 Bitmap bitmap = wr.Write(checkNum); picb_left.Image = new Bitmap(bitmap); } catch { UcMessageBox.Warning("检查号含有特殊字符,条码生成失败.", "提示!"); } }
/// <summary> /// 重填按钮 事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_override_Click(object sender, EventArgs e) { if (DataEntityId != 0) { UcMessageBox.Warning("人员信息已保存,重填失败!", "提示"); return; } cleanInformation(); }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (uCbo_UploadItem.SelectedIndex < 0) { UcMessageBox.Warning("请选择上传项目!", "提示"); this.uCbo_UploadItem.Focus(); return(false); } return(true); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_finishRegister_Click(object sender, EventArgs e) { if (this.dgrdView.CurrentRow != null) { cleanInformation(); this.ucDgv_list.Search(1); UcMessageBox.Information("已完成登记!", "提示"); } else { UcMessageBox.Warning("请添加检查项目信息!", "提示"); } }
private ClinicarConsultation GetCurrentRowData() { ClinicarConsultation entity = null; if (this.dgrdView.CurrentRow != null && this.dgrdView.CurrentRow.Index >= 0) { entity = ((BindingList<ClinicarConsultation>)this.dgrdView.DataSource)[this.dgrdView.CurrentRow.Index]; } else { UcMessageBox.Warning("请先选择一行数据", "提示"); } return entity; }
private ClinicarHospital GetCurrentRowData() { ClinicarHospital entity = null; if (this.dataGridView1.CurrentRow != null && this.dataGridView1.CurrentRow.Index >= 0) { entity = ((BindingList <ClinicarHospital>) this.dataGridView1.DataSource)[this.dataGridView1.CurrentRow.Index]; } else { UcMessageBox.Warning("请先选择一行数据", "提示"); } return(entity); }
private SysBaseData GetCurrentRowData() { SysBaseData entity = null; if (this.dgrdView.CurrentRow != null && this.dgrdView.CurrentRow.Index >= 0) { entity = ((BindingList <SysBaseData>) this.dgrdView.DataSource)[this.dgrdView.CurrentRow.Index]; } else { UcMessageBox.Warning("请先选择一行数据"); } return(entity); }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { //if (this.uTxt_code.Text.Trim().Length == 0) //{ // UcMessageBox.Warning("请输入项目代码!", "提示"); // this.uTxt_code.Focus(); // return false; //} if (this.uTxt_name.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入项目名称!", "提示"); this.uTxt_name.Focus(); return(false); } if (this.uTxt_DtpCode.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入科室编号!", "提示"); this.uTxt_DtpCode.Focus(); return(false); } //if (uchk_enabled.Checked && uCbo_DeviceCode.SelectedValue!=null && !uCbo_DeviceCode.SelectedValue.ToString().Equals("")) //{ // if (this.DialogStatus == UBaseLib.Enums.DialogStatus.New) //新增 // { // bool isExist = clinicarItemBiz.CheckIsExistForDeviceCode(uCbo_DeviceCode.SelectedValue.ToString(), ""); // if (isExist) // { // UcMessageBox.Warning("该设备已被使用!", "设备编号重复"); // this.uCbo_DeviceCode.Focus(); // return false; // } // } // else if (this.DialogStatus == UBaseLib.Enums.DialogStatus.Modify) //修改 // { // bool isExist = clinicarItemBiz.CheckIsExistForDeviceCode(uCbo_DeviceCode.SelectedValue.ToString(), uTxt_code.Text.Trim()); // if (isExist) // { // UcMessageBox.Warning("该设备已被使用!", "设备编号重复"); // this.uCbo_DeviceCode.Focus(); // return false; // } // } //} return(true); }
private ClinihospitalDpt GetCurrentRowData() { ClinihospitalDpt entity = null; if (this.dgrdView.CurrentRow != null && this.dgrdView.CurrentRow.Index >= 0) { entity = ((BindingList <ClinihospitalDpt>) this.dgrdView.DataSource)[this.dgrdView.CurrentRow.Index]; } else { UcMessageBox.Warning("请先选择一行数据", "提示"); } return(entity); }
/// <summary> /// /// </summary> /// <returns></returns> private ClinicarCheckItem GetCurrentRowData() { ClinicarCheckItem entity = null; if (this.dgrdView.CurrentRow != null && this.dgrdView.CurrentRow.Index >= 0) { entity = ((BindingList <ClinicarCheckItem>) this.dgrdView.DataSource)[this.dgrdView.CurrentRow.Index]; } else { UcMessageBox.Warning("请先选择要删除的数据", "提示"); } return(entity); }
/// <summary> /// 上传文件方法 /// relativePath :数据库中文件的相对路径 /// </summary> private void uploadFile(string relativePath) { string strFilePath = strLocalFilePath; //需要上传的本地文件固定路径前缀 strFilePath = strFilePath + relativePath; //拼接路径 if (!File.Exists(strFilePath)) { return; } //获取外网ftp地址 int indexStart = SqlUtil.F_OutsideConnectionString.IndexOf("=") + 1; int indexEnd = SqlUtil.F_OutsideConnectionString.IndexOf(";"); ftpUristring = "ftp://" + SqlUtil.F_OutsideConnectionString.Substring(indexStart, indexEnd - indexStart); FileInfo fileinfo = new FileInfo(strFilePath); try { string uri = GetUriString(relativePath.Replace("\\", "/")); //检查目录是否存在,不存在创建 FtpCheckDirectoryExist(relativePath); FtpWebRequest request = CreateFtpWebRequest(uri, WebRequestMethods.Ftp.UploadFile); request.ContentLength = fileinfo.Length; int buflength = 8196; byte[] buffer = new byte[buflength]; FileStream filestream = fileinfo.OpenRead(); Stream responseStream = request.GetRequestStream(); //lstbxFtpState.Items.Add("打开上传流,文件上传中..."); int contenlength = filestream.Read(buffer, 0, buflength); while (contenlength != 0) { responseStream.Write(buffer, 0, contenlength); contenlength = filestream.Read(buffer, 0, buflength); } responseStream.Close(); filestream.Close(); FtpWebResponse response = GetFtpResponse(request); if (response == null) { UcMessageBox.Warning("服务器未响应...", "提示"); } } catch (WebException ex) { UcMessageBox.Error("上传发生错误,返回信息为:" + ex.Status, "提示"); } }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (this.uTxt_name.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入姓名!", "提示"); this.uTxt_name.Focus(); return(false); } if (this.uCbo_genderCode.SelectedIndex < 0) { UcMessageBox.Warning("请选择性别!", "提示"); this.uCbo_genderCode.Focus(); return(false); } if (this.uNum_age.TextLength == 0 || this.uNum_age.UcValue == 0) { UcMessageBox.Warning("请输入年龄!", "提示"); this.uNum_age.Focus(); return(false); } if (this.uCbo_maritalStatusCode.SelectedIndex < 0) { UcMessageBox.Warning("请选择婚姻状况!", "提示"); this.uCbo_maritalStatusCode.Focus(); return(false); } if (this.uTxt_checkDoctor.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入开单医生!", "提示"); this.uTxt_checkDoctor.Focus(); return(false); } //生成检查号 createCheckNumber(); if (uTxt_checkNumber.TextLength == 0) { UcMessageBox.Warning("检查号生成失败!", "提示"); this.uCbo_maritalStatusCode.Focus(); return(false); } return(true); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_saveMaster_Click(object sender, EventArgs e) { if (DataEntityId != 0) { UcMessageBox.Warning("未完成登记!", "提示"); return; } if (saveMaster()) { this.DialogResult = DialogResult.OK; this.groupBox1.Enabled = false; this.groupBox2.Enabled = false; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_addItem_Click(object sender, EventArgs e) { if (DataEntityId == 0) { UcMessageBox.Warning("请先完成人员信息保存!", "提示"); return; } //检查项目选择窗体 FrmClinicarCheckItemChoose choose = new FrmClinicarCheckItemChoose(DataEntityId); choose.dataGridViewTranmit = this.ucDgv_list.UcDataGridViewControl; choose.StartPosition = FormStartPosition.CenterScreen; choose.ShowDialog(); this.ucDgv_list.Search(1); }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (this.uTxt_name.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入患者姓名!", "提示"); this.uTxt_name.Focus(); return(false); } if (this.uTxt_checknumber.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入检查号!", "提示"); this.uTxt_checknumber.Focus(); return(false); } return(true); }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (this.ucTxt_username.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入用户名!"); this.ucTxt_username.Focus(); return(false); } if (this.ucTxt_password.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入密码!"); this.ucTxt_password.Focus(); return(false); } return(true); }
/// <summary> /// 判断是否按下enter键 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uTxt_checkNumber_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData != Keys.Enter) { return; } if (string.IsNullOrWhiteSpace(uTxt_checkNumber.Text)) { UcMessageBox.Warning("请选择或填写相应的检查号.", "提示!"); return; } else { DataEntity = new ClinicarCheck(); DataEntity = clinicarCheckBiz.FindByCheckNum(uTxt_checkNumber.Text.Trim()); fillByCheckNum(); } }
/// <summary> /// 根据检查号回填信息 /// </summary> private void fillByCheckNum() { if (DataEntity != null && Convert.IsDBNull(DataEntity) == false) { label8.Text = DataEntity.CheckNumber; uTxt_name.Text = DataEntity.Name; uTxt_genderName.Text = DataEntity.GenderName; uNum_age.Text = DataEntity.Age.ToString(); uTxt_maritalStatusName.Text = DataEntity.MaritalStatusName; uTxt_nationalityName.Text = DataEntity.NationalityName; uTxt_checkNumber.Text = DataEntity.CheckNumber; //检查科室表格绑定数据 SPagintion <ClinicarCheckItem> page = clinicarCheckItemBiz.FindByPagination(1, 100, Convert.ToInt32(DataEntity.Id)); IList <ClinicarCheckItem> list = page != null ? page.Data : new List <ClinicarCheckItem>(); SGridViewUtil.BindingData <ClinicarCheckItem>(list, this.ucDgv_listLeft.UcDataGridViewControl, displayPropertiesLeft); } else { UcMessageBox.Warning("所查询的检查号不存在.", "提示!"); } }
/// <summary> /// 保存前的校验方法 /// </summary> /// <returns></returns> private bool CheckBeforeSave() { if (this.ucTxt_code.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入代码!"); this.ucTxt_code.Focus(); return(false); } if (this.ucTxt_name.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入名称!"); this.ucTxt_name.Focus(); return(false); } if (this.ucCbo_sort.Text.Trim().Length == 0) { UcMessageBox.Warning("请输入字典类型!"); this.ucCbo_sort.Focus(); return(false); } return(true); }