Example #1
0
 private void btn_del_Click(object sender, EventArgs e)
 {
     if (f_intIdext == 1)
     {
         ClinicarItem entity = this.GetCurrentRowData();
         if (entity != null && UcMessageBox.Confirm("确定删除?", "提示"))
         {
             clinicarItemBiz.Delete(entity.Id);
             //循环删除子表
             if (dgrdViewDetail != null && Convert.IsDBNull(dgrdViewDetail) == false && dgrdViewDetail.RowCount > 0)
             {
                 for (int i = 0; i < this.dgrdViewDetail.RowCount; i++)
                 {
                     clinicarItemDetailBiz.Delete(this.dgrdViewDetail.Rows[i].Cells[0].Value.ToString());
                 }
             }
             this.ucDgv_list.Search(1);
         }
     }
     else if (f_intIdext == 2)
     {
         ClinicarItem       entityItem = this.GetCurrentRowData();
         ClinicarItemDetail entity     = this.GetDetailCurrentRowData();
         if (entity != null && UcMessageBox.Confirm("确定删除?", "提示"))
         {
             clinicarItemDetailBiz.Delete(entity.Id);
             detailGridSearch(entityItem);
         }
     }
 }
 /// <summary>
 /// 保存方法
 /// </summary>
 /// <returns></returns>
 private bool Save()
 {
     if (this.CheckBeforeSave())//保存前的校验
     {
         SResult rst = new SResult();
         if (this.DialogStatus == UBaseLib.Enums.DialogStatus.New) //新增
         {
             this.DataEntityDetail = new ClinicarItemDetail();
             this.Fill2Entity();
             rst = clinicarDetailBiz.Insert(this.DataEntityDetail);
         }
         else if (this.DialogStatus == UBaseLib.Enums.DialogStatus.Modify) //修改
         {
             this.Fill2Entity();
             rst = clinicarDetailBiz.Update(this.DataEntityDetail);
         }
         if (rst.success)
         {
             UcMessageBox.Information(rst.message, "提示");
         }
         else
         {
             UcMessageBox.Error(rst.message, "提示");
         }
         return(rst.success);
     }
     return(false);
 }
Example #3
0
        /// <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("检查号或项目编号含有特殊字符,条码生成失败.", "提示!");
            }
        }
Example #4
0
        /// <summary>
        /// 保存方法
        /// </summary>
        /// <returns></returns>
        private bool Save()
        {
            SResult rst = new SResult();

            if (this.DialogStatus == UBaseLib.Enums.DialogStatus.New) //新增
            {
                this.DataEntity = new ClinicarAllCheck();
                this.Fill2Entity();
                rst = clinicarAllCheckBiz.Insert(this.DataEntity);
            }
            else if (this.DialogStatus == UBaseLib.Enums.DialogStatus.Modify) //修改
            {
                this.Fill2Entity();
                rst = clinicarAllCheckBiz.Update(this.DataEntity);
            }
            if (rst.success)
            {
                UcMessageBox.Information(rst.message, "提示");
            }
            else
            {
                UcMessageBox.Error(rst.message, "提示");
            }
            return(rst.success);
        }
        /// <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 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("请先选择一行数据", "提示");
            }
        }
