Example #1
0
 public static void DeleteTuopan(SendDetail entity, SendRecord parent)
 {
     string[] sql = new string[1];
     sql[0] = "delete from senddetail where tph='" +
              entity.Tph + "'";
     SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
 }
Example #2
0
 public static void DeleteTuopan(SendDetail entity, SendRecord parent)
 {
     string[] sql = new string[1];
     sql[0] = "delete from senddetail where tph='" +
         entity.Tph + "'";
     SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
 }
Example #3
0
        /*
           create table senddetail(so varchar(20),
         * sn varchar(20),fahuotype integer,
         * xxjh varchar(20),tph varchar(20),
         * scaner varchar(30),scantime datetime,status integer);
                      */
        /*
              create table sendrecord(id integer primary key autoincrement,
                * so varchar(20),otherso varchar(200),qufen varchar(20),
                * pnno varchar(20),cpqufen varchar(20),sl integer,
                * carno varchar(30),status integer,scaner varchar(30),
                * scantime datetime);
                             */
        public static void Save(SendDetail entity,SendRecord parent)
        {
            string pnno = string.Empty;
               if(entity.Sn!=null&&entity.Sn.Length>12)
               pnno = entity.Sn.Substring(2, 10);
            string sel = "select * from sendrecord where so='" + parent.So + "' and pnno='" + pnno + "'";
            DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sel);
            string[] sql = new string[2];
            sql[1] = "insert into senddetail(so,sn,fahuotype,xxjh,tph,scaner,scantime) values('" +
              entity.So + "','" + entity.Sn + "'," +
              entity.FahuoType + ",'" +

              entity.Xxjh + "','" +
               entity.Tph + "','" +
                entity.Scaner + "','" +
              System.DateTime.Now.ToString("s")
              + "')";
               /*
            sql = "select * from sendrecord where so='" +
               entity.So + "' and otherso='" + entity.OtherSo + "' and qufen='" +
               entity.QuFen + "' and pnno='" +
               entity.PnNo + "' and cpqufen='" +
               entity.CpQuFen + "' and carno='" +
               entity.CarNo + "' and status=" + entity.Status + ""
               + " and scaner='" + entity.Scaner + "'";
            * */
            if (pnno.Length > 0)
            {
                if (dt == null || dt.Rows.Count == 0)
                {
                    SendRecord sendrecord = new SendRecord();
                    sendrecord.So = parent.So;
                    sendrecord.OtherSo = parent.OtherSo;
                    sendrecord.CarNo = parent.CarNo;
                    sendrecord.QuFen = parent.QuFen;
                    sendrecord.Status = 0;
                    sendrecord.CpQuFen = string.Empty;
                    sendrecord.PnNo = pnno;
                    sendrecord.Sl = 1;
                    sendrecord.Scaner = Program.UserID;
                    sendrecord.date = System.DateTime.Now;
                    sql[0] = "insert into sendrecord(sl,so,otherso,qufen,pnno,cpqufen,carno,status,scaner,scantime) values(1,'" +
                        sendrecord.So + "','" + sendrecord.OtherSo + "','" +
                        sendrecord.QuFen + "','" + sendrecord.PnNo + "','" +
                        sendrecord.CpQuFen + "','" + sendrecord.CarNo + "'," + sendrecord.Status + ",'" +
                        sendrecord.Scaner + "','" +
                        System.DateTime.Now.ToString("s")
                        + "')";
                    //SendRecordManager.Save(sendrecord);
                }
                else
                {

                    sql[0] = "update sendrecord set sl=sl+1 where so='" + parent.So + "' and pnno='" + pnno + "'";

                }
            }
            SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
        }
Example #4
0
 public static void Delete(SendDetail entity,SendRecord parent)
 {
     string[] sql = new string[2];
     sql[0] = "delete from senddetail where sn='" +
         entity.Sn + "'";
     if(entity.Sn!=null&&entity.Sn.Length>0)
         sql[1] = "update sendrecord set sl=sl-1 where so='" + parent.So + "' and pnno='" + entity.Sn.Substring(2,10) + "'";
     SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
 }
Example #5
0
        public static bool CheckExistsTuopan(SendDetail entity)
        {
            string sql = string.Empty;
            sql = "select * from senddetail where tph='" +
               entity.Tph + "'";
            DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);

            return dt != null && dt.Rows.Count == 1;
        }
