private void gridView1_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            int rowhandle = gv.FocusedRowHandle;

            DevExpress.XtraGrid.Columns.GridColumn col = gv.FocusedColumn;
            if (col.Caption == "诊室")
            {
                ClincId   = "";
                ClincName = "";
                DoctorSrtting obj = gv.GetRow(rowhandle) as DoctorSrtting;
                if (obj == null)
                {
                    return;
                }
                bool OneFirst = false;
                if (DeptName != obj.deptName)
                {
                    DeptName = obj.deptName;
                    GetClinicList(AppContext.Session.hospitalId, obj.deptId);
                }
                DoctorsOfficeSettingFrm dosf = new DoctorsOfficeSettingFrm(obj, OneFirst);
                dosf.ShowDialog();
                if (ClincId == "")
                {
                    if (obj.clinicId == null || obj.clinicId == "")
                    {
                        gv.SetRowCellValue(rowhandle, gv.Columns["clinicId"], ClincId);
                    }
                }
                else
                {
                    gv.SetRowCellValue(rowhandle, gv.Columns["clinicId"], ClincId);
                }
                if (ClincName == "")
                {
                    if (obj.clinicName == null || obj.clinicName == "")
                    {
                        gv.SetRowCellValue(rowhandle, gv.Columns["clinicName"], ClincName);
                    }
                }
                else
                {
                    gv.SetRowCellValue(rowhandle, gv.Columns["clinicName"], ClincName);
                    listhelpers = new List <SoltHelper>();
                    for (int i = 0; i < this.gridView1.RowCount; i++)
                    {
                        if (gv.GetRowCellValue(i, gv.Columns["clinicId"]).ToString() != "" && gv.GetRowCellValue(i, gv.Columns["clinicName"]).ToString() != "")
                        {
                            SoltHelper sh = new SoltHelper();
                            sh.ClincNames = gv.GetRowCellValue(i, gv.Columns["clinicName"]).ToString();
                            sh.Prioxs     = gv.GetRowCellValue(i, gv.Columns["period"]).ToString();
                            sh.Times      = gv.GetRowCellValue(i, gv.Columns["workDate"]).ToString();
                            sh.depetIds   = gv.GetRowCellValue(i, gv.Columns["deptId"]).ToString();
                            listhelpers.Add(sh);
                        }
                    }
                }
            }
        }
 public void GetDoctorSittingClinic()
 {
     try
     {
         listhelpers = new List <SoltHelper>();
         #region
         if (treeListLookUpEdit2.Text == "请选择")
         {
             cmd.HideOpaqueLayer();
             MessageBoxUtils.Show("请选择科室", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             return;
         }
         //if (lookUpEdit1.Text == "请选择"||lookUpEdit1.Text == "")
         //{
         //    cmd.HideOpaqueLayer();
         //    MessageBoxUtils.Show("请选择医生", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         //    return;
         //}
         if (dateEdit3.Text == "")
         {
             cmd.HideOpaqueLayer();
             MessageBoxUtils.Show("请选择开始日期", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             return;
         }
         if (dateEdit4.Text == "")
         {
             cmd.HideOpaqueLayer();
             MessageBoxUtils.Show("请选择结束日期", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             return;
         }
         #endregion
         String  Url  = AppContext.AppConfig.serverUrl + "sch/doctorScheduPlan/findPlanPeriod?hospitalId=" + AppContext.Session.hospitalId + "&deptId=" + treeListLookUpEdit2.EditValue + "&doctorId=" + lookUpEdit1.EditValue + "&beginDate=" + this.dateEdit3.Text.Trim() + "&endDate=" + this.dateEdit4.Text.Trim();
         String  data = HttpClass.httpPost(Url);
         JObject objT = JObject.Parse(data);
         if (string.Compare(objT["state"].ToString(), "true", true) == 0)
         {
             List <DoctorSrtting> scheduledList = objT["result"].ToObject <List <DoctorSrtting> >();
             //List<DoctorSrtting> dataSource = new List<DoctorSrtting>();
             for (int i = 0; i < scheduledList.Count; i++)
             {
                 if (scheduledList[i].clinicId != "" && scheduledList[i].clinicName != "")
                 {
                     SoltHelper sh = new SoltHelper();
                     sh.ClincNames = scheduledList[i].clinicName;
                     sh.Prioxs     = scheduledList[i].period;
                     sh.Times      = scheduledList[i].workDate;
                     sh.depetIds   = scheduledList[i].deptId;
                     listhelpers.Add(sh);
                 }
                 //DoctorSrtting scheduled = scheduledList[i];
                 //scheduled.deptName = treeListLookUpEdit2.Text.Trim();
                 //dataSource.Add(scheduled);
             }
             gcScheduled.DataSource = scheduledList;
             cmd.HideOpaqueLayer();
         }
         else
         {
             cmd.HideOpaqueLayer();
             MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
             this.gcScheduled.DataSource = null;
         }
     }
     catch (Exception ex)
     {
         MessageBoxUtils.Show(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
         cmd.HideOpaqueLayer();
         Log4net.LogHelper.Error(" 获取指定医院、科室、医生、日期范围内医生每个日期的排班时段及坐诊诊室错误信息:" + ex.Message);
     }
 }