示例#1
0
        void gv_MouseClick(object sender, MouseEventArgs e)
        {
            drug = xapFormControl1.GetFocused <EmsOrDrug>("drug");
            XDataRow drow = sender as XDataRow;

            if (gv.GetFocusedRow().ClickCell.FieldName == "Name_mm")
            {
                EmsOrDrug emsordrug = gv.GetFocusedRow <EmsOrDrug>();
                if (emsordrug.Fg_ctm != null && emsordrug.Fg_ctm == true)
                {
                    return;                                                             //自定义服务时不能选择物品 2016-07-05 zwq
                }
                string id_srv = (gv.GetFocusedRow().RowDataSource as EmsOrDrug).Id_srv; //拿到 点击的药品对应服务的id_srv
                //根据服务id 取到 服务关联的药品 ,
                //根据服务id 取到 服务关联的药品 ,
                if (EmsHeadDO.Emsdrugs.EmsOrDrug.Count > 0)
                {
                    if (middle.getEmsOrDrugList() == null)
                    {
                        return;
                    }
                    List <EmsOrDrug> list = middle.getEmsOrDrugList().ToList().Where <EmsOrDrug>(p => p.Id_srv == id_srv).ToList();
                    // 替换下边注释的逻辑
                    this.ShowMmSelector(drow, list, emsordrug, gv.PointToScreen(new Point(drow.ClickCell.Location.X, drow.Location.Y + drow.Size.Height + 1)), !IsReadOnly);

                    /*
                     * ExtMmForm mmref = new ExtMmForm(cof.ConvertDataSouse<EmsOrDrug>(list), EmsHeadDO.Emsdrugs, emsordrug);
                     * mmref.StartPosition = FormStartPosition.Manual;
                     * mmref.Location = gv.PointToScreen(new Point(drow.ClickCell.Location.X, drow.Location.Y + drow.Size.Height + 1));
                     * mmref.TopMost = true;
                     * mmref.setEdit(!IsReadOnly);
                     * if (mmref.ShowDialog() == DialogResult.OK)
                     * {
                     *  EmsOrDrug orDrug = EmsHeadDO.Emsdrugs.EmsOrDrugList[gv.FocusedRowHandle];
                     *  if (mmref.drugmm == null)
                     *  {
                     *      if (orDrug.Fg_self == true)
                     *      {
                     *          orDrug.Name_mm = orDrug.Name_srv;
                     *          orDrug.Id_mm = null;
                     *      }
                     *      return;
                     *  }
                     #region 皮试逻辑的判断
                     *  if (mmref.drugmm.Fg_skintest != null && mmref.drugmm.Fg_skintest == true)
                     *  {
                     *      SkinTestLogic logic = new SkinTestLogic(EmsHeadDO.PatInfo);
                     *      orDrug.Name_mm = mmref.drugmm.Name_mm;
                     *      orDrug.Id_mm = mmref.drugmm.Id_mm;
                     *      orDrug.Id_srvskin = mmref.drugmm.Id_srvskin;
                     *      if (logic.skinTestLogic(orDrug).Equals("0"))
                     *      {
                     *          return;
                     *      }
                     *
                     *  }
                     #endregion
                     *  cof.CopyTo(mmref.drugmm, orDrug, "Id_srv", "Name_srv");
                     *  cof.concateMMSpecAndName(orDrug);
                     *
                     * }//*/
                }
                cof.GetDrugTotal(EmsHeadDO);
                updateTableCustomerComtrol();
            }
        }