Example #6
0
        public static bool CheckExistsTuopan(SendDetail entity)
        {
            string sql = string.Empty;

            sql = "select * from senddetail where tph='" +
                  entity.Tph + "'";
            DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql);

            return(dt != null && dt.Rows.Count == 1);
        }
Example #7
0
 public static void Delete(SendDetail entity, SendRecord parent)
 {
     string[] sql = new string[2];
     sql[0] = "delete from senddetail where sn='" +
              entity.Sn + "'";
     if (entity.Sn != null && entity.Sn.Length > 0)
     {
         sql[1] = "update sendrecord set sl=sl-1 where so='" + parent.So + "' and pnno='" + entity.Sn.Substring(2, 10) + "'";
     }
     SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
 }
Example #8
0
 private SendDetail ComputeDataTray()
 {
     SendDetail entity = new SendDetail();
     entity.Sn = string.Empty;
     entity.Tph = this.txt_TrayNo.Text.Trim();
     entity.Xxjh = string.Empty;
     entity.FahuoType = 1;
     entity.So = record.So;
     entity.Scaner = Program.UserID;
     entity.date = System.DateTime.Now;
     return entity;
 }
Example #9
0
    { /*
       * create table senddetail(so varchar(20),
       * sn varchar(20),fahuotype integer,
       * xxjh varchar(20),tph varchar(20),
       * scaner varchar(30),scantime datetime,status integer);
       */
        /*
         *     create table sendrecord(id integer primary key autoincrement,
         * so varchar(20),otherso varchar(200),qufen varchar(20),
         * pnno varchar(20),cpqufen varchar(20),sl integer,
         * carno varchar(30),status integer,scaner varchar(30),
         * scantime datetime);
         */
        public static void Save(SendDetail entity, SendRecord parent)
        {
            string pnno = string.Empty;

            if (entity.Sn != null && entity.Sn.Length > 12)
            {
                pnno = entity.Sn.Substring(2, 10);
            }
            string    sel = "select * from sendrecord where so='" + parent.So + "' and pnno='" + pnno + "'";
            DataTable dt  = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sel);

            string[] sql = new string[2];
            sql[1] = "insert into senddetail(so,sn,fahuotype,xxjh,tph,scaner,scantime) values('" +
                     entity.So + "','" + entity.Sn + "'," +
                     entity.FahuoType + ",'" +

                     entity.Xxjh + "','" +
                     entity.Tph + "','" +
                     entity.Scaner + "','" +
                     System.DateTime.Now.ToString("s")
                     + "')";

            /*
             * sql = "select * from sendrecord where so='" +
             *  entity.So + "' and otherso='" + entity.OtherSo + "' and qufen='" +
             *  entity.QuFen + "' and pnno='" +
             *  entity.PnNo + "' and cpqufen='" +
             *  entity.CpQuFen + "' and carno='" +
             *  entity.CarNo + "' and status=" + entity.Status + ""
             + " and scaner='" + entity.Scaner + "'";
             * */
            if (pnno.Length > 0)
            {
                if (dt == null || dt.Rows.Count == 0)
                {
                    SendRecord sendrecord = new SendRecord();
                    sendrecord.So      = parent.So;
                    sendrecord.OtherSo = parent.OtherSo;
                    sendrecord.CarNo   = parent.CarNo;
                    sendrecord.QuFen   = parent.QuFen;
                    sendrecord.Status  = 0;
                    sendrecord.CpQuFen = string.Empty;
                    sendrecord.PnNo    = pnno;
                    sendrecord.Sl      = 1;
                    sendrecord.Scaner  = Program.UserID;
                    sendrecord.date    = System.DateTime.Now;
                    sql[0]             = "insert into sendrecord(sl,so,otherso,qufen,pnno,cpqufen,carno,status,scaner,scantime) values(1,'" +
                                         sendrecord.So + "','" + sendrecord.OtherSo + "','" +
                                         sendrecord.QuFen + "','" + sendrecord.PnNo + "','" +
                                         sendrecord.CpQuFen + "','" + sendrecord.CarNo + "'," + sendrecord.Status + ",'" +
                                         sendrecord.Scaner + "','" +
                                         System.DateTime.Now.ToString("s")
                                         + "')";
                    //SendRecordManager.Save(sendrecord);
                }
                else
                {
                    sql[0] = "update sendrecord set sl=sl+1 where so='" + parent.So + "' and pnno='" + pnno + "'";
                }
            }
            SqliteDbFactory.GetSqliteDbOperator().BatchExecute(sql);
        }