Example #7
0
 /// <summary>
 /// 保存方法
 /// </summary>
 /// <returns></returns>
 private bool Save()
 {
     if (this.CheckBeforeSave())//保存前的校验
     {
         SResult rst = new SResult();
         if (this.DialogStatus == UBaseLib.Enums.DialogStatus.New) //新增
         {
             this.Fill2Entity();
             rst = clinicarConsultationBiz.Insert(this.DataEntity);
             if (rst.success)
             {
                 dataUpload(rst);
             }
         }
         else if (this.DialogStatus == UBaseLib.Enums.DialogStatus.Modify) //修改
         {
             this.Fill2Entity();
             rst = clinicarConsultationBiz.Update(this.DataEntity);
         }
         if (rst.success)
         {
             this.DialogResult = DialogResult.OK;
             UcMessageBox.Information(rst.message, "提示");
         }
         else
         {
             this.DialogResult = DialogResult.No;
             UcMessageBox.Error(rst.message, "提示");
         }
         return(rst.success);
     }
     return(false);
 }
        /// <summary>
        /// 取消按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_cancel_Click(object sender, EventArgs e)
        {
            SResult           rst    = new SResult();
            ClinicarCheckItem entity = this.GetCurrentRowData();

            if (entity == null || Convert.IsDBNull(entity))
            {
                return;
            }
            entity.Completed = false;
            rst = clinicarCheckItemBiz.Update(entity);

            if (rst.success)
            {
                UcMessageBox.Information("取消成功.", "提示");
            }
            else
            {
                UcMessageBox.Information("取消失败.", "提示");
            }

            //重新查询科室表
            DataEntity = new ClinicarCheck();
            DataEntity = clinicarCheckBiz.FindByCheckNum(uTxt_checkNumber.Text.Trim());
            fillByCheckNum();
        }
Example #9
0
        /// <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("检查号含有特殊字符,条码生成失败.", "提示!");
            }
        }
Example #10
0
        public static void Show(string err)
        {
            UcMessageBox mb = new UcMessageBox();

            mb.Error = err;

            mb.Show();
        }
Example #11
0
 /// <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();
 }
Example #12
0
 /// <summary>
 /// 保存前的校验方法
 /// </summary>
 /// <returns></returns>
 private bool CheckBeforeSave()
 {
     if (uCbo_UploadItem.SelectedIndex < 0)
     {
         UcMessageBox.Warning("请选择上传项目!", "提示");
         this.uCbo_UploadItem.Focus();
         return(false);
     }
     return(true);
 }
Example #13
0
        private void btn_del_Click(object sender, EventArgs e)
        {
            SysBaseData entity = this.GetCurrentRowData();

            if (entity != null && UcMessageBox.Confirm("确定删除?", "提示"))
            {
                SysBaseDataBiz.Delete(entity.Id);
                this.ucDgv_list.Search(1);
            }
        }
 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;
 }
Example #15
0
 /// <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("请添加检查项目信息!", "提示");
     }
 }
Example #16
0
        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 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);
        }
Example #18
0
        /// <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);
        }
Example #19
0
        /// <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);
        }
Example #20
0
        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);
        }
Example #21
0
        /// <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, "提示");
            }
        }
Example #22
0
        /// <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);
        }
Example #23
0
        /// <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;
            }
        }
Example #24
0
        /// <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);
        }
Example #25
0
        // 获取服务器返回的响应体
        private FtpWebResponse GetFtpResponse(FtpWebRequest request)
        {
            FtpWebResponse response = null;

            try
            {
                response = (FtpWebResponse)request.GetResponse();
                return(response);
            }
            catch (WebException ex)
            {
                UcMessageBox.Error("发送错误,返回信息为:" + ex.Status, "提示");
                return(null);
            }
        }
Example #26
0
 private void btn_Click(object sender, EventArgs e)
 {
     if (sender == this.btn_close)
     {
         this.Close();
     }
     else if (sender == this.btn_save)
     {
         if (this.Save())
         {
             UcMessageBox.Information("排班成功!");
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }
     }
 }
Example #27
0
        /// <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);
        }
Example #28
0
        /// <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>
        /// <returns></returns>
        private bool Save()
        {
            SResult rst = new SResult();

            if (this.DialogStatus == UBaseLib.Enums.DialogStatus.New) //新增
            {
            }
            else if (this.DialogStatus == UBaseLib.Enums.DialogStatus.Modify) //修改
            {
            }
            if (rst.success)
            {
                UcMessageBox.Information(rst.message, "提示");
            }
            else
            {
                UcMessageBox.Error(rst.message, "提示");
            }
            return(rst.success);
        }