Exemplo n.º 1
0
        public static bool CheckExists(ZuTuo entity)
        {
            string sql = string.Empty;
            sql = "select * from zutuo where sn='" + entity.Sn + "'";
            DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);

            return dt != null && dt.Rows.Count == 1;
        }
Exemplo n.º 2
0
 private ZuTuo ComputeData()
 {
     ZuTuo zutuo = new ZuTuo();
     zutuo.Tph = this.txt_TrayNo.Text.Trim();
     zutuo.Xxjh = this.txt_XiaXiangJi.Text.Trim();
     zutuo.Sn = this.txt_SN.Text.Trim();
     zutuo.Scaner = Program.UserID;
     zutuo.date = System.DateTime.Now;
     return zutuo;
 }
Exemplo n.º 3
0
 /*
  create table zutuo(id integer primary key autoincrement
 ,tph varchar(20),sn varchar(20),xxjh varchar(20),
  scaner varchar(30),scantime datetime);
  */
 public static void Save(ZuTuo entity)
 {
     string sql = string.Empty;
     sql = "insert into zutuo(tph,sn,xxjh,scaner,scantime) values('" +
         entity.Tph + "','" + entity.Sn + "','" +
         entity.Xxjh + "','" + entity.Scaner + "','" +
         entity.date.ToString("s")
         +"')";
     SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql);
 }
Exemplo n.º 4
0
        private void RemoveData()
        {
            ZuTuo entity = this.ComputeData();

            if (!ZuTuoManager.CheckExists(entity))
            {
                MessageBox.Show("产品尚未扫描,不能撤消!");
                return;
            }
            ZuTuoManager.Delete(entity);
        }
Exemplo n.º 5
0
        private ZuTuo ComputeData()
        {
            ZuTuo zutuo = new ZuTuo();

            zutuo.Tph    = this.txt_TrayNo.Text.Trim();
            zutuo.Xxjh   = this.txt_XiaXiangJi.Text.Trim();
            zutuo.Sn     = this.txt_SN.Text.Trim();
            zutuo.Scaner = Program.UserID;
            zutuo.date   = System.DateTime.Now;
            return(zutuo);
        }
Exemplo n.º 6
0
        private void SaveData()
        {
            ZuTuo entity = this.ComputeData();

            if (ZuTuoManager.CheckExists(entity))
            {
                MessageBox.Show("您已经扫描过该产品!");
            }
            else
            {
                ZuTuoManager.Save(entity);
            }
        }
Exemplo n.º 7
0
 public static void Delete(ZuTuo entity)
 {
     string sql = string.Empty;
     sql = "delete from zutuo where sn='" + entity.Sn + "'";
     SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql);
 }