Example #1
0
        private bool SelectItem(string OfficeIDitem)
        {
            ClinicPhysicianRecipeFacade clinicPhysicianRecipeFacade = new ClinicPhysicianRecipeFacade();
            string  diagnoseid = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString().Trim(); //诊疗号
            DataSet ds         = clinicPhysicianRecipeFacade.FindAllRecipeMedordInfoByExeofficeID(diagnoseid, OfficeIDitem);

            if (!dtRev.Columns.Contains("处方号"))
            {
                #region MyRegion
                dtRev.Columns.Add("处方号");
                dtRev.Columns.Add("处方内容");
                dtRev.Columns.Add("注意事项");
                dtRev.Columns.Add("预约号");
                dtRev.Columns.Add("诊疗号");
                dtRev.Columns.Add("挂号号");
                dtRev.Columns.Add("科室ID");
                dtRev.Columns.Add("诊室名称");
                dtRev.Columns.Add("执行科室地址");
                dtRev.Columns.Add("医嘱用语备注");
                dtRev.Columns.Add("开单科室");
                dtRev.Columns.Add("检查医师");
                dtRev.Columns.Add("检查医师ID");
                dtRev.Columns.Add("预约日期");
                dtRev.Columns.Add("预约结束日期");
                dtRev.Columns.Add("报到时间");
                dtRev.Columns.Add("完成时间");
                dtRev.Columns.Add("挂起时间");
                dtRev.Columns.Add("操作员ID");
                dtRev.Columns.Add("预约状态");
                dtRev.Columns.Add("检查状态");
                dtRev.Columns.Add("检查目的");  //douyaming 2014-8-4
                dtRev.Columns.Add("收费状态");  //douyaming 2016-05-14
                //isBindRev = true;
                #endregion
            }
            dtRev.Clear();

            for (int i = 0; i < this.gdvMain.RowCount; i++)
            {
                if ((Boolean)gdvMain.GetDataRow(i)["PITCHON1"]) //添加用户选择数据
                {
                    #region 增加医技预约次数限制 wangchao 2017.03.23 case:27593
                    //try
                    //{
                    //    if (SystemInfo.SystemConfigs["医技预约限制次数"].DefaultValue == "1")
                    //    {
                    //        string _execOffice = ds.Tables[0].Rows[i]["EXECOFFICEID"].ToString();
                    //        string _diagnoseID = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                    //        string _content = ds.Tables[0].Rows[i]["RECIPECONTENT"].ToString();
                    //        CLINICMtReserveFacade _reserveFacade = new CLINICMtReserveFacade();
                    //        DataSet dsCheck = _reserveFacade.checkRecipeHasReserveRecord(_diagnoseID, _execOffice, _content);
                    //        if (dsCheck != null && dsCheck.Tables.Count > 0 && dsCheck.Tables[0].Rows.Count > 0)
                    //        {
                    //            SkyComm.ShowMessageInfo("检查项目【" + ds.Tables[0].Rows[i]["CHARGEITEM"].ToString() + "】在日期【" + Convert.ToDateTime(dsCheck.Tables[0].Rows[0]["RESERVESTARTTIME"].ToString()).ToString("yyyy年MM月dd日") + "】已存在预约信息,不能重复预约!");
                    //            return false;
                    //        }
                    //    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    Skynet.LoggingService.LogService.GlobalInfoMessage("医技预约次数限制模块发生异常,原因:" + ex.Message);
                    //}
                    #endregion

                    DataSet dsClinic = reserveFacade.ReserveRecipeInfo(gdvMain.GetDataRow(i)["RESERVEID"].ToString());
                    //dsClinic.Tables[0].TableName = "data1";
                    //ds.Tables[0].TableName = "data2";
                    //dsClinic.WriteXml(Application.StartupPath + "\\数据集1.xml");
                    //ds.WriteXml(Application.StartupPath + "\\数据集2.xml");
                    foreach (DataRow drClinic in dsClinic.Tables[0].Rows)
                    {
                        foreach (DataRow drTemp in ds.Tables[0].Rows)
                        {
                            if (drClinic["CLINICRECIPEID"].ToString() == drTemp["CLINICRECIPEID"].ToString() && drClinic["APPLYDOCNO"].ToString() == drTemp["APPLYDOCNO"].ToString())
                            {
                                DataRow newRow = dtRev.NewRow();
                                newRow["处方号"]    = drTemp["CLINICRECIPEID"].ToString();
                                newRow["处方内容"]   = drTemp["CHARGEITEM"].ToString();
                                newRow["注意事项"]   = "";
                                newRow["预约号"]    = "1";
                                newRow["诊疗号"]    = SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString();
                                newRow["挂号号"]    = drTemp["REGISTERID"].ToString();
                                newRow["科室ID"]   = drTemp["EXECOFFICEID"].ToString();; // this.cmbExamineName.SelectedValue.ToString();
                                newRow["诊室名称"]   = drTemp["EXECOFFICE"].ToString();    //new
                                newRow["开单科室"]   = drTemp["OPERATOROFFICE"].ToString();
                                newRow["执行科室地址"] = drTemp["OFFICEADDRESS"].ToString();
                                newRow["医嘱用语备注"] = drTemp["REMARK"].ToString();
                                newRow["检查医师ID"] = ""; // this.cmbUserName.SelectedValue;
                                newRow["检查医师"]   = ""; // this.cmbUserName.Text;
                                newRow["预约日期"]   = "";
                                newRow["预约结束日期"] = null;
                                newRow["报到时间"]   = null;
                                newRow["完成时间"]   = null;
                                newRow["挂起时间"]   = null;
                                newRow["操作员ID"]  = SysOperatorInfo.OperatorID;
                                newRow["预约状态"]   = 1;  //预约
                                newRow["检查状态"]   = 1;  //未检查
                                newRow["检查目的"]   = ""; // this.gridView1.GetDataRow(i)["APPLYREMARK"].ToString();
                                try
                                {
                                    var revState = drTemp["RECIPESTATE"];
                                    newRow["收费状态"] = drTemp["RECIPESTATE"] == null ? "" : drTemp["RECIPESTATE"].ToString() == "0" ? "未收费" : "已收费";
                                }
                                catch (Exception)
                                {
                                    newRow["收费状态"] = "";
                                }
                                dtRev.Rows.Add(newRow);
                            }
                        }
                    }
                    //DataTable dtTemp = dtRev.Copy();
                    //DataSet dsTemp = new DataSet();
                    //dsTemp.Tables.Add(dtTemp);
                    //dsTemp.Tables[0].TableName = "data3";
                    //dsTemp.WriteXml(Application.StartupPath + "\\数据集3.xml");
                }
            }
            return(true);
        }
