示例#1
0
        private void FlexChart1_MouseMove(object sender, MouseEventArgs e)
        {
            var hitTestInfo = flexChart1.HitTest(e.Location);

            if (hitTestInfo == null)
            {
                return;
            }
            if (hitTestInfo.Item != null && hitTestInfo.Distance <= MAX_DIST)
            {
                var item         = hitTestInfo.Item as Country;
                var htmlTemplate = @"<p><b>Country: </b>{0}
                                   <br/>
                                   <b>Sales: </b>{1}
                                   <br/>
                                   <b>Expenses: </b>{2}
                                   </p>";
                var htmlContent  = String.Format(htmlTemplate, item.Name, item.Sales, item.Expenses);
                _stSuperTooltip.SetToolTip(flexChart1, htmlContent);
            }
            else
            {
                _stSuperTooltip.Hide();
            }
        }
示例#2
0
        private void FlexChart1_MouseMove(object sender, MouseEventArgs e)
        {
            var hitInfo = flexChart1.HitTest(e.Location);

            if (hitInfo != null && hitInfo.Item != null && hitInfo.Distance <= MAX_DIST)
            {
                var item    = hitInfo.Item as CountrySalesOrders;
                var subData = from order in item.Orders
                              group order by order.Date.Year into newGroup
                              orderby newGroup.Key
                              select new
                {
                    Date   = newGroup.Key,
                    Amount = newGroup.Sum(x => x.Amount)
                };
                var chart = new FlexChart();
                chart.DataSource        = subData;
                chart.BindingX          = "Date";
                chart.Header.Content    = "Yearly Values : " + item.Name;
                chart.Header.Style.Font = StyleInfo.AxisTitleFont;

                var series = new Series()
                {
                    Binding = "Amount"
                };
                series.Style.FillColor = ColorTranslator.FromHtml("#DA3E52");
                chart.Series.Add(series);

                chart.DataLabel.Content  = "{y}";
                chart.DataLabel.Position = LabelPosition.Top;
                using (var ms = new MemoryStream())
                {
                    //Save the chart to C1SuperTooltip's Images collection
                    chart.SaveImage(ms, ImageFormat.Png, 400, 300);
                    var img       = Image.FromStream(ms);
                    var imageName = item.Name + ".png";
                    _c1SuperTooltip.Images.Add(imageName, img);
                }
                var html = "<img src='res://" + item.Name + ".png'/>";
                _c1SuperTooltip.SetToolTip(flexChart1, html);
            }
            else
            {
                _c1SuperTooltip.Hide();
                _c1SuperTooltip.Images.Clear();
            }
        }
示例#3
0
        /// <summary>
        /// マウスムーブ
        ///
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (_barList == null)
            {
                return;
            }

            //ツールチップ表示処理
            int r = this.MouseRow;
            int c = this.MouseCol;

            if (r > 1 && c >= FrozenColumnIdx + 1)
            {
                foreach (FxGanttBar fgb in _barList[r - FixedRowIdx].BarList)
                {
                    int canvasSX = TimeToCanvasX(fgb.DetailStartTime, DisplayDate);
                    int canvasEX = TimeToCanvasX(fgb.DetailEndTime, DisplayDate);
                    int canvasX  = ClientToCanvasX(this.Cols[FrozenColumnIdx + 1].Left, this.ScrollPosition.X, e.X);
                    if (canvasSX <= canvasX && canvasX <= canvasEX)
                    {
                        //Debug.Print("canvasSX:" + canvasSX + " canvasX:" + canvasX + " canvasEX:" + canvasEX);
                        //Debug.Print("Left:" + this.Cols[FROZEN_COLUMN_IDX + 1].Left);
                        if (fgb.PartType != FxGanttBar.PartTypes.Other)
                        {
                            //直接作業
                            GanttBarToolTip.BackgroundGradient = BackgroundGradient.Silver;
                        }
                        else
                        {
                            //間接作業
                            GanttBarToolTip.BackgroundGradient = BackgroundGradient.Blue;
                        }
                        GanttBarToolTip.SetToolTip(this, fgb.Tooltip);

                        return;
                    }
                }
            }
            GanttBarToolTip.Hide();
        }
