Ejemplo n.º 1
0
        /// <summary>
        /// 按条件删除数据
        /// </summary>
        /// <returns></returns>
        public int Delete(HashTableExp hash, String sqlWhere)
        {
            string sql = "delete from Temp_Data where 1=1 ";

            #region 查询条件
            if (hash != null)
            {
                if (hash["Id"] != null)
                {
                    sql += string.Format(" and Id='{0}'", hash["Id"]);
                }
                if (hash["Email"] != null)
                {
                    sql += string.Format(" and Email='{0}'", hash["Email"]);
                }
                if (hash["Expires"] != null)
                {
                    sql += string.Format(" and Expires='{0}'", hash["Expires"]);
                }
                if (hash["CreateTime"] != null)
                {
                    sql += string.Format(" and Create_Time='{0}'", hash["CreateTime"]);
                }
            }
            #endregion

            sql += sqlWhere;
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, null));
        }
 /// <summary>
 /// 数据库删除分组信息
 /// </summary>
 /// <param name="groupId"></param>
 /// <returns></returns>
 private bool WriteDbDeleteGrpInfomation(int groupId)
 {
     var strSql = "delete from grp_para where grp_id= " + groupId;
     //SQLiteHelper.ExecuteNonQueryInThread(strSql);
     //    return true;
     return SqlLiteHelper.ExecuteNonQuery(strSql) > 0;
 }