Example #2
0
        private bool checkBox_Click()
        {
            DataRow selectRow  = this.gdvMain.GetDataRow(gdvMain.FocusedRowHandle);
            bool    isSelected = Convert.ToBoolean(selectRow["PITCHON1"]);

            selectRow["PITCHON1"] = isSelected ? false : true;
            isSelected            = isSelected ? false : true;
            DataTable dtTemp = (DataTable)this.gdcMain.DataSource;

            //根据用户所选预约信息查找处方信息
            if (isSelected)
            {
                DataRow[] dsPitchon = dtTemp.Select("PITCHON1=true");
                if (dsPitchon.Length > 0)
                {
                    for (int i = 0; i < dsPitchon.Length; i++)
                    {
                        if (dsPitchon[i]["RESERVEID"].ToString() != selectRow["RESERVEID"].ToString())
                        {
                            dsPitchon[i]["PITCHON1"] = false;
                        }
                        else
                        {
                            dsPitchon[i]["PITCHON1"] = true;
                        }
                    }

                    reserveFacade = new CLINICMtReserveFacade();
                    DataSet ds = reserveFacade.ReserveRecipeInfo(selectRow["RESERVEID"].ToString());


                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        tempID         = ds.Tables[0].Rows[0]["CLINICRECIPEID"].ToString();
                        tempNO         = ds.Tables[0].Rows[0]["APPLYDOCNO"].ToString();
                        tempTime       = Convert.ToDateTime(ds.Tables[0].Rows[0]["RESERVESTARTTIME"].ToString());
                        tempeserveid   = ds.Tables[0].Rows[0]["RESERVEID"].ToString();
                        tempregisterid = ds.Tables[0].Rows[0]["REGISTERID"].ToString();

                        dtRev.Clear();
                        dtRev.Columns.Clear();
                        dtRev = new DataTable();

                        #region  构建dtRev
                        dtRev.Columns.Add("CLINICRECIPEID");
                        dtRev.Columns.Add("RECIPECONTENT");
                        dtRev.Columns.Add("RECIPETYPE");
                        dtRev.Columns.Add("UNITPRICE");
                        dtRev.Columns.Add("DOSEUNIT");
                        dtRev.Columns.Add("AMOUNT");
                        dtRev.Columns.Add("TOTALMONEY");
                        dtRev.Columns.Add("ADVICE");
                        #endregion
                        #region 处方表格绑定值
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            try
                            {
                                DataRow dr = dtRev.NewRow();
                                dr["CLINICRECIPEID"] = ds.Tables[0].Rows[i]["CLINICRECIPEID"].ToString();
                                //dr["RECIPECONTENT"] = ds.Tables[0].Rows[i]["RECIPECONTENT"].ToString();
                                dr["RECIPECONTENT"] = ds.Tables[0].Rows[i]["MEDORDNAME"].ToString();
                                dr["RECIPETYPE"]    = ds.Tables[0].Rows[i]["RECIPETYPE"].ToString();
                                dr["UNITPRICE"]     = ds.Tables[0].Rows[i]["UNITPRICE"].ToString();
                                dr["DOSEUNIT"]      = ds.Tables[0].Rows[i]["DOSEUNIT"].ToString();
                                dr["AMOUNT"]        = ds.Tables[0].Rows[i]["AMOUNT"].ToString();
                                dr["TOTALMONEY"]    = Math.Round(Convert.ToDouble(ds.Tables[0].Rows[i]["TOTALMONEY"]), 2).ToString() + "元";
                                dr["ADVICE"]        = ds.Tables[0].Rows[i]["ADVICE"].ToString();
                                dtRev.Rows.Add(dr);
                            }
                            catch (Exception)
                            {
                                throw;
                            }
                            this.gridControl1.DataSource = dtRev;
                        }

                        #endregion
                    }
                }
                else
                {
                    #region
                    int flag = 0;
                    for (int i = 0; i < this.gdvMain.RowCount; i++)
                    {
                        if ((Boolean)this.gdvMain.GetDataRow(i)["PITCHON1"])
                        {
                            flag++;
                        }
                    }
                    if (flag == 0)
                    {
                        sourceGroupName = "";
                        sourceGroupID   = "";
                    }
                    #endregion
                }
            }

            return(true);
        }