示例#4
0
 private void BtnReq_Click(object sender, EventArgs e)
 {
     //throw new NotImplementedException();
     if (btnReq.Text.Equals("Confirm Request"))
     {
         stt.Hide();
         setLabRequest();
         String re  = ic.ivfDB.lbReqDB.insertLabRequest(lbReq, txtStfConfirmID.Text);
         long   chk = 0;
         if (long.TryParse(re, out chk))
         {
             btnReq.Image = Resources.accept_database24;
             System.Threading.Thread.Sleep(2000);
             this.Dispose();
         }
     }
     else
     {
         ic.cStf.staff_id = "";
         FrmPasswordConfirm frm = new FrmPasswordConfirm(ic);
         frm.ShowDialog(this);
         if (!ic.cStf.staff_id.Equals(""))
         {
             txtUserReq.Value      = ic.cStf.staff_fname_t + " " + ic.cStf.staff_lname_t;
             txtStfConfirmID.Value = ic.cStf.staff_id;
             btnReq.Text           = "Confirm Request";
             btnReq.Image          = Resources.Add_ticket_24;
             stt.Show("<p><b>สวัสดี</b></p>คุณ " + ic.cStf.staff_fname_t + " " + ic.cStf.staff_lname_t + "<br> กรุณายินยันการ confirm อีกครั้ง", btnReq);
         }
         else
         {
             btnReq.Text  = "Request";
             btnReq.Image = Resources.Ticket_24;
         }
     }
 }
 private void TxtThai_KeyPress(object sender, KeyPressEventArgs e)
 {
     //throw new NotImplementedException();
     sep.Clear();
     stt.Hide();
 }
示例#6
0
        private void BtnVisit_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            if (btnVisit.Text.Equals("Confirm"))
            {
                stt.Hide();

                String re = "", re1 = "";
                if (ic.iniC.statusAppDonor.Equals("1"))
                {
                    setVisit();
                    re = ic.ivfDB.vsDB.insertVisit(vs, txtStfConfirmID.Text);
                }
                else
                {
                    setVisitOld();
                    re = ic.ivfDB.ovsDB.insertVisitOld(vsOld, txtStfConfirmID.Text, "new");
                    long chk1 = 0;
                    if (long.TryParse(re, out chk1))
                    {
                        setVisit();
                        vs.visit_vn = re;
                        re          = ic.ivfDB.ovsDB.updateVEndTimeNull(vsOld.VN);
                        re1         = ic.ivfDB.vsDB.insertVisit(vs, txtStfConfirmID.Text);
                    }
                }
                long chk = 0;
                if (long.TryParse(re, out chk))
                {
                    //if (!ic.iniC.statusAppDonor.Equals("1"))
                    //{
                    //String re1 = ic.ivfDB.pttOldDB.insertPatientOld(ptt, txtStfConfirmID.Text);
                    //if (int.TryParse(re1, out chk))
                    //{
                    //if (txtID.Text.Equals(""))
                    //{
                    //    //PatientOld pttOld = new PatientOld();
                    //    //pttOld = ic.ivfDB.pttOldDB.selectByPk1(re1);
                    //    String re2 = ic.ivfDB.pttDB.updatePID(re, re1);
                    //    if (int.TryParse(re2, out chk))
                    //    {
                    txtID.Value    = re;
                    btnVisit.Text  = "Save Visit";
                    btnVisit.Image = Resources.accept_database24;
                    //        txtID.Value = re;
                    //        txtPid.Focus();
                    //    }
                    //}
                    //}
                    //}

                    System.Threading.Thread.Sleep(500);
                    this.Dispose();
                }
            }
            else
            {
                ic.cStf.staff_id = "";
                FrmPasswordConfirm frm = new FrmPasswordConfirm(ic);
                frm.ShowDialog(this);
                if (!ic.cStf.staff_id.Equals(""))
                {
                    txtUserReq.Value      = ic.cStf.staff_fname_t + " " + ic.cStf.staff_lname_t;
                    txtStfConfirmID.Value = ic.cStf.staff_id;
                    btnVisit.Text         = "Confirm";
                    btnVisit.Image        = Resources.Add_ticket_24;
                    stt.Show("<p><b>สวัสดี</b></p>คุณ " + ic.cStf.staff_fname_t + " " + ic.cStf.staff_lname_t + "<br> กรุณายินยันการ confirm อีกครั้ง", cboPttType);
                    btnVisit.Focus();
                }
                else
                {
                    btnVisit.Text  = "new Visit";
                    btnVisit.Image = Resources.download_database24;
                }
            }
        }