Esempio n. 1
0
        public static bool CheckExists(AnHuoYiKu entity)
        {
            string sql = string.Empty;
            sql = "select * from anhuoyiku where cp='" + entity.Cp + "'";
            DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);

            return dt != null && dt.Rows.Count == 1;
        }
Esempio n. 2
0
 /*
    create table anhuoyiku(id integer primary key autoincrement,
  * ykw varchar(20),cp varchar(20),
  * sl integer,mdkw varchar(20),
  * scaner varchar(30),scantime datetime);
 */
 public static void Save(AnHuoYiKu entity)
 {
     string sql = string.Empty;
     sql = "insert into anhuoyiku(ykw,cp,mdkw,sl,scaner,scantime) values('" +
         entity.Ykw + "','" + entity.Cp + "','" +
         entity.MdKw + "',"+entity.Sl+",'" + entity.Scaner + "','" +
         System.DateTime.Now.ToString("s")
         + "')";
     SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql);
 }
Esempio n. 3
0
        private void RemoveData()
        {
            AnHuoYiKu entity = this.ComputeData();

            if (!AnHuoYiKuManager.CheckExists(entity))
            {
                MessageBox.Show("产品尚未扫描,不能撤消!");
                return;
            }
            AnHuoYiKuManager.Delete(entity);
            MessageBox.Show("撤消扫描成功!");
        }
Esempio n. 4
0
        private AnHuoYiKu ComputeData()
        {
            AnHuoYiKu entity = new AnHuoYiKu();

            entity.Sl     = this.txt_Count.Text;
            entity.MdKw   = this.txt_NewLoc.Text.Trim();
            entity.Cp     = this.txt_Product.Text.Trim();
            entity.Ykw    = this.txt_OldLoc.Text.Trim();
            entity.Scaner = Program.UserID;
            entity.date   = System.DateTime.Now;
            return(entity);
        }
Esempio n. 5
0
        private void SaveData()
        {
            AnHuoYiKu entity = this.ComputeData();

            if (AnHuoYiKuManager.CheckExists(entity))
            {
                MessageBox.Show("您已经扫描过该产品!");
            }
            else
            {
                AnHuoYiKuManager.Save(entity);
            }
        }
Esempio n. 6
0
 public static void Delete(AnHuoYiKu entity)
 {
     string sql = string.Empty;
     sql = "delete from anhuoyiku where cp='" + entity.Cp + "'";
     SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql);
 }