Esempio n. 1
0
        /// <summary>
        /// 设置显示信息
        /// </summary>
        /// <param name="Groupno"></param>
        public void SetInformation(string Groupno)
        {
            try
            {
                string str = select.INFO(Groupno);

                DataTable dtinfo = new DataTable();

                DataSet ds = DB.GetPIVAsDB(str);

                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    dtinfo = ds.Tables[0];

                    setPerson(dtinfo.Rows[0]);

                    //setCurrentDrug(dtinfo);
                    setCurrentDrug(ds.Tables[1]);
                }
            }
            catch (System.Exception ex)
            {
                File.AppendAllText(Application.StartupPath + "\\Log\\PivasBatch" + DateTime.Now.ToString("yyyyMMdd") + ".txt", "10009:" + ex.Message + "    " + DateTime.Now.ToString() + "\r\n");
            }
        }
Esempio n. 2
0
        public void sert(string Groupno)
        {
            try
            {
                OFF = false;
                //鼠标相对于屏幕的坐标
                this.Groupno = Groupno;
                Rectangle s = Screen.PrimaryScreen.WorkingArea;
                int       x = 0;
                int       y = 0;
                if (Control.MousePosition.X + this.Width < s.Width)
                {
                    x = Control.MousePosition.X;
                }
                else
                {
                    x = Control.MousePosition.X - this.Width;
                }
                if (Control.MousePosition.Y + this.Height < s.Height)
                {
                    y = Control.MousePosition.Y;
                }
                else
                {
                    y = Control.MousePosition.Y - this.Height;
                }
                this.Location = new Point(x, y);

                DataSet ds = db.GetPIVAsDB(sql.INFO(Groupno, pvb.datetime.ToString("yyyyMMdd")));
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    //根据瓶签号排序
                    DataTable dd = ds.Tables[0];
                    DataView  dw = dd.DefaultView;
                    dw.Sort = " labelNo ";


                    Dgv_Info.DataSource = dw;

                    //显示已打印未打印
                    for (int i = 0; i < Dgv_Info.Rows.Count; i++)
                    {
                        if (Dgv_Info.Rows[i].Cells["IVstatus"].Value.ToString().Trim().Equals("1"))
                        {
                            Dgv_Info.Rows[i].Cells[1].Tag = "1";

                            Dgv_Info["图片列", i].Value = PivasBatch.Properties.Resources.打印1;
                            enbaled = false;
                        }
                        else
                        {
                            Dgv_Info.Rows[i].Cells[1].Tag = "0";
                            enbaled = true;
                        }
                    }
                }

                Dgv_Info.Columns[1].Width = 5;
                Dgv_Info.Columns["StatasString"].Width = 50;
                Dgv_Info.Columns["FreqName"].Width     = 100;
                Dgv_Info.Columns["labelNo"].Width      = 120;
                Dgv_Info.Columns["IVstatus"].Visible   = false;
                Dgv_Info.Columns["BatchSaved"].Visible = false;
                Batch = Dgv_Info.Rows[0].Cells["batch"].Value.ToString().Trim();
                DataSet dds = db.GetPIVAsDB(sql.DOrder());
                //加载批次
                for (int i = 0; i < Fpanel_set.Controls.Count; i++)
                {
                    string labeltext = ((Label)(Fpanel_set.Controls[i])).Text.Trim();
                    if (dds.Tables[0].Select(" OrderID='" + labeltext + "'").Length <= 0)
                    {
                        Fpanel_set.Controls.Remove(Fpanel_set.Controls[i]);
                        i--;
                    }
                }
                Label_BorderShow();
                X   = this.Location.X;
                y   = this.Location.Y;
                OFF = true;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }