Ejemplo n.º 1
0
        public bool update(Model.wrenchstatus wrenchstatusmodel)
        {
            string tableName = typeof(wrenchstatus).Name;
            string contion   = string.Format("guid='{0}'", wrenchstatusmodel.guid);
            string sql       = string.Format("statusName='{0}',statusDM='{1}',comment='{2}'", wrenchstatusmodel.statusName, wrenchstatusmodel.statusDM, wrenchstatusmodel.comment);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
 public bool Del(Model.wrenchstatus wrenchstatus)
 {
     try
     {
         string contation = string.Format("where guid='{0}'", wrenchstatus.guid);
         string sql       = "delete from wrenchstatus " + contation;
         var    ds        = SqliteHelper.ExecuteNonQuery(con, sql, CommandType.Text);
         if (Convert.ToInt32(ds) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch
     {
         return(false);
     }
 }
 public bool update(Model.wrenchstatus wrenchstatusmodel)
 {
     try
     {
         string contation = string.Format("where guid='{0}'", wrenchstatusmodel.guid);
         string strsql    = string.Format("statusName='{0}',statusDM='{1}',comment='{2}'", wrenchstatusmodel.statusName, wrenchstatusmodel.statusDM, wrenchstatusmodel.comment);
         string sql       = "update wrenchstatus set " + strsql + contation;
         var    ds        = SqliteHelper.ExecuteNonQuery(con, sql, CommandType.Text);
         if (Convert.ToInt32(ds) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch
     {
         return(false);
     }
 }
 public bool add(Model.wrenchstatus wrenchstatusmodel)
 {
     try
     {
         string sql =
             string.Format
             (
                 "INSERT INTO wrenchstatus(statusName,statusDM,comment,guid) VALUES('{0}','{1}','{2}','{3}') ;select last_insert_rowid()",
                 wrenchstatusmodel.statusName, wrenchstatusmodel.statusDM, wrenchstatusmodel.comment, wrenchstatusmodel.guid
             );
         var ds = SqliteHelper.ExecuteScalar(con, sql, CommandType.Text);
         if (Convert.ToInt32(ds) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 5
0
 public bool add(Model.wrenchstatus wrenchstatusmodel)
 {
     return(ServerHelp.addSingleInfoNotReturnID <wrenchstatus>(wrenchstatusmodel, _webip));
 }