Ejemplo n.º 3
0
 private void button3_Click(object sender, EventArgs e)
 {
     //设定 comb1
     if (dataGridView1.CurrentCell != null)
     {
         if (comboBox1.SelectedItem is AlarmStrategy)
         {
             AlarmStrategy cas = comboBox1.SelectedItem as AlarmStrategy;
             //此处还应该操作数据库 使用helper+手写sql语句
             if (dataGridView1.CurrentCell.Value is DateCell && (dataGridView1.CurrentCell.Value as DateCell).AS != cas)
             {
                 DateCell dc = dataGridView1.CurrentCell.Value as DateCell;
                 dc.AS = cas;
                 dataGridView1.Refresh();
                 if (CurrentSensor.AlarmDic.ContainsKey(dc.YYYYMMDD))
                 {
                     CurrentSensor.AlarmDic[dc.YYYYMMDD] = cas;
                     //UPDATE SQL
                     string updateSql = string.Format("UPDATE T_ALARM_SENSOR_MAP SET aname='{0}' WHERE date='{1}' AND uid='{2}' AND node='{3}' AND port='{4}'", cas.Name, dc.YYYYMMDD, CurrentSensor.Uid, CurrentSensor.NodeId, CurrentSensor.PortId);
                     SqlLiteHelper.ExecuteNonQuery(db, updateSql);
                 }
                 else
                 {
                     CurrentSensor.AlarmDic.Add(dc.YYYYMMDD, cas);
                     //insert
                     string insertSql = string.Format("INSERT INTO T_ALARM_SENSOR_MAP (aname,date,uid,node,port) VALUES('{0}','{1}','{2}','{3}','{4}')", cas.Name, dc.YYYYMMDD, CurrentSensor.Uid, CurrentSensor.NodeId, CurrentSensor.PortId);
                     SqlLiteHelper.ExecuteNonQuery(db, insertSql);
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 按条件删除数据
        /// </summary>
        /// <returns></returns>
        public int Delete(HashTableExp hash, String sqlWhere)
        {
            string sql = "delete from Role_To_Module where 1=1 ";

            #region 查询条件
            if (hash != null)
            {
                if (hash["Id"] != null)
                {
                    sql += string.Format(" and Id='{0}'", hash["Id"]);
                }
                if (hash["RoleId"] != null)
                {
                    sql += string.Format(" and Role_Id='{0}'", hash["RoleId"]);
                }
                if (hash["ModuleId"] != null)
                {
                    sql += string.Format(" and Module_Id='{0}'", hash["ModuleId"]);
                }
            }
            #endregion

            sql += sqlWhere;
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, null));
        }
 private void WriteUpdateDbByPrivate(int instancesId)
 {
     //menu_instances_relation id(father_id,id,sort_index,name,instances_id)
     SqlLiteHelper.ExecuteNonQuery("delete from menu_instances_relation where instances_id=" + instancesId);
     if (!DicInstanceRelation.ContainsKey(instancesId))
     {
         return;
     }
     foreach (var t in DicInstanceRelation[instancesId])
     {
         try
         {
             string strUpdateDirectroy =
                 "insert into menu_instances_relation(father_id,id,sort_index,name,instances_id) values";
             strUpdateDirectroy += "(" + t.Value.FatherId + "," + t.Value.Id + "," + t.Value.SortIndex + ",'" +
                                   t.Value.Name + "'," + t.Value.InstancesId + ")";
             SqlLiteHelper.ExecuteNonQueryInThread(strUpdateDirectroy);
         }
         catch (Exception ex)
         {
             WriteLog.WriteLogError(
                 "Class MenuInstanceRelationHoldingExtend Function WriteUpdateDbByPrivate from SQLlite table menu_instances_relation  Occer an Error:" +
                 ex.ToString());
         }
     }
 }
        private void WriteUpdateDbByPrivate(int keyId)
        {
            SqlLiteHelper.ExecuteNonQuery("delete from menu_classic where id=" + keyId);
            if (!DicClassic.ContainsKey(keyId))
            {
                return;
            }
            string content = "";

            foreach (var t in DicClassic[keyId].Items)
            {
                content += t;
                content += "#";
            }

            string strUpdateDirectroy = "insert into menu_classic(id,name,content) values";

            strUpdateDirectroy += "(" + keyId + ",'" + DicClassic[keyId].Name + "','" + content + "')";
            try
            {
                SqlLiteHelper.ExecuteNonQueryInThread(strUpdateDirectroy);
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Ejemplo n.º 7
0
        private void Field_StateChanged(object sender, EventArgs e)
        {
            Field     field = sender as Field;
            AlarmInfo ai    = new AlarmInfo();

            ai.Time      = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            ai.Field     = field.Alias;
            ai.GroupName = field.CurrentSensor.GroupName;
            ai.Comment   = field.CurrentSensor.Comment;
            switch (field.State)
            {
            case 0:
                ai.State = state0;
                break;

            case 1:
                ai.State = state1;
                break;

            case 2:
                ai.State = state2;
                break;
            }
            dt.Rows.Add(ai.Time, ai.Field, ai.GroupName, ai.Comment, ai.State);
            string insertSql = string.Format("INSERT INTO record(time,field,groupname,comment,state) VALUES('{0}','{1}','{2}','{3}','{4}')", ai.Time, ai.Field, ai.GroupName, ai.Comment, ai.State);

            try
            {
                SqlLiteHelper.ExecuteNonQuery(db, insertSql);
            }
            catch (Exception ex)
            {
                Utils.WriteEX(ex);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 按条件删除数据
        /// </summary>
        /// <returns></returns>
        public int Delete(HashTableExp hash, String sqlWhere)
        {
            string sql = "delete from Bank_Card where 1=1 ";

            #region 查询条件
            if (hash != null)
            {
                if (hash["Id"] != null)
                {
                    sql += string.Format(" and Id='{0}'", hash["Id"]);
                }
                if (hash["Time"] != null)
                {
                    sql += string.Format(" and TIME='{0}'", hash["Time"]);
                }
                if (hash["Price"] != null)
                {
                    sql += string.Format(" and Price='{0}'", hash["Price"]);
                }
                if (hash["SaveType"] != null)
                {
                    sql += string.Format(" and Save_Type='{0}'", hash["SaveType"]);
                }
                if (hash["Balance"] != null)
                {
                    sql += string.Format(" and Balance='{0}'", hash["Balance"]);
                }
                if (hash["BankType"] != null)
                {
                    sql += string.Format(" and Bank_Type='{0}'", hash["BankType"]);
                }
                if (hash["Note"] != null)
                {
                    sql += string.Format(" and Note='{0}'", hash["Note"]);
                }
                if (hash["CreateBy"] != null)
                {
                    sql += string.Format(" and Create_By='{0}'", hash["CreateBy"]);
                }
                if (hash["CreateTime"] != null)
                {
                    sql += string.Format(" and Create_Time='{0}'", hash["CreateTime"]);
                }
                if (hash["UpdateBy"] != null)
                {
                    sql += string.Format(" and UpDate_By='{0}'", hash["UpdateBy"]);
                }
                if (hash["UpdateTime"] != null)
                {
                    sql += string.Format(" and UpDate_Time='{0}'", hash["UpdateTime"]);
                }
            }
            #endregion

            sql += sqlWhere;
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, null));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 按条件删除数据
        /// </summary>
        /// <returns></returns>
        public int Delete(HashTableExp hash, String sqlWhere)
        {
            string sql = "delete from Lifing_Cost where 1=1 ";

            #region 查询条件
            if (hash != null)
            {
                if (hash["Id"] != null)
                {
                    sql += string.Format(" and Id='{0}'", hash["Id"]);
                }
                if (hash["Time"] != null)
                {
                    sql += string.Format(" and TIME='{0}'", hash["Time"]);
                }
                if (hash["Reason"] != null)
                {
                    sql += string.Format(" and Reason='{0}'", hash["Reason"]);
                }
                if (hash["Price"] != null)
                {
                    sql += string.Format(" and Price='{0}'", hash["Price"]);
                }
                if (hash["CostTypeId"] != null)
                {
                    sql += string.Format(" and Cost_Type_Id='{0}'", hash["CostTypeId"]);
                }
                if (hash["Notes"] != null)
                {
                    sql += string.Format(" and Notes='{0}'", hash["Notes"]);
                }
                if (hash["ImgUrl"] != null)
                {
                    sql += string.Format(" and Img_Url='{0}'", hash["ImgUrl"]);
                }
                if (hash["CreateBy"] != null)
                {
                    sql += string.Format(" and Create_By='{0}'", hash["CreateBy"]);
                }
                if (hash["CreateTime"] != null)
                {
                    sql += string.Format(" and Create_Time='{0}'", hash["CreateTime"]);
                }
                if (hash["UpdateBy"] != null)
                {
                    sql += string.Format(" and UpDate_By='{0}'", hash["UpdateBy"]);
                }
                if (hash["UpdateTime"] != null)
                {
                    sql += string.Format(" and UpDate_Time='{0}'", hash["UpdateTime"]);
                }
            }
            #endregion

            sql += sqlWhere;
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, null));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 修改用户角色对应表
        /// </summary>
        /// <param name="index">用户角色对应表对象</param>
        /// <returns></returns>
        public int Update(UserToRole index)
        {
            string sql = "update User_To_Role set Id=@Id,User_Id=@User_Id,Role_Id=@Role_Id where Id=@Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@User_Id", index.UserId),
                new SQLiteParameter("@Role_Id", index.RoleId)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 修改角色模块对应表
        /// </summary>
        /// <param name="index">角色模块对应表对象</param>
        /// <returns></returns>
        public int Update(RoleToModule index)
        {
            string sql = "update Role_To_Module set Id=@Id,Role_Id=@Role_Id,Module_Id=@Module_Id where Id=@Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Role_Id", index.RoleId),
                new SQLiteParameter("@Module_Id", index.ModuleId)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 修改角色表
        /// </summary>
        /// <param name="index">角色表对象</param>
        /// <returns></returns>
        public int Update(Roles index)
        {
            string sql = "update Roles set Role_Id=@Role_Id,Role_Name=@Role_Name,Notes=@Notes where Role_Id=@Role_Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Role_Id", index.RoleId),
                new SQLiteParameter("@Role_Name", index.RoleName),
                new SQLiteParameter("@Notes", index.Notes)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 13
0
 private void button3_Click(object sender, EventArgs e)
 {
     //保存
     if (CAS.Name == null)
     {
         if (!SetName())
         {
             return;
         }
     }
     if (CASCopy != null)
     {
         //编辑保存 //更新Alarm和Map
         string usql = CASOrgin.CompareTo(CAS);
         if (!string.IsNullOrWhiteSpace(usql))
         {
             //万一有人用这个策略咋办 此处想个办法调出Sensor的字典修改其引用.
             //ConfigData.AllStrategy[ConfigData.AllStrategy.IndexOf(CASOrgin)] = CAS;
             if (ConfigData.AllStrategy.Contains(CASOrgin))
             {
                 int i = ConfigData.AllStrategy.IndexOf(CASOrgin);
                 ConfigData.AllStrategy[i] = CAS;
             }
             foreach (var item in ConfigData.allSensors)
             {
                 for (int i = 0; i < item.AlarmDic.Keys.Count; i++)
                 {
                     if (item.AlarmDic[item.AlarmDic.Keys.ElementAt(i)] == CASOrgin)
                     {
                         item.AlarmDic[item.AlarmDic.Keys.ElementAt(i)] = CAS;
                     }
                 }
             }
             SqlLiteHelper.ExecuteNonQuery(db, usql);
             userCalendar.DateTimePicker1_ValueChanged(null, null);
         }
     }
     else //新建保存
     {
         foreach (var item in CAS.A24s)
         {
             string insertSql = @"INSERT INTO T_ALARM(name,field,warn,h0t,h0l,h1t,h1l,h2t,h2l,h3t,h3l,h4t,h4l,h5t,h5l,h6t,h6l,h7t,h7l,
             h8t,h8l,h9t,h9l,h10t,h10l,h11t,h11l,h12t,h12l,h13t,h13l,h14t,h14l,h15t,h15l,h16t,h16l,h17t,h17l,h18t,h18l,h19t,h19l,h20t,h20l,h21t,h21l,h22t,h22l,h23t,h23l) 
             VALUES('" + CAS.Name + "','" + item.Field + "','" + item.Warn + "','" + item.Hs[0].Top + "','" + item.Hs[0].Low + "','" + item.Hs[1].Top + "','" + item.Hs[1].Low + "','" + item.Hs[2].Top + "','" + item.Hs[2].Low + "','" + item.Hs[3].Top + "','" + item.Hs[3].Low + "','" + item.Hs[4].Top + "','" + item.Hs[4].Low + "','" + item.Hs[5].Top + "','" + item.Hs[5].Low + "','" + item.Hs[6].Top + "','" + item.Hs[6].Low + "','" + item.Hs[7].Top + "','" + item.Hs[7].Low +
                                "','" + item.Hs[8].Top + "','" + item.Hs[8].Low + "','" + item.Hs[9].Top + "','" + item.Hs[9].Low + "','" + item.Hs[10].Top + "','" + item.Hs[10].Low + "','" + item.Hs[11].Top + "','" + item.Hs[11].Low + "','" + item.Hs[12].Top + "','" + item.Hs[12].Low + "','" + item.Hs[13].Top + "','" + item.Hs[13].Low + "','" + item.Hs[14].Top + "','" + item.Hs[14].Low + "','" + item.Hs[15].Top + "','" + item.Hs[15].Low + "','" + item.Hs[16].Top + "','" + item.Hs[16].Low + "','" + item.Hs[17].Top + "','" + item.Hs[17].Low +
                                "','" + item.Hs[18].Top + "','" + item.Hs[18].Low + "','" + item.Hs[19].Top + "','" + item.Hs[19].Low + "','" + item.Hs[20].Top + "','" + item.Hs[20].Low + "','" + item.Hs[21].Top + "','" + item.Hs[21].Low + "','" + item.Hs[22].Top + "','" + item.Hs[22].Low + "','" + item.Hs[23].Top + "','" + item.Hs[23].Low + "')";
             SqlLiteHelper.ExecuteNonQuery(db, insertSql);
         }
         ConfigData.AllStrategy.Add(CAS);
         userCalendar.RefreshComb();
     }
     this.Visible = false;
     this.userCalendar.Visible = true;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// 增加角色表
        /// </summary>
        /// <param name="index">角色表对象</param>
        /// <returns></returns>
        public int Add(Roles index)
        {
            string sql = string.Format("insert into Roles(Role_Id,Role_Name,Notes) values(@Role_Id,@Role_Name,@Notes)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Role_Id", index.RoleId),
                new SQLiteParameter("@Role_Name", index.RoleName),
                new SQLiteParameter("@Notes", index.Notes)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 增加角色模块对应表
        /// </summary>
        /// <param name="index">角色模块对应表对象</param>
        /// <returns></returns>
        public int Add(RoleToModule index)
        {
            string sql = string.Format("insert into Role_To_Module(Id,Role_Id,Module_Id) values(@Id,@Role_Id,@Module_Id)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Role_Id", index.RoleId),
                new SQLiteParameter("@Module_Id", index.ModuleId)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 16
0
        private void button1_Click(object sender, EventArgs e)
        {
            string db  = Path.Combine(Utils.GetUserPath(), "alarm.db");
            string sql = "SELECT COUNT(*) FROM sqlite_master where type = 'table' and name = 'record'";
            object obj = SqlLiteHelper.ExecuteScalar(db, sql);

            if (Convert.ToInt32(obj) == 0)
            {
                string createSql = "CREATE TABLE record(time varchar(50),field varchar(50),groupname varchar(50),comment varchar(50),state varchar(50))";
                int    res       = SqlLiteHelper.ExecuteNonQuery(db, createSql);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 修改临时信息存储表
        /// </summary>
        /// <param name="index">临时信息存储表对象</param>
        /// <returns></returns>
        public int Update(TempData index)
        {
            string sql = "update Temp_Data set Id=@Id,Email=@Email,Expires=@Expires,Create_Time=@Create_Time where Id=@Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Email", index.Email),
                new SQLiteParameter("@Expires", index.Expires),
                new SQLiteParameter("@Create_Time", index.CreateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 增加临时信息存储表
        /// </summary>
        /// <param name="index">临时信息存储表对象</param>
        /// <returns></returns>
        public int Add(TempData index)
        {
            string sql = string.Format("insert into Temp_Data(Id,Email,Expires,Create_Time) values(@Id,@Email,@Expires,@Create_Time)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Email", index.Email),
                new SQLiteParameter("@Expires", index.Expires),
                new SQLiteParameter("@Create_Time", index.CreateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 19
0
 /// <summary>
 /// 将汉化将使用的语言写入数据库 下次启动时自动加载汉化版本
 /// </summary>
 /// <param name="culture"></param>
 public void SetCultureToDb(string culture)
 {
     try
     {
         SqlLiteHelper.ExecuteNonQuery("delete from i36n_culture");
         string strUpdateDirectroy = "insert into i36n_culture(culture) values ('" + culture.Trim() + "')";
         SqlLiteHelper.ExecuteNonQuery(strUpdateDirectroy);
     }
     catch (Exception ex)
     {
         ex.ToString();
     }
 }
Ejemplo n.º 20
0
        /// <summary>
        /// 增加收入记录表
        /// </summary>
        /// <param name="index">收入记录表对象</param>
        /// <returns></returns>
        public int Add(Student index)
        {
            string sql = string.Format("insert into Student(id,name,card_no,birth_day,sex,addr,remark) values(@id,@name,@card_no,@birth_day,@sex,@addr,@remark)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@id", index.Id),
                new SQLiteParameter("@name", index.Name),
                new SQLiteParameter("@card_no", index.CardNo),
                new SQLiteParameter("@birth_day", index.BirthDay),
                new SQLiteParameter("@sex", index.Sex),
                new SQLiteParameter("@addr", index.Addr),
                new SQLiteParameter("@remark", index.Remark)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 修改收入记录表
        /// </summary>
        /// <param name="index">收入记录表对象</param>
        /// <returns></returns>
        public int Update(Student index)
        {
            string sql = "update Student set id=@id,name=@name,card_no=@card_no,birth_day=@birth_day,sex=@sex,addr=@addr,remark=@remark where id=@id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@id", index.Id),
                new SQLiteParameter("@name", index.Name),
                new SQLiteParameter("@card_no", index.CardNo),
                new SQLiteParameter("@birth_day", index.BirthDay),
                new SQLiteParameter("@sex", index.Sex),
                new SQLiteParameter("@addr", index.Addr),
                new SQLiteParameter("@remark", index.Remark)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 修改文章类型表
        /// </summary>
        /// <param name="index">文章类型表对象</param>
        /// <returns></returns>
        public int Update(ArtCategory index)
        {
            string sql = "update Art_Category set Cat_Id=@Cat_Id,Cat_Name=@Cat_Name,Cat_Remark=@Cat_Remark,Cat_Order=@Cat_Order,Create_By=@Create_By,Create_Time=@Create_Time,UpDate_By=@UpDate_By,UpDate_Time=@UpDate_Time where Cat_Id=@Cat_Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Cat_Id", index.CatId),
                new SQLiteParameter("@Cat_Name", index.CatName),
                new SQLiteParameter("@Cat_Remark", index.CatRemark),
                new SQLiteParameter("@Cat_Order", index.CatOrder),
                new SQLiteParameter("@Create_By", index.CreateBy),
                new SQLiteParameter("@Create_Time", index.CreateTime),
                new SQLiteParameter("@UpDate_By", index.UpdateBy),
                new SQLiteParameter("@UpDate_Time", index.UpdateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 23
0
        public int Add(Module index)
        {
            string sql = string.Format("insert into Module(Module_ID,Module_Name,Module_URL,Icon_Url,Parent_Id,Order_Id,Notes,STATUS) values(@Module_ID,@Module_Name,@Module_URL,@Icon_Url,@Parent_Id,@Order_Id,@Notes,@STATUS)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Module_ID", index.ModuleId),
                new SQLiteParameter("@Module_Name", index.ModuleName),
                new SQLiteParameter("@Module_URL", index.ModuleUrl),
                new SQLiteParameter("@Icon_Url", index.IconUrl),
                new SQLiteParameter("@Parent_Id", index.ParentId),
                new SQLiteParameter("@Order_Id", index.OrderId),
                new SQLiteParameter("@Notes", index.Notes),
                new SQLiteParameter("@STATUS", index.Status)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 修改模块表
        /// </summary>
        /// <param name="index">模块表对象</param>
        /// <returns></returns>
        public int Update(Module index)
        {
            string sql = "update Module set Module_ID=:Module_ID,Module_Name=:Module_Name,Module_URL=:Module_URL,Icon_Url=:Icon_Url,Parent_Id=:Parent_Id,Order_Id=:Order_Id,Notes=:Notes,STATUS=:STATUS where Module_ID=:Module_ID";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter(":Module_ID", index.ModuleId),
                new SQLiteParameter(":Module_Name", index.ModuleName),
                new SQLiteParameter(":Module_URL", index.ModuleUrl),
                new SQLiteParameter(":Icon_Url", index.IconUrl),
                new SQLiteParameter(":Parent_Id", index.ParentId),
                new SQLiteParameter(":Order_Id", index.OrderId),
                new SQLiteParameter(":Notes", index.Notes),
                new SQLiteParameter(":STATUS", index.Status)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 增加文章表
        /// </summary>
        /// <param name="index">文章表对象</param>
        /// <returns></returns>
        public int Add(Article index)
        {
            string sql = string.Format("insert into Article(Id,Title,Content,Cate_Id,Create_By,Create_Time,UpDate_By,UpDate_Time) values(@Id,@Title,@Content,@Cate_Id,@Create_By,@Create_Time,@UpDate_By,@UpDate_Time)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Title", index.Title),
                new SQLiteParameter("@Content", index.Content),
                new SQLiteParameter("@Cate_Id", index.CateId),
                new SQLiteParameter("@Create_By", index.CreateBy),
                new SQLiteParameter("@Create_Time", index.CreateTime),
                new SQLiteParameter("@UpDate_By", index.UpdateBy),
                new SQLiteParameter("@UpDate_Time", index.UpdateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 修改文章表
        /// </summary>
        /// <param name="index">文章表对象</param>
        /// <returns></returns>
        public int Update(Article index)
        {
            string sql = "update Article set Id=@Id,Title=@Title,Content=@Content,Cate_Id=@Cate_Id,Create_By=@Create_By,Create_Time=@Create_Time,UpDate_By=@UpDate_By,UpDate_Time=@UpDate_Time where Id=@Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Title", index.Title),
                new SQLiteParameter("@Content", index.Content),
                new SQLiteParameter("@Cate_Id", index.CateId),
                new SQLiteParameter("@Create_By", index.CreateBy),
                new SQLiteParameter("@Create_Time", index.CreateTime),
                new SQLiteParameter("@UpDate_By", index.UpdateBy),
                new SQLiteParameter("@UpDate_Time", index.UpdateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 增加文章类型表
        /// </summary>
        /// <param name="index">文章类型表对象</param>
        /// <returns></returns>
        public int Add(ArtCategory index)
        {
            string sql = string.Format("insert into Art_Category(Cat_Id,Cat_Name,Cat_Remark,Cat_Order,Create_By,Create_Time,UpDate_By,UpDate_Time) values(@Cat_Id,@Cat_Name,@Cat_Remark,@Cat_Order,@Create_By,@Create_Time,@UpDate_By,@UpDate_Time)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Cat_Id", index.CatId),
                new SQLiteParameter("@Cat_Name", index.CatName),
                new SQLiteParameter("@Cat_Remark", index.CatRemark),
                new SQLiteParameter("@Cat_Order", index.CatOrder),
                new SQLiteParameter("@Create_By", index.CreateBy),
                new SQLiteParameter("@Create_Time", index.CreateTime),
                new SQLiteParameter("@UpDate_By", index.UpdateBy),
                new SQLiteParameter("@UpDate_Time", index.UpdateTime)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 修改用户表
        /// </summary>
        /// <param name="index">用户表对象</param>
        /// <returns></returns>
        public int Update(Users index)
        {
            string sql = "update Users set Id=@Id,Login_Id=@Login_Id,Login_Pwd=@Login_Pwd,Name=@Name,Phone=@Phone,Mail=@Mail,Address=@Address,Age=@Age,Notes=@Notes where Id=@Id";

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Login_Id", index.LoginId),
                new SQLiteParameter("@Login_Pwd", index.LoginPwd),
                new SQLiteParameter("@Name", index.Name),
                new SQLiteParameter("@Phone", index.Phone),
                new SQLiteParameter("@Mail", index.Mail),
                new SQLiteParameter("@Address", index.Address),
                new SQLiteParameter("@Age", index.Age),
                new SQLiteParameter("@Notes", index.Notes)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns>影响的行数</returns>
        public int Add(Users index)
        {
            string sql = string.Format("insert into Users(Id,Login_Id,Login_Pwd,Name,Phone,Mail,Address,Age,Notes) values(@Id,@Login_Id,@Login_Pwd,@Name,@Phone,@Mail,@Address,@Age,@Notes)");

            SQLiteParameter[] parm = new SQLiteParameter[] {
                new SQLiteParameter("@Id", index.Id),
                new SQLiteParameter("@Login_Id", index.LoginId),
                new SQLiteParameter("@Login_Pwd", index.LoginPwd),
                new SQLiteParameter("@Name", index.Name),
                new SQLiteParameter("@Phone", index.Phone),
                new SQLiteParameter("@Mail", index.Mail),
                new SQLiteParameter("@Address", index.Address),
                new SQLiteParameter("@Age", index.Age),
                new SQLiteParameter("@Notes", index.Notes)
            };
            return(SqlLiteHelper.ExecuteNonQuery(sql, CommandType.Text, parm));
        }
Ejemplo n.º 30
0
        public int update(string seqNo)
        {
            string sql = "update  Monitor set Status ='N' where SeqNo=" + seqNo;

            SQLiteParameter[] sqllite = new SQLiteParameter[] {};
            int i = sqlLiteHelper.ExecuteNonQuery(sql, sqllite);

            if (i > 0)
            {
                DataRow[] dataRows = loadData.Select("SeqNo =" + seqNo + "");
                if (dataRows.Count() > 0)
                {
                    dataRows[0]["Status"] = "N";
                }
            }
            return(i);
        }