Exemplo n.º 1
0
        void SearchControlView_ValueTextChanging(object sender, ChangingEventArgs e)
        {
            if (!string.IsNullOrEmpty(this.TextBox.Text) && this.TextBox.Text.Contains("常用模板"))
            {
                if (!string.IsNullOrEmpty(this.TextBox.Text.Remove(this.TextBox.Text.IndexOf('常'))))
                {
                    this.TextBox.Text           = this.TextBox.Text.Remove(this.TextBox.Text.IndexOf('常'));//.Substring(0, this.TextBox.Text.Length-4);
                    this.TextBox.ForeColor      = Color.Black;
                    this.TextBox.SelectionStart = this.TextBox.TextLength;
                }
            }

            lastSrvCa = this.SelectKey as string;
            srvSearch = this.ValueText;
            if (string.IsNullOrEmpty(this.TextBox.Text) || this.TextBox.Text == "常用模板")
            {
                if (form != null)
                {
                    form.Show();
                }
                this.TextBox.Focus();
                this.TextBox.SelectionStart = 0;
            }
            else
            {
                if (frm == null || !frm.Created)
                {
                    frm = new OrSrvForm();
                    frm.DbClickEvent += new OrSrvForm.DbClickHandle(frm_DbClickEvent);
                    //Point p = new Control().PointToScreen(new Point(this.Location.X - frm.Width, this.Location.Y + 30));//控件的右下角位置
                    //Point pc = System.Windows.Forms.Cursor.Position;
                    Point p = this.ParentForm.PointToScreen(this.Location);
                    //  this.ParentForm.BackColor = Color.Red;
                    this.ParentForm.Invalidate();
                    frm.Local = new Point(p.X, p.Y + this.Size.Height);   //AutoLocation.GetPopuLocation(pc,new Size(236,30),frm.Size);
                    //ss = new Form();
                    //ss.Show();
                    //ss.StartPosition = FormStartPosition.CenterScreen;

                    //form.Hide();
                    frm.TopMost = true;
                    frm.Show();
                    SetSearchDataSouse(this.lastSrvCa, this.srvSearch);
                    Shoutflag = true;
                    this.TextBox.Focus();

                    bool fla = this.TextBox.Focused;
                }
                else
                {
                    //  form.Hide();
                    Shoutflag = false;
                    frm.Show();
                    Shoutflag = true;
                    this.TextBox.Focus();
                    SetSearchDataSouse(this.lastSrvCa, this.srvSearch);
                }
            }
        }
Exemplo n.º 2
0
 void btnQuery_MouseClick(object sender, MouseEventArgs e)
 {
     if (Application.OpenForms["OrSrvForm"] == null)
     {
         XapDataList <EmsOrSrvSc> list = model.GetSrv(lastSrvCa == "" ? srvSearch.ValueText : lastSrvCa, srvSearch.ValueText, this.ent4BannerDto.Code_entp);
         frm = new OrSrvForm(list);
         frm.DbClickEvent += new OrSrvForm.DbClickHandle(frm_DbClickEvent);
         Point p = PointToScreen(new Point(srvSearch.Location.X + 356, srvSearch.Location.Y + 33));//控件的右下角位置
         frm.Local   = p;
         frm.TopMost = true;
         frm.Show();
     }
 }
Exemplo n.º 3
0
        void btnQuery_MouseClick(object sender, MouseEventArgs e)
        {
            if (frm == null && !frm.Created)
            {
                frm = new OrSrvForm();
                frm.DbClickEvent += new OrSrvForm.DbClickHandle(frm_DbClickEvent);

                //frm.Local = p;// AutoLocation.GetPopuLocation(pc,new Size(236,30),frm.Size);
                frm.Show();

                SetSearchDataSouse(this.lastSrvCa, this.srvSearch);

                this.Focus();
            }
        }
Exemplo n.º 4
0
        void btnQuery_MouseClick(object sender, MouseEventArgs e)
        {
            if (Application.OpenForms["OrSrvForm"] == null)
            {
                frm = new OrSrvForm();
                frm.DbClickEvent += new OrSrvForm.DbClickHandle(frm_DbClickEvent);
                Point p  = PointToScreen(new Point(srvSearch.Location.X + 356 - frm.Width, srvSearch.Location.Y + 30));//控件的右下角位置
                Point pc = System.Windows.Forms.Cursor.Position;
                pc        = PointToScreen(srvSearch.Location);
                frm.Local = p;// AutoLocation.GetPopuLocation(pc,new Size(236,30),frm.Size);
                frm.Show();

                SetSearchDataSouse(srvSearch.ValueText);

                srvSearch.Focus();
            }
        }
Exemplo n.º 5
0
        void xapFormControl1_DataChanged(object sender, DataChangedEventArgs e)
        {
            //XDataRow row = sender as XDataRow;

            //Point temp = LocationOnClient(this.gv);
            //frm.Location = new Point(temp.X,
            //                          temp.Y + row.ClickCell.Location.Y + row.ClickCell.Size.Height);
            if (e.ClassName == typeof(EmsOrDrug).FullName)
            {
                switch (e.PropName)
                {
                case "Name_srv":

                    XapDataList <EmsOrSrvSc> list = model.GetSrv("", e.Input.ToString(), ent4BannerDto.Code_entp);
                    frm = new OrSrvForm(list);
                    //frm = new OrSrvForm();
                    frm.DbClickEvent += new OrSrvForm.DbClickHandle(frm_DbClickEvent);

                    frm.Size          = new Size(400, 600);
                    frm.StartPosition = FormStartPosition.CenterScreen;

                    frm.TopMost = true;
                    frm.Show(this);
                    break;

                case "Name_mm":

                    EmsOrDrug orDrug = gv_drug.GetFocusedRow().RowDataSource as EmsOrDrug;
                    XapDataList <EmsOrDrug> Druglist = cof.GetSrvMm(CiHeadDo, orDrug.Id_srv, CiHeadDo.PatInfo.Code_entp);// model.GetBdSrvMM(orDrug.Id_srv);
                    form = new MmForm(Druglist);

                    form.Show();
                    orDrug.Name_mm = form.drugmm.Name_mm;
                    orDrug.Spec_mm = "";
                    orDrug.Name_hp = "医保?";
                    orDrug.Limit   = "";
                    orDrug.Price   = 22;
                    break;

                default:
                    break;
                }
            }
        }