/// <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);
 }
Esempio n. 2
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>
        /// <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();
        }
Esempio n. 4
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>
        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("请先选择一行数据", "提示");
            }
        }
Esempio n. 6
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("请添加检查项目信息!", "提示");
     }
 }
Esempio n. 7
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();
         }
     }
 }
        /// <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);
        }
Esempio n. 9
0
 private bool saveMaster()
 {
     if (this.CheckBeforeSave())//保存前的校验
     {
         SResult rst = new SResult();
         this.DataEntity         = new ClinicarCheck();
         this.DataEntityTransmit = new ClinicarCheck();
         this.Fill2Entity();
         rst = clinicarCheckBiz.Insert(this.DataEntity);
         if (rst.success)
         {
             DataEntityId            = Convert.ToInt32(((cis_model.clinicar.ClinicarCheck)rst.data).Id);
             this.DataEntityTransmit = (cis_model.clinicar.ClinicarCheck)rst.data;
             UcMessageBox.Information("人员信息保存成功,请添加项目信息。", "提示!");
         }
         else
         {
             DataEntityId = 0;
             UcMessageBox.Error(rst.message);
         }
         return(rst.success);
     }
     return(false);
 }
Esempio n. 10
0
        /// <summary>
        /// 保存相关方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_save_Click(object sender, EventArgs e)
        {
            if (this.CheckBeforeSave())//保存前的校验
            {
                //获取检查项目聚焦行数据
                ClinicarCheckItem entity = this.GetCurrentRowData();
                if (entity == null || Convert.IsDBNull(entity))
                {
                    return;
                }

                //图片类或pdf
                if (Util.showType(entity.DptName).Equals(Util.image) || Util.showType(entity.DptName).Equals(Util.pdf))
                {
                    SResult rst = new SResult();
                    this.DataEntityClinicarCheckResult                = new ClinicarCheckResult();
                    this.DataEntityClinicarCheckResult.Deleted        = false;
                    this.DataEntityClinicarCheckResult.CheckNumber    = uTxt_checkNumber.Text.Trim();
                    this.DataEntityClinicarCheckResult.AttachmentPath = this.imageOrPdfPath;
                    this.DataEntityClinicarCheckResult.ItemCode       = entity.ItemCode;
                    this.DataEntityClinicarCheckResult.ItemName       = entity.ItemName;
                    //检查结果表格绑定数据
                    SPagintion <ClinicarCheckResult> page = clinicarCheckResultBiz.FindByPagination(1, 100, uTxt_checkNumber.Text.Trim(), entity.ItemCode);
                    IList <ClinicarCheckResult>      list = page != null ? page.Data : new List <ClinicarCheckResult>();
                    if (list != null && Convert.IsDBNull(list) == false && list.Count > 0)
                    {
                        this.DataEntityClinicarCheckResult.Id = list[0].Id;
                        rst = clinicarCheckResultBiz.Update(DataEntityClinicarCheckResult);
                    }
                    else
                    {
                        rst = clinicarCheckResultBiz.Insert(DataEntityClinicarCheckResult);
                    }
                    if (rst.success)
                    {
                        UcMessageBox.Information("保存成功.", "提示");
                        entity.Summary   = uRic_summary.Text;
                        entity.Completed = true;
                        rst = clinicarCheckItemBiz.Update(entity);
                    }
                    else
                    {
                        UcMessageBox.Error("保存失败.", "提示");
                    }
                }
                //数据类
                else if (Util.showType(entity.DptName).Equals(Util.data))
                {
                    SResult rst = new SResult();
                    if (dataGridView_Result != null && !Convert.IsDBNull(dataGridView_Result) && dataGridView_Result.RowCount > 0)
                    {
                        try
                        {
                            for (int i = 0; i < dataGridView_Result.RowCount; i++)
                            {
                                this.DataEntityClinicarCheckResult = new ClinicarCheckResult();

                                this.DataEntityClinicarCheckResult.DetailName     = dataGridView_Result.Rows[i].Cells[0].Value == null ? "" : dataGridView_Result.Rows[i].Cells[0].Value.ToString();
                                this.DataEntityClinicarCheckResult.Result         = dataGridView_Result.Rows[i].Cells[1].Value == null ? "" : dataGridView_Result.Rows[i].Cells[1].Value.ToString();
                                this.DataEntityClinicarCheckResult.Unit           = dataGridView_Result.Rows[i].Cells[3].Value == null ? "" : dataGridView_Result.Rows[i].Cells[3].Value.ToString();
                                this.DataEntityClinicarCheckResult.Conclusion     = dataGridView_Result.Rows[i].Cells[4].Value == null ? "" : dataGridView_Result.Rows[i].Cells[4].Value.ToString();
                                this.DataEntityClinicarCheckResult.Deleted        = false;
                                this.DataEntityClinicarCheckResult.CheckNumber    = uTxt_checkNumber.Text.Trim();
                                this.DataEntityClinicarCheckResult.AttachmentPath = "";
                                this.DataEntityClinicarCheckResult.ItemCode       = entity.ItemCode;
                                this.DataEntityClinicarCheckResult.ItemName       = entity.ItemName;

                                if (!f_blEdit) //新增
                                {
                                    this.DataEntityClinicarCheckResult.DetailCode = dataGridView_Result.Rows[i].Cells[5].Value == null ? "" : dataGridView_Result.Rows[i].Cells[5].Value.ToString();
                                    rst = clinicarCheckResultBiz.Insert(DataEntityClinicarCheckResult);
                                }
                                else if (f_blEdit)  //修改
                                {
                                    this.DataEntityClinicarCheckResult.DetailCode = dataGridView_Result.Rows[i].Cells[6].Value == null ? "" : dataGridView_Result.Rows[i].Cells[6].Value.ToString();
                                    this.DataEntityClinicarCheckResult.Id         = dataGridView_Result.Rows[i].Cells[5].Value == null ? 0 : Convert.ToInt32(dataGridView_Result.Rows[i].Cells[5].Value);
                                    rst = clinicarCheckResultBiz.Update(DataEntityClinicarCheckResult);
                                }
                            }
                        }
                        catch
                        { }
                        finally
                        {
                            if (rst.success)
                            {
                                UcMessageBox.Information("保存成功.", "提示");
                                entity.Summary   = uRic_summary.Text;
                                entity.Completed = true;
                                rst = clinicarCheckItemBiz.Update(entity);
                            }
                            else
                            {
                                UcMessageBox.Error("保存失败.", "提示");
                            }
                        }
                    }
                }

                //重新查询科室表
                DataEntity = new ClinicarCheck();
                DataEntity = clinicarCheckBiz.FindByCheckNum(uTxt_checkNumber.Text.Trim());
                fillByCheckNum();
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 历史数据回填
        /// </summary>
        private void dataFillBack()
        {
            //check表
            ClinicarCheck entityCheck = this.GetCurrentRowData();

            if (entityCheck == null || Convert.IsDBNull(entityCheck))
            {
                return;
            }
            //项目表
            ClinicarCheckItem entityItem = this.GetCenterCurrentRowData();

            if (entityItem == null || Convert.IsDBNull(entityItem))
            {
                return;
            }

            //表格
            if (Util.showType(entityItem.DptName).Equals(Util.data))
            {
                //结果表
                ClinicarCheckResult entity = this.GetRightCurrentRowData();
                if (entity == null || Convert.IsDBNull(entity))
                {
                    return;
                }
                if (!this.type.Equals(Util.data))
                {
                    return;
                }
                for (int i = 0; i < this.F_dgViewTransmit.RowCount; i++)
                {
                    //如果项目名称一致则回填
                    string itemName = this.F_dgViewTransmit.Rows[i].Cells[0].Value == null ? "" : this.F_dgViewTransmit.Rows[i].Cells[0].Value.ToString();
                    if (itemName == entity.DetailName)
                    {
                        f_strAttachmentPath = string.Empty;
                        this.F_dgViewTransmit.Rows[i].Cells[1].Value = entity.Result;
                        this.F_dgViewTransmit.Rows[i].Cells[4].Value = entity.Conclusion;
                        UcMessageBox.Information("【" + entity.DetailName + "】项目结果、结论回填成功.", "历史数据回填");
                    }
                }
            }
            //图片
            else if (Util.showType(entityItem.DptName).Equals(Util.image))
            {
                //检查科室表格绑定数据
                SPagintion <ClinicarCheckResult> page = clinicarCheckResultBiz.FindByPagination(1, 100, entityCheck.CheckNumber, entityItem.ItemCode);
                IList <ClinicarCheckResult>      list = page != null ? page.Data : new List <ClinicarCheckResult>();
                if (list == null || Convert.IsDBNull(list) || list.Count <= 0)
                {
                    return;
                }
                if (!this.type.Equals(Util.image))
                {
                    return;
                }
                f_strAttachmentPath = list[0].AttachmentPath;
                DialogResult        = DialogResult.OK;
                this.Close();
            }
            //pdf
            else if (Util.showType(entityItem.DptName).Equals(Util.pdf))
            {
                //检查科室表格绑定数据
                SPagintion <ClinicarCheckResult> page = clinicarCheckResultBiz.FindByPagination(1, 100, entityCheck.CheckNumber, entityItem.ItemCode);
                IList <ClinicarCheckResult>      list = page != null ? page.Data : new List <ClinicarCheckResult>();
                if (list == null || Convert.IsDBNull(list) || list.Count <= 0)
                {
                    return;
                }
                if (!this.type.Equals(Util.pdf))
                {
                    return;
                }
                f_strAttachmentPath = list[0].AttachmentPath;
                DialogResult        = DialogResult.OK;
                this.Close();
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 保存方法
        /// </summary>
        private void save()
        {
            bool blSuccess = false;

            #region + 会诊记录表

            //申请会诊记录表
            if (uCbo_UploadItem.SelectedValue.Equals("t_clinicar_consultation"))
            {
                StringBuilder strOutId = new StringBuilder();
                //取出外网已有数据的id
                DataTable _dtOutSide = MySQLHelper.ExecuteDataTable(SqlUtil.F_OutsideConnectionString, CommandType.Text, "select id from t_clinicar_consultation");
                if (_dtOutSide != null && Convert.IsDBNull(_dtOutSide) == false && _dtOutSide.Rows.Count > 0)
                {
                    for (int i = 0; i < _dtOutSide.Rows.Count; i++)
                    {
                        strOutId.Append(_dtOutSide.Rows[i]["id"]);
                        strOutId.Append(",");
                    }
                }
                if (strOutId.Length > 0)
                {
                    strOutId.Remove(strOutId.Length - 1, 1);
                }
                else
                {
                    strOutId.Append("0");
                }
                //获取本地数据,并过滤掉服务器已有的数据
                DataTable _dt = MySQLHelper.ExecuteDataTable(SqlUtil.F_LocalConnectionString, CommandType.Text, "select * from t_clinicar_consultation where id not in (" + strOutId + ")");
                if (_dt != null && Convert.IsDBNull(_dt) == false && _dt.Rows.Count > 0)
                {
                    try
                    {
                        for (int i = 0; i < _dt.Rows.Count; i++)
                        {
                            string sql = "insert into t_clinicar_consultation values ("
                                         + "'" + _dt.Rows[i][0] + "',"
                                         + "'" + _dt.Rows[i][1] + "',"
                                         + "'" + _dt.Rows[i][2] + "',"
                                         + "'" + _dt.Rows[i][3] + "',"
                                         + "'" + _dt.Rows[i][4] + "',"
                                         + "'" + _dt.Rows[i][5] + "',"
                                         + "'" + _dt.Rows[i][6] + "',"
                                         + "'" + _dt.Rows[i][7] + "',"
                                         + "'" + _dt.Rows[i][8] + "',"
                                         + "'" + _dt.Rows[i][9] + "',"
                                         + "'" + _dt.Rows[i][10] + "',"
                                         + "'" + _dt.Rows[i][11] + "',"
                                         + "'" + _dt.Rows[i][12] + "',"
                                         + "'" + _dt.Rows[i][13] + "',"
                                         + "'" + _dt.Rows[i][14] + "',"
                                         + "'" + _dt.Rows[i][15] + "',"
                                         + "'" + _dt.Rows[i][16] + "',"
                                         + "'" + _dt.Rows[i][17] + "',"
                                         + "'" + _dt.Rows[i][18] + "',"
                                         + "'" + _dt.Rows[i][19] + "',"
                                         + "'" + _dt.Rows[i][20] + "',"
                                         + "'" + _dt.Rows[i][21] + "'"
                                         + " )";
                            MySQLHelper.ExecuteNonQuery(SqlUtil.F_OutsideConnectionString, CommandType.Text, sql);
                            blSuccess = true;
                        }
                    }
                    catch (Exception exception)
                    {
                        blSuccess = false;
                        UcMessageBox.Error("数据上传失败 -- ", exception.Message + "\r\n" + exception.StackTrace + "\r\n" + exception.Source);
                    }
                    finally
                    {
                        if (blSuccess)
                        {
                            UcMessageBox.Information("上传成功.", "提示");
                        }
                    }
                }
                else
                {
                    UcMessageBox.Information("没有需要上传的新增数据.", "提示");
                }
            }
            #endregion

            #region + 检查结果表
            //申请会诊记录表
            else if (uCbo_UploadItem.SelectedValue.Equals("t_clinicar_check_result"))
            {
                StringBuilder strOutId = new StringBuilder();
                //取出外网已有数据的id
                DataTable _dtOutSide = MySQLHelper.ExecuteDataTable(SqlUtil.F_OutsideConnectionString, CommandType.Text, "select id from t_clinicar_check_result");
                if (_dtOutSide != null && Convert.IsDBNull(_dtOutSide) == false && _dtOutSide.Rows.Count > 0)
                {
                    for (int i = 0; i < _dtOutSide.Rows.Count; i++)
                    {
                        strOutId.Append(_dtOutSide.Rows[i]["id"]);
                        strOutId.Append(",");
                    }
                }
                if (strOutId.Length > 0)
                {
                    strOutId.Remove(strOutId.Length - 1, 1);
                }
                else
                {
                    strOutId.Append("0");
                }
                //获取本地数据,并过滤掉服务器已有的数据
                DataTable _dt = MySQLHelper.ExecuteDataTable(SqlUtil.F_LocalConnectionString, CommandType.Text, "select * from t_clinicar_check_result where id not in (" + strOutId + ")");
                if (_dt != null && Convert.IsDBNull(_dt) == false && _dt.Rows.Count > 0)
                {
                    try
                    {
                        for (int i = 0; i < _dt.Rows.Count; i++)
                        {
                            string sql = "insert into t_clinicar_check_result values ("
                                         + "'" + _dt.Rows[i][0] + "',"
                                         + _dt.Rows[i][1] + ","
                                         + "'" + _dt.Rows[i][2] + "',"
                                         + "'" + _dt.Rows[i][3] + "',"
                                         + "'" + _dt.Rows[i][4] + "',"
                                         + "'" + _dt.Rows[i][5] + "',"
                                         + "'" + _dt.Rows[i][6] + "',"
                                         + "'" + _dt.Rows[i][7] + "',"
                                         + "'" + _dt.Rows[i][8] + "',"
                                         + "'" + _dt.Rows[i][9] + "',"
                                         + "'" + _dt.Rows[i][10] + "',"
                                         + "'" + _dt.Rows[i][11].ToString().Replace(@"\", @"\\") + "'"
                                         + " )";

                            this.uploadFile(_dt.Rows[i][11].ToString());     //上传文件
                            MySQLHelper.ExecuteNonQuery(SqlUtil.F_OutsideConnectionString, CommandType.Text, sql);
                            blSuccess = true;
                        }
                    }
                    catch (Exception exception)
                    {
                        blSuccess = false;
                        UcMessageBox.Error("数据上传失败 -- " + exception.Message + "\r\n" + exception.StackTrace + "\r\n" + exception.Source);
                    }
                    if (blSuccess)
                    {
                        UcMessageBox.Information("上传成功.", "提示");
                    }
                }
                else
                {
                    UcMessageBox.Information("没有需要上传的新增数据.", "提示");
                }
            }
            #endregion
        }