Пример #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DXD.Model.leave_report model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update leave_report set ");
            strSql.Append("query_id=@query_id,");
            strSql.Append("passport_id=@passport_id,");
            strSql.Append("passport_type=@passport_type,");
            strSql.Append("inout_type=@inout_type,");
            strSql.Append("visa_type=@visa_type,");
            strSql.Append("inout_date=@inout_date,");
            strSql.Append("port_name=@port_name,");
            strSql.Append("destination=@destination,");
            strSql.Append("leave_reason=@leave_reason,");
            strSql.Append("add_user=@add_user,");
            strSql.Append("add_time=@add_time");
            strSql.Append(" where id=@id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",      DbType.Int32,       8),
                new SQLiteParameter("@passport_id",   DbType.Int32,       8),
                new SQLiteParameter("@passport_type", DbType.Int32,       4),
                new SQLiteParameter("@inout_type",    DbType.Int32,       4),
                new SQLiteParameter("@visa_type",     DbType.Int32,       4),
                new SQLiteParameter("@inout_date",    DbType.DateTime),
                new SQLiteParameter("@port_name",     DbType.String,    200),
                new SQLiteParameter("@destination",   DbType.String,    200),
                new SQLiteParameter("@leave_reason",  DbType.String,    200),
                new SQLiteParameter("@add_user",      DbType.String,     50),
                new SQLiteParameter("@add_time",      DbType.DateTime),
                new SQLiteParameter("@id",            DbType.Int32, 8)
            };
            parameters[0].Value  = model.query_id;
            parameters[1].Value  = model.passport_id;
            parameters[2].Value  = model.passport_type;
            parameters[3].Value  = model.inout_type;
            parameters[4].Value  = model.visa_type;
            parameters[5].Value  = model.inout_date;
            parameters[6].Value  = model.port_name;
            parameters[7].Value  = model.destination;
            parameters[8].Value  = model.leave_reason;
            parameters[9].Value  = model.add_user;
            parameters[10].Value = model.add_time;
            parameters[11].Value = model.id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(KryptonAccessController.SQLite.Model.InteractRelation.ControllerInfoInLAN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ControllerInfoInLAN set ");
            strSql.Append("ControllerName=@ControllerName,");
            strSql.Append("ControllerType=@ControllerType,");
            strSql.Append("ComunicateType=@ComunicateType,");
            strSql.Append("ControllerIP=@ControllerIP,");
            strSql.Append("ControllerPort=@ControllerPort,");
            strSql.Append("ControllerAddr485=@ControllerAddr485,");
            strSql.Append("ControllerBaudrate=@ControllerBaudrate,");
            strSql.Append("ControllerDataBits=@ControllerDataBits,");
            strSql.Append("ControllerStopBits=@ControllerStopBits,");
            strSql.Append("ControllerParityCheck=@ControllerParityCheck,");
            strSql.Append("ControllerFlowControl=@ControllerFlowControl");
            strSql.Append(" where ControllerID=@ControllerID ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@ControllerName",        DbType.String),
                new SQLiteParameter("@ControllerType",        DbType.Int32,   4),
                new SQLiteParameter("@ComunicateType",        DbType.Int32,   4),
                new SQLiteParameter("@ControllerIP",          DbType.String),
                new SQLiteParameter("@ControllerPort",        DbType.Int32,   4),
                new SQLiteParameter("@ControllerAddr485",     DbType.Int32,   4),
                new SQLiteParameter("@ControllerBaudrate",    DbType.Int32,   4),
                new SQLiteParameter("@ControllerDataBits",    DbType.Int32,   4),
                new SQLiteParameter("@ControllerStopBits",    DbType.Int32,   4),
                new SQLiteParameter("@ControllerParityCheck", DbType.String),
                new SQLiteParameter("@ControllerFlowControl", DbType.String),
                new SQLiteParameter("@ControllerID",          DbType.Int32, 4)
            };
            parameters[0].Value  = model.ControllerName;
            parameters[1].Value  = model.ControllerType;
            parameters[2].Value  = model.ComunicateType;
            parameters[3].Value  = model.ControllerIP;
            parameters[4].Value  = model.ControllerPort;
            parameters[5].Value  = model.ControllerAddr485;
            parameters[6].Value  = model.ControllerBaudrate;
            parameters[7].Value  = model.ControllerDataBits;
            parameters[8].Value  = model.ControllerStopBits;
            parameters[9].Value  = model.ControllerParityCheck;
            parameters[10].Value = model.ControllerFlowControl;
            parameters[11].Value = model.ControllerID;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.Role model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Role set ");
            strSql.Append("IsDeleted=@IsDeleted,");
            strSql.Append("Name=@Name,");
            strSql.Append("Description=@Description,");
            strSql.Append("OrderSort=@OrderSort,");
            strSql.Append("Enabled=@Enabled,");
            strSql.Append("CreateId=@CreateId,");
            strSql.Append("CreateBy=@CreateBy,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("ModifyId=@ModifyId,");
            strSql.Append("ModifyBy=@ModifyBy,");
            strSql.Append("ModifyTime=@ModifyTime");
            strSql.Append(" where Id=@Id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@IsDeleted",   DbType.bit,         1),
                new SQLiteParameter("@Name",        DbType.String),
                new SQLiteParameter("@Description", DbType.String),
                new SQLiteParameter("@OrderSort",   DbType.Int32,       8),
                new SQLiteParameter("@Enabled",     DbType.bit,         1),
                new SQLiteParameter("@CreateId",    DbType.Int32,       8),
                new SQLiteParameter("@CreateBy",    DbType.String),
                new SQLiteParameter("@CreateTime",  DbType.DateTime),
                new SQLiteParameter("@ModifyId",    DbType.Int32,       8),
                new SQLiteParameter("@ModifyBy",    DbType.String,    255),
                new SQLiteParameter("@ModifyTime",  DbType.DateTime),
                new SQLiteParameter("@Id",          DbType.Int32, 8)
            };
            parameters[0].Value  = model.IsDeleted;
            parameters[1].Value  = model.Name;
            parameters[2].Value  = model.Description;
            parameters[3].Value  = model.OrderSort;
            parameters[4].Value  = model.Enabled;
            parameters[5].Value  = model.CreateId;
            parameters[6].Value  = model.CreateBy;
            parameters[7].Value  = model.CreateTime;
            parameters[8].Value  = model.ModifyId;
            parameters[9].Value  = model.ModifyBy;
            parameters[10].Value = model.ModifyTime;
            parameters[11].Value = model.Id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #4
0
        public bool Edit(Article item)
        {
            string sqlstr = "UPDATE [tbl_Article]  SET [CID]='" + item.CID + "',[Title] = '" + item.Title + "',[ImgStr] = '" + item.ImgStr + "'," +
                            "[ProductTxt]='" + item.ProductTxt + "',[ShortTxt]='" + item.ShortTxt + "',[Content]='" + item.Content + "'," +
                            "[AddTime]='" + item.AddTime + "',[Clicks]='" + item.Clicks + "'" +
                            " WHERE id=" + item.ID;
            int res = DbHelperSQLite.ExecuteSql(sqlstr);

            return(res > 0);
        }
Пример #5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(UcGnglEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update uc_gngl set ");

            strSql.Append(" ZJ = @ZJ , ");
            strSql.Append(" F_FJDZJ = @F_FJDZJ , ");
            strSql.Append(" JDMC = @JDMC , ");
            strSql.Append(" JDSX = @JDSX , ");
            strSql.Append(" JDPX = @JDPX , ");
            strSql.Append(" GNLX = @GNLX , ");
            strSql.Append(" CJR = @CJR , ");
            strSql.Append(" CJSJ = @CJSJ , ");
            strSql.Append(" BZ = @BZ , ");
            strSql.Append(" QYBZ = @QYBZ  ");
            strSql.Append(" where ZJ=@ZJ  ");

            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@ZJ",      DbType.String),
                new SQLiteParameter("@F_FJDZJ", DbType.String),
                new SQLiteParameter("@JDMC",    DbType.String),
                new SQLiteParameter("@JDSX",    DbType.String),
                new SQLiteParameter("@JDPX",    DbType.Int32,   8),
                new SQLiteParameter("@GNLX",    DbType.Int32,   8),
                new SQLiteParameter("@CJR",     DbType.String),
                new SQLiteParameter("@CJSJ",    DbType.String),
                new SQLiteParameter("@BZ",      DbType.String),
                new SQLiteParameter("@QYBZ",    DbType.Int32,   8),
                new SQLiteParameter("@VipType", DbType.String),
            };

            parameters[0].Value  = model.ZJ;
            parameters[1].Value  = model.F_FJDZJ;
            parameters[2].Value  = model.JDMC;
            parameters[3].Value  = model.JDSX;
            parameters[4].Value  = model.JDPX;
            parameters[5].Value  = model.GNLX;
            parameters[6].Value  = model.CJR;
            parameters[7].Value  = model.CJSJ;
            parameters[8].Value  = model.BZ;
            parameters[9].Value  = model.QYBZ;
            parameters[10].Value = model.VipType;
            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Bsam.Core.Model.Models.Model.Inv_Loc model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Inv_Loc(");
            strSql.Append("Id,LocCode,LocName,LocDesc,LocStatus,LocOrder,Volume,VolumeUnit,DateTimeCreated,UserCreator,DateTimeModified,UserModified,State,OrgId,DistrictId,InvId)");
            strSql.Append(" values (");
            strSql.Append("@Id,@LocCode,@LocName,@LocDesc,@LocStatus,@LocOrder,@Volume,@VolumeUnit,@DateTimeCreated,@UserCreator,@DateTimeModified,@UserModified,@State,@OrgId,@DistrictId,@InvId)");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",               DbType.Int32,  8),
                new SQLiteParameter("@LocCode",          DbType.String, 0),
                new SQLiteParameter("@LocName",          DbType.String, 0),
                new SQLiteParameter("@LocDesc",          DbType.String, 0),
                new SQLiteParameter("@LocStatus",        DbType.String, 0),
                new SQLiteParameter("@LocOrder",         DbType.Int32,  4),
                new SQLiteParameter("@Volume",           DbType.Int32,  4),
                new SQLiteParameter("@VolumeUnit",       DbType.String, 0),
                new SQLiteParameter("@DateTimeCreated",  DbType.Date),
                new SQLiteParameter("@UserCreator",      DbType.String, 0),
                new SQLiteParameter("@DateTimeModified", DbType.Date),
                new SQLiteParameter("@UserModified",     DbType.String, 0),
                new SQLiteParameter("@State",            DbType.bit,    1),
                new SQLiteParameter("@OrgId",            DbType.String, 0),
                new SQLiteParameter("@DistrictId",       DbType.Int32,  4),
                new SQLiteParameter("@InvId",            DbType.Int32, 4)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.LocCode;
            parameters[2].Value  = model.LocName;
            parameters[3].Value  = model.LocDesc;
            parameters[4].Value  = model.LocStatus;
            parameters[5].Value  = model.LocOrder;
            parameters[6].Value  = model.Volume;
            parameters[7].Value  = model.VolumeUnit;
            parameters[8].Value  = model.DateTimeCreated;
            parameters[9].Value  = model.UserCreator;
            parameters[10].Value = model.DateTimeModified;
            parameters[11].Value = model.UserModified;
            parameters[12].Value = model.State;
            parameters[13].Value = model.OrgId;
            parameters[14].Value = model.DistrictId;
            parameters[15].Value = model.InvId;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #7
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Bsam.Core.Model.Models.Model.Sfc_Customer model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Sfc_Customer(");
            strSql.Append("Id,CustomerCode,CustomerName,CustomerShortName,CustomerPhone,CustomerWebchat,EnterpriseName,EnterpriseLegal,EnterpriseAddress,EnterprisePhone,DateTimeCreated,UserCreator,DateTimeModified,UserModified,State,OrgId)");
            strSql.Append(" values (");
            strSql.Append("@Id,@CustomerCode,@CustomerName,@CustomerShortName,@CustomerPhone,@CustomerWebchat,@EnterpriseName,@EnterpriseLegal,@EnterpriseAddress,@EnterprisePhone,@DateTimeCreated,@UserCreator,@DateTimeModified,@UserModified,@State,@OrgId)");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",                DbType.Int32,  8),
                new SQLiteParameter("@CustomerCode",      DbType.String, 0),
                new SQLiteParameter("@CustomerName",      DbType.String, 0),
                new SQLiteParameter("@CustomerShortName", DbType.String, 0),
                new SQLiteParameter("@CustomerPhone",     DbType.String, 0),
                new SQLiteParameter("@CustomerWebchat",   DbType.String, 0),
                new SQLiteParameter("@EnterpriseName",    DbType.String, 0),
                new SQLiteParameter("@EnterpriseLegal",   DbType.String, 0),
                new SQLiteParameter("@EnterpriseAddress", DbType.String, 0),
                new SQLiteParameter("@EnterprisePhone",   DbType.String, 0),
                new SQLiteParameter("@DateTimeCreated",   DbType.Date),
                new SQLiteParameter("@UserCreator",       DbType.String, 0),
                new SQLiteParameter("@DateTimeModified",  DbType.Date),
                new SQLiteParameter("@UserModified",      DbType.String, 0),
                new SQLiteParameter("@State",             DbType.bit,    1),
                new SQLiteParameter("@OrgId",             DbType.String, 0)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.CustomerCode;
            parameters[2].Value  = model.CustomerName;
            parameters[3].Value  = model.CustomerShortName;
            parameters[4].Value  = model.CustomerPhone;
            parameters[5].Value  = model.CustomerWebchat;
            parameters[6].Value  = model.EnterpriseName;
            parameters[7].Value  = model.EnterpriseLegal;
            parameters[8].Value  = model.EnterpriseAddress;
            parameters[9].Value  = model.EnterprisePhone;
            parameters[10].Value = model.DateTimeCreated;
            parameters[11].Value = model.UserCreator;
            parameters[12].Value = model.DateTimeModified;
            parameters[13].Value = model.UserModified;
            parameters[14].Value = model.State;
            parameters[15].Value = model.OrgId;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #8
0
        public void Insert()
        {
            string strGUID  = Guid.NewGuid().ToString();
            string userName = "******";
            string passWord = "******";
            string strSql   = $"insert into UserInfo (UserID,UserName,PassWord )values ( {strGUID},{userName},{passWord})";

            DbHelperSQLite.ExecuteSql(strSql);
            // strSql = $"select *  from  UserInfo";
            //  var date=  DbHelperSQLite.Query(strSql);
        }
Пример #9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.Sfc_Production model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Sfc_Production set ");
            strSql.Append("Id=@Id,");
            strSql.Append("ProductCode=@ProductCode,");
            strSql.Append("ProductName=@ProductName,");
            strSql.Append("ProductDesc=@ProductDesc,");
            strSql.Append("ModelType=@ModelType,");
            strSql.Append("DateTimeCreated=@DateTimeCreated,");
            strSql.Append("UserCreator=@UserCreator,");
            strSql.Append("DateTimeModified=@DateTimeModified,");
            strSql.Append("UserModified=@UserModified,");
            strSql.Append("State=@State,");
            strSql.Append("OrgId=@OrgId");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",               DbType.Int32,  8),
                new SQLiteParameter("@ProductCode",      DbType.String, 0),
                new SQLiteParameter("@ProductName",      DbType.String, 0),
                new SQLiteParameter("@ProductDesc",      DbType.String, 0),
                new SQLiteParameter("@ModelType",        DbType.String, 0),
                new SQLiteParameter("@DateTimeCreated",  DbType.Date),
                new SQLiteParameter("@UserCreator",      DbType.String, 0),
                new SQLiteParameter("@DateTimeModified", DbType.Date),
                new SQLiteParameter("@UserModified",     DbType.String, 0),
                new SQLiteParameter("@State",            DbType.bit,    1),
                new SQLiteParameter("@OrgId",            DbType.String, 0)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.ProductCode;
            parameters[2].Value  = model.ProductName;
            parameters[3].Value  = model.ProductDesc;
            parameters[4].Value  = model.ModelType;
            parameters[5].Value  = model.DateTimeCreated;
            parameters[6].Value  = model.UserCreator;
            parameters[7].Value  = model.DateTimeModified;
            parameters[8].Value  = model.UserModified;
            parameters[9].Value  = model.State;
            parameters[10].Value = model.OrgId;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #10
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.Sys_User model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Sys_User set ");
            strSql.Append("Id=@Id,");
            strSql.Append("UserName=@UserName,");
            strSql.Append("UserAccount=@UserAccount,");
            strSql.Append("UserPwd=@UserPwd,");
            strSql.Append("Address=@Address,");
            strSql.Append("Phone=@Phone,");
            strSql.Append("DateTimeCreated=@DateTimeCreated,");
            strSql.Append("UserCreator=@UserCreator,");
            strSql.Append("DateTimeModified=@DateTimeModified,");
            strSql.Append("UserModified=@UserModified,");
            strSql.Append("State=@State");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",               DbType.Int32,  4),
                new SQLiteParameter("@UserName",         DbType.String, 0),
                new SQLiteParameter("@UserAccount",      DbType.String, 0),
                new SQLiteParameter("@UserPwd",          DbType.String, 0),
                new SQLiteParameter("@Address",          DbType.String, 0),
                new SQLiteParameter("@Phone",            DbType.String, 0),
                new SQLiteParameter("@DateTimeCreated",  DbType.Date),
                new SQLiteParameter("@UserCreator",      DbType.String, 0),
                new SQLiteParameter("@DateTimeModified", DbType.Date),
                new SQLiteParameter("@UserModified",     DbType.String, 0),
                new SQLiteParameter("@State",            DbType.bit, 1)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.UserName;
            parameters[2].Value  = model.UserAccount;
            parameters[3].Value  = model.UserPwd;
            parameters[4].Value  = model.Address;
            parameters[5].Value  = model.Phone;
            parameters[6].Value  = model.DateTimeCreated;
            parameters[7].Value  = model.UserCreator;
            parameters[8].Value  = model.DateTimeModified;
            parameters[9].Value  = model.UserModified;
            parameters[10].Value = model.State;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #11
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ERPWPF.Model.DingdanDetail model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update DingdanDetail set ");
            strSql.Append("Gid=@Gid,");
            strSql.Append("Tid=@Tid,");
            strSql.Append("GCode=@GCode,");
            strSql.Append("GName=@GName,");
            strSql.Append("GGuige=@GGuige,");
            strSql.Append("GShuliang=@GShuliang,");
            strSql.Append("GJinjia=@GJinjia,");
            strSql.Append("GShoujia=@GShoujia,");
            strSql.Append("GZhekou=@GZhekou,");
            strSql.Append("GYouhui=@GYouhui,");
            strSql.Append("GHeji=@GHeji");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Gid",       DbType.Int32,   8),
                new SQLiteParameter("@Tid",       DbType.Int32,   8),
                new SQLiteParameter("@GCode",     DbType.String),
                new SQLiteParameter("@GName",     DbType.String),
                new SQLiteParameter("@GGuige",    DbType.String),
                new SQLiteParameter("@GShuliang", DbType.String),
                new SQLiteParameter("@GJinjia",   DbType.String),
                new SQLiteParameter("@GShoujia",  DbType.String),
                new SQLiteParameter("@GZhekou",   DbType.String),
                new SQLiteParameter("@GYouhui",   DbType.String),
                new SQLiteParameter("@GHeji",     DbType.String)
            };
            parameters[0].Value  = model.Gid;
            parameters[1].Value  = model.Tid;
            parameters[2].Value  = model.GCode;
            parameters[3].Value  = model.GName;
            parameters[4].Value  = model.GGuige;
            parameters[5].Value  = model.GShuliang;
            parameters[6].Value  = model.GJinjia;
            parameters[7].Value  = model.GShoujia;
            parameters[8].Value  = model.GZhekou;
            parameters[9].Value  = model.GYouhui;
            parameters[10].Value = model.GHeji;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #12
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.Sys_Permission model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Sys_Permission set ");
            strSql.Append("Id=@Id,");
            strSql.Append("PermissionName=@PermissionName,");
            strSql.Append("PermissionDesc=@PermissionDesc,");
            strSql.Append("RequestType=@RequestType,");
            strSql.Append("ClientType=@ClientType,");
            strSql.Append("ModuleId=@ModuleId,");
            strSql.Append("DateTimeCreated=@DateTimeCreated,");
            strSql.Append("UserCreator=@UserCreator,");
            strSql.Append("DateTimeModified=@DateTimeModified,");
            strSql.Append("UserModified=@UserModified,");
            strSql.Append("State=@State");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",               DbType.Int32,  4),
                new SQLiteParameter("@PermissionName",   DbType.String, 0),
                new SQLiteParameter("@PermissionDesc",   DbType.String, 0),
                new SQLiteParameter("@RequestType",      DbType.String, 0),
                new SQLiteParameter("@ClientType",       DbType.String, 0),
                new SQLiteParameter("@ModuleId",         DbType.Int32,  4),
                new SQLiteParameter("@DateTimeCreated",  DbType.Date),
                new SQLiteParameter("@UserCreator",      DbType.String, 0),
                new SQLiteParameter("@DateTimeModified", DbType.Date),
                new SQLiteParameter("@UserModified",     DbType.String, 0),
                new SQLiteParameter("@State",            DbType.bit, 1)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.PermissionName;
            parameters[2].Value  = model.PermissionDesc;
            parameters[3].Value  = model.RequestType;
            parameters[4].Value  = model.ClientType;
            parameters[5].Value  = model.ModuleId;
            parameters[6].Value  = model.DateTimeCreated;
            parameters[7].Value  = model.UserCreator;
            parameters[8].Value  = model.DateTimeModified;
            parameters[9].Value  = model.UserModified;
            parameters[10].Value = model.State;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #13
0
        public int Delete(string tablename, string strWhere)
        {
            string sql = string.Format("delete from {0} ", tablename);

            if (!string.IsNullOrEmpty(strWhere))
            {
                sql += " where " + strWhere;
            }
            sql = StringHelper.ReplaceBadSQL(sql);
            return(DbHelperSQLite.ExecuteSql(sql));
        }
Пример #14
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.Inv_Rcv_Bill_Dtl model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Inv_Rcv_Bill_Dtl set ");
            strSql.Append("Id=@Id,");
            strSql.Append("BillId=@BillId,");
            strSql.Append("MitemCode=@MitemCode,");
            strSql.Append("PlanQty=@PlanQty,");
            strSql.Append("ActualQty=@ActualQty,");
            strSql.Append("DateTimeCreated=@DateTimeCreated,");
            strSql.Append("UserCreator=@UserCreator,");
            strSql.Append("DateTimeModified=@DateTimeModified,");
            strSql.Append("UserModified=@UserModified,");
            strSql.Append("State=@State,");
            strSql.Append("OrgId=@OrgId");
            strSql.Append(" where ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@Id",               DbType.Int32,   4),
                new SQLiteParameter("@BillId",           DbType.Int32,   4),
                new SQLiteParameter("@MitemCode",        DbType.String,  0),
                new SQLiteParameter("@PlanQty",          DbType.Decimal, 8),
                new SQLiteParameter("@ActualQty",        DbType.Decimal, 8),
                new SQLiteParameter("@DateTimeCreated",  DbType.Date),
                new SQLiteParameter("@UserCreator",      DbType.String,  0),
                new SQLiteParameter("@DateTimeModified", DbType.Date),
                new SQLiteParameter("@UserModified",     DbType.String,  0),
                new SQLiteParameter("@State",            DbType.bit,     1),
                new SQLiteParameter("@OrgId",            DbType.String, 0)
            };
            parameters[0].Value  = model.Id;
            parameters[1].Value  = model.BillId;
            parameters[2].Value  = model.MitemCode;
            parameters[3].Value  = model.PlanQty;
            parameters[4].Value  = model.ActualQty;
            parameters[5].Value  = model.DateTimeCreated;
            parameters[6].Value  = model.UserCreator;
            parameters[7].Value  = model.DateTimeModified;
            parameters[8].Value  = model.UserModified;
            parameters[9].Value  = model.State;
            parameters[10].Value = model.OrgId;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #15
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.RoleModulePermission model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update RoleModulePermission set ");
            strSql.Append("IsDeleted=@IsDeleted,");
            strSql.Append("RoleId=@RoleId,");
            strSql.Append("ModuleId=@ModuleId,");
            strSql.Append("PermissionId=@PermissionId,");
            strSql.Append("CreateId=@CreateId,");
            strSql.Append("CreateBy=@CreateBy,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("ModifyId=@ModifyId,");
            strSql.Append("ModifyBy=@ModifyBy,");
            strSql.Append("ModifyTime=@ModifyTime");
            strSql.Append(" where Id=@Id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@IsDeleted",    DbType.bit,       1),
                new SQLiteParameter("@RoleId",       DbType.Int32,     8),
                new SQLiteParameter("@ModuleId",     DbType.Int32,     8),
                new SQLiteParameter("@PermissionId", DbType.Int32,     8),
                new SQLiteParameter("@CreateId",     DbType.Int32,     8),
                new SQLiteParameter("@CreateBy",     DbType.String),
                new SQLiteParameter("@CreateTime",   DbType.DateTime),
                new SQLiteParameter("@ModifyId",     DbType.Int32,     8),
                new SQLiteParameter("@ModifyBy",     DbType.String),
                new SQLiteParameter("@ModifyTime",   DbType.DateTime),
                new SQLiteParameter("@Id",           DbType.Int32, 8)
            };
            parameters[0].Value  = model.IsDeleted;
            parameters[1].Value  = model.RoleId;
            parameters[2].Value  = model.ModuleId;
            parameters[3].Value  = model.PermissionId;
            parameters[4].Value  = model.CreateId;
            parameters[5].Value  = model.CreateBy;
            parameters[6].Value  = model.CreateTime;
            parameters[7].Value  = model.ModifyId;
            parameters[8].Value  = model.ModifyBy;
            parameters[9].Value  = model.ModifyTime;
            parameters[10].Value = model.Id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #16
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Scada.Model.IO_SERVER model)
        {
            model.SERVER_STATUS = 0;
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            if (model.SERVER_ID != null)
            {
                strSql1.Append("SERVER_ID,");
                strSql2.Append("'" + model.SERVER_ID + "',");
            }
            if (model.SERVER_NAME != null)
            {
                strSql1.Append("SERVER_NAME,");
                strSql2.Append("'" + model.SERVER_NAME + "',");
            }

            strSql1.Append("SERVER_STATUS,");
            strSql2.Append("" + model.SERVER_STATUS + ",");

            if (model.SERVER_IP != null)
            {
                strSql1.Append("SERVER_IP,");
                strSql2.Append("'" + model.SERVER_IP + "',");
            }
            if (model.SERVER_CREATEDATE != null)
            {
                strSql1.Append("SERVER_CREATEDATE,");
                strSql2.Append("'" + model.SERVER_CREATEDATE + "',");
            }
            if (model.SERVER_REMARK != null)
            {
                strSql1.Append("SERVER_REMARK,");
                strSql2.Append("'" + model.SERVER_REMARK + "',");
            }
            strSql.Append("insert into IO_SERVER(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #17
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(FriendshipMngSys.Model.DBScoreDetail model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ScoreDetail set ");
            strSql.Append("PersonID=@PersonID,");
            strSql.Append("课时费高=@课时费高,");
            strSql.Append("学生多=@学生多,");
            strSql.Append("已备案=@已备案,");
            strSql.Append("已买教学琴=@已买教学琴,");
            strSql.Append("参加比赛=@参加比赛,");
            strSql.Append("参加多钢琴=@参加多钢琴,");
            strSql.Append("租场=@租场,");
            strSql.Append("成交=@成交,");
            strSql.Append("调律=@调律");
            strSql.Append(" where ID=@ID ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@PersonID", DbType.String, 2147483647),
                new SQLiteParameter("@课时费高",     DbType.Int32,           4),
                new SQLiteParameter("@学生多",      DbType.Int32,           4),
                new SQLiteParameter("@已备案",      DbType.Int32,           4),
                new SQLiteParameter("@已买教学琴",    DbType.Int32,           4),
                new SQLiteParameter("@参加比赛",     DbType.Int32,           4),
                new SQLiteParameter("@参加多钢琴",    DbType.Int32,           4),
                new SQLiteParameter("@租场",       DbType.Int32,           4),
                new SQLiteParameter("@成交",       DbType.Int32,           4),
                new SQLiteParameter("@调律",       DbType.Int32,           4),
                new SQLiteParameter("@ID",       DbType.String, 2147483647)
            };
            parameters[0].Value  = model.PersonID;
            parameters[1].Value  = model.课时费高;
            parameters[2].Value  = model.学生多;
            parameters[3].Value  = model.已备案;
            parameters[4].Value  = model.已买教学琴;
            parameters[5].Value  = model.参加比赛;
            parameters[6].Value  = model.参加多钢琴;
            parameters[7].Value  = model.租场;
            parameters[8].Value  = model.成交;
            parameters[9].Value  = model.调律;
            parameters[10].Value = model.ID;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #18
0
        public void AddFormParas(int formID, string tablename, string columnname)
        {
            string sql = string.Format("select 1 from FormParas where (formID={0} and tablename='{1}' and columnname='{2}')", formID, tablename, columnname);

            sql = StringHelper.ReplaceBadSQL(sql);
            if (DbHelperSQLite.GetSingle(sql) == null)
            {
                string sql1 = string.Format("insert into FormParas(formId,[tablename],columnname,paraId,para_name,[datatype],[maxlength],[width]) values({0},'{1}','{2}','{2}','{2}','text',50,50)", formID, tablename, columnname);
                sql1 = StringHelper.ReplaceBadSQL(sql1);
                DbHelperSQLite.ExecuteSql(sql1);
            }
        }
Пример #19
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Bsam.Core.Model.Models.Model.BlogArticle model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update BlogArticle set ");
            strSql.Append("bsubmitter=@bsubmitter,");
            strSql.Append("btitle=@btitle,");
            strSql.Append("bcategory=@bcategory,");
            strSql.Append("bcontent=@bcontent,");
            strSql.Append("btraffic=@btraffic,");
            strSql.Append("bcommentNum=@bcommentNum,");
            strSql.Append("bUpdateTime=@bUpdateTime,");
            strSql.Append("bCreateTime=@bCreateTime,");
            strSql.Append("bRemark=@bRemark,");
            strSql.Append("IsDeleted=@IsDeleted");
            strSql.Append(" where bID=@bID");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@bsubmitter",  DbType.String),
                new SQLiteParameter("@btitle",      DbType.String),
                new SQLiteParameter("@bcategory",   DbType.String),
                new SQLiteParameter("@bcontent",    DbType.String),
                new SQLiteParameter("@btraffic",    DbType.Int32,     8),
                new SQLiteParameter("@bcommentNum", DbType.Int32,     8),
                new SQLiteParameter("@bUpdateTime", DbType.DateTime),
                new SQLiteParameter("@bCreateTime", DbType.DateTime),
                new SQLiteParameter("@bRemark",     DbType.String),
                new SQLiteParameter("@IsDeleted",   DbType.bit,       1),
                new SQLiteParameter("@bID",         DbType.Int32, 8)
            };
            parameters[0].Value  = model.bsubmitter;
            parameters[1].Value  = model.btitle;
            parameters[2].Value  = model.bcategory;
            parameters[3].Value  = model.bcontent;
            parameters[4].Value  = model.btraffic;
            parameters[5].Value  = model.bcommentNum;
            parameters[6].Value  = model.bUpdateTime;
            parameters[7].Value  = model.bCreateTime;
            parameters[8].Value  = model.bRemark;
            parameters[9].Value  = model.IsDeleted;
            parameters[10].Value = model.bID;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #20
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(KryptonAccessController.SQLite.Model.InteractRelation.AntiPassBack model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update AntiPassBack set ");
            strSql.Append("AntiPassBackMode=@AntiPassBackMode,");
            strSql.Append("AntiPassEnable=@AntiPassEnable,");
            strSql.Append("ControlerInfoInLANID1=@ControlerInfoInLANID1,");
            strSql.Append("DoorUnitID1=@DoorUnitID1,");
            strSql.Append("ControlerInfoInLANID2=@ControlerInfoInLANID2,");
            strSql.Append("DoorUnitID2=@DoorUnitID2,");
            strSql.Append("ControlerInfoInLANID3=@ControlerInfoInLANID3,");
            strSql.Append("DoorUnitID3=@DoorUnitID3,");
            strSql.Append("ControlerInfoInLANID4=@ControlerInfoInLANID4,");
            strSql.Append("DoorUnitID4=@DoorUnitID4");
            strSql.Append(" where AntiPassBackID=@AntiPassBackID ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@AntiPassBackMode",      DbType.Int32,   4),
                new SQLiteParameter("@AntiPassEnable",        DbType.Boolean, 1),
                new SQLiteParameter("@ControlerInfoInLANID1", DbType.Int32,   4),
                new SQLiteParameter("@DoorUnitID1",           DbType.Int32,   4),
                new SQLiteParameter("@ControlerInfoInLANID2", DbType.Int32,   4),
                new SQLiteParameter("@DoorUnitID2",           DbType.Int32,   4),
                new SQLiteParameter("@ControlerInfoInLANID3", DbType.Int32,   4),
                new SQLiteParameter("@DoorUnitID3",           DbType.Int32,   4),
                new SQLiteParameter("@ControlerInfoInLANID4", DbType.Int32,   4),
                new SQLiteParameter("@DoorUnitID4",           DbType.Int32,   4),
                new SQLiteParameter("@AntiPassBackID",        DbType.Int32, 4)
            };
            parameters[0].Value  = model.AntiPassBackMode;
            parameters[1].Value  = model.AntiPassEnable;
            parameters[2].Value  = model.ControlerInfoInLANID1;
            parameters[3].Value  = model.DoorUnitID1;
            parameters[4].Value  = model.ControlerInfoInLANID2;
            parameters[5].Value  = model.DoorUnitID2;
            parameters[6].Value  = model.ControlerInfoInLANID3;
            parameters[7].Value  = model.DoorUnitID3;
            parameters[8].Value  = model.ControlerInfoInLANID4;
            parameters[9].Value  = model.DoorUnitID4;
            parameters[10].Value = model.AntiPassBackID;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(KryptonAccessController.SQLite.Model.ControllerRelation.AuxiliaryUnit model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into AuxiliaryUnit(");
            strSql.Append("AuxiliaryUnitID,AuxOutPutPointID,InputStateType,FireSensingID,FireSensingMode,FireSensingEnable,TamperSensingID,TamperSensingMode,TamperSensingEnable,LowVoltageID,LowVoltageMode,LowVoltageEnable,PowerOutageID,PowerOutageMode,PowerOutageEnable)");
            strSql.Append(" values (");
            strSql.Append("@AuxiliaryUnitID,@AuxOutPutPointID,@InputStateType,@FireSensingID,@FireSensingMode,@FireSensingEnable,@TamperSensingID,@TamperSensingMode,@TamperSensingEnable,@LowVoltageID,@LowVoltageMode,@LowVoltageEnable,@PowerOutageID,@PowerOutageMode,@PowerOutageEnable)");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@AuxiliaryUnitID",     DbType.Int32,   4),
                new SQLiteParameter("@AuxOutPutPointID",    DbType.Int32,   4),
                new SQLiteParameter("@InputStateType",      DbType.Int32,   4),
                new SQLiteParameter("@FireSensingID",       DbType.Int32,   4),
                new SQLiteParameter("@FireSensingMode",     DbType.Int32,   4),
                new SQLiteParameter("@FireSensingEnable",   DbType.Boolean, 1),
                new SQLiteParameter("@TamperSensingID",     DbType.Int32,   4),
                new SQLiteParameter("@TamperSensingMode",   DbType.Int32,   4),
                new SQLiteParameter("@TamperSensingEnable", DbType.Boolean, 1),
                new SQLiteParameter("@LowVoltageID",        DbType.Int32,   4),
                new SQLiteParameter("@LowVoltageMode",      DbType.Int32,   4),
                new SQLiteParameter("@LowVoltageEnable",    DbType.Boolean, 1),
                new SQLiteParameter("@PowerOutageID",       DbType.Int32,   4),
                new SQLiteParameter("@PowerOutageMode",     DbType.Int32,   4),
                new SQLiteParameter("@PowerOutageEnable",   DbType.Boolean, 1)
            };
            parameters[0].Value  = model.AuxiliaryUnitID;
            parameters[1].Value  = model.AuxOutPutPointID;
            parameters[2].Value  = model.InputStateType;
            parameters[3].Value  = model.FireSensingID;
            parameters[4].Value  = model.FireSensingMode;
            parameters[5].Value  = model.FireSensingEnable;
            parameters[6].Value  = model.TamperSensingID;
            parameters[7].Value  = model.TamperSensingMode;
            parameters[8].Value  = model.TamperSensingEnable;
            parameters[9].Value  = model.LowVoltageID;
            parameters[10].Value = model.LowVoltageMode;
            parameters[11].Value = model.LowVoltageEnable;
            parameters[12].Value = model.PowerOutageID;
            parameters[13].Value = model.PowerOutageMode;
            parameters[14].Value = model.PowerOutageEnable;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #22
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DXD.Model.security_feedback model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update security_feedback set ");
            strSql.Append("query_id=@query_id,");
            strSql.Append("query_date=@query_date,");
            strSql.Append("sec_type=@sec_type,");
            strSql.Append("sec_account=@sec_account,");
            strSql.Append("sec_code=@sec_code,");
            strSql.Append("sec_name=@sec_name,");
            strSql.Append("sec_number=@sec_number,");
            strSql.Append("sec_value=@sec_value,");
            strSql.Append("add_user=@add_user,");
            strSql.Append("add_time=@add_time");
            strSql.Append(" where id=@id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",    DbType.Int32,      8),
                new SQLiteParameter("@query_date",  DbType.DateTime),
                new SQLiteParameter("@sec_type",    DbType.char,       2),
                new SQLiteParameter("@sec_account", DbType.String,    50),
                new SQLiteParameter("@sec_code",    DbType.char,      10),
                new SQLiteParameter("@sec_name",    DbType.String,    50),
                new SQLiteParameter("@sec_number",  DbType.Decimal,    4),
                new SQLiteParameter("@sec_value",   DbType.Decimal,    4),
                new SQLiteParameter("@add_user",    DbType.String,    50),
                new SQLiteParameter("@add_time",    DbType.DateTime),
                new SQLiteParameter("@id",          DbType.Int32, 8)
            };
            parameters[0].Value  = model.query_id;
            parameters[1].Value  = model.query_date;
            parameters[2].Value  = model.sec_type;
            parameters[3].Value  = model.sec_account;
            parameters[4].Value  = model.sec_code;
            parameters[5].Value  = model.sec_name;
            parameters[6].Value  = model.sec_number;
            parameters[7].Value  = model.sec_value;
            parameters[8].Value  = model.add_user;
            parameters[9].Value  = model.add_time;
            parameters[10].Value = model.id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #23
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(JC.Model.modules model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update modules set ");
            strSql.Append("parentid=@parentid,");
            strSql.Append("title=@title,");
            strSql.Append("content=@content,");
            strSql.Append("url=@url,");
            strSql.Append("blank=@blank,");
            strSql.Append("pic=@pic,");
            strSql.Append("path=@path,");
            strSql.Append("stem=@stem,");
            strSql.Append("haschild=@haschild,");
            strSql.Append("orderby=@orderby");
            strSql.Append(" where id=@id ");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@parentid", DbType.Int32,   8),
                new SQLiteParameter("@title",    DbType.String),
                new SQLiteParameter("@content",  DbType.String),
                new SQLiteParameter("@url",      DbType.String),
                new SQLiteParameter("@blank",    DbType.Int32,   8),
                new SQLiteParameter("@pic",      DbType.String),
                new SQLiteParameter("@path",     DbType.String),
                new SQLiteParameter("@stem",     DbType.Int32,   8),
                new SQLiteParameter("@haschild", DbType.Int32,   8),
                new SQLiteParameter("@orderby",  DbType.Int32,   8),
                new SQLiteParameter("@id",       DbType.Int32, 8)
            };
            parameters[0].Value  = model.parentid;
            parameters[1].Value  = model.title;
            parameters[2].Value  = model.content;
            parameters[3].Value  = model.url;
            parameters[4].Value  = model.blank;
            parameters[5].Value  = model.pic;
            parameters[6].Value  = model.path;
            parameters[7].Value  = model.stem;
            parameters[8].Value  = model.haschild;
            parameters[9].Value  = model.orderby;
            parameters[10].Value = model.id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #24
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Scada.Model.DeviceGroup model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update DeviceGroup set ");
            if (model.GroupId != null)
            {
                strSql.Append("GroupId=" + model.GroupId + ",");
            }
            else
            {
                strSql.Append("GroupId= null ,");
            }
            if (model.IO_SERVER_ID != null)
            {
                strSql.Append("IO_SERVER_ID=" + model.IO_SERVER_ID + ",");
            }
            else
            {
                strSql.Append("IO_SERVER_ID= null ,");
            }
            if (model.IO_COMM_ID != null)
            {
                strSql.Append("IO_COMM_ID=" + model.IO_COMM_ID + ",");
            }
            else
            {
                strSql.Append("IO_COMM_ID= null ,");
            }
            if (model.IO_DEVICE_ID != null)
            {
                strSql.Append("IO_DEVICE_ID=" + model.IO_DEVICE_ID + ",");
            }
            else
            {
                strSql.Append("IO_DEVICE_ID= null ,");
            }
            int n = strSql.ToString().LastIndexOf(",");

            strSql.Remove(n, 1);
            strSql.Append(" where Id=" + model.Id + "");
            int rowsAffected = DbHelperSQLite.ExecuteSql(strSql.ToString());

            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #25
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update()
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update [S_TreeClass] set ");
            strSql.Append("ClassName='" + ClassName + "',");
            strSql.Append("ParentID=" + ParentID + ",");
            strSql.Append("ClassCode='" + ClassCode + "',");
            strSql.Append("ReadMe='" + ReadMe + "',");
            strSql.Append("UpdateTime='" + UpdateTime + "'");
            strSql.Append(" where ClassID=" + ClassID + "");
            DbHelperSQLite.ExecuteSql(strSql.ToString());
        }
Пример #26
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(KryptonAccessController.SQLite.Model.UserRelation.UserInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into UserInfo(");
            strSql.Append("UserID,UserName,Photograph,UserGroupID1,UserGroupID2,UserGroupID3,UserGroupID4,FingerPosition0,FingerPrint0,FingerPosition1,FingerPrint1,SercurityAccessLevel,PrimaryCardID,SecondCardID)");
            strSql.Append(" values (");
            strSql.Append("@UserID,@UserName,@Photograph,@UserGroupID1,@UserGroupID2,@UserGroupID3,@UserGroupID4,@FingerPosition0,@FingerPrint0,@FingerPosition1,@FingerPrint1,@SercurityAccessLevel,@PrimaryCardID,@SecondCardID)");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@UserID",               DbType.Int32,   4),
                new SQLiteParameter("@UserName",             DbType.String),
                new SQLiteParameter("@Photograph",           DbType.Binary),
                new SQLiteParameter("@UserGroupID1",         DbType.Int32,   4),
                new SQLiteParameter("@UserGroupID2",         DbType.Int32,   4),
                new SQLiteParameter("@UserGroupID3",         DbType.Int32,   4),
                new SQLiteParameter("@UserGroupID4",         DbType.Int32,   4),
                new SQLiteParameter("@FingerPosition0",      DbType.Int32,   4),
                new SQLiteParameter("@FingerPrint0",         DbType.Binary),
                new SQLiteParameter("@FingerPosition1",      DbType.Int32,   4),
                new SQLiteParameter("@FingerPrint1",         DbType.Binary),
                new SQLiteParameter("@SercurityAccessLevel", DbType.Int32,   4),
                new SQLiteParameter("@PrimaryCardID",        DbType.String),
                new SQLiteParameter("@SecondCardID",         DbType.String)
            };
            parameters[0].Value  = model.UserID;
            parameters[1].Value  = model.UserName;
            parameters[2].Value  = model.Photograph;
            parameters[3].Value  = model.UserGroupID1;
            parameters[4].Value  = model.UserGroupID2;
            parameters[5].Value  = model.UserGroupID3;
            parameters[6].Value  = model.UserGroupID4;
            parameters[7].Value  = model.FingerPosition0;
            parameters[8].Value  = model.FingerPrint0;
            parameters[9].Value  = model.FingerPosition1;
            parameters[10].Value = model.FingerPrint1;
            parameters[11].Value = model.SercurityAccessLevel;
            parameters[12].Value = model.PrimaryCardID;
            parameters[13].Value = model.SecondCardID;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #27
0
        /*
         *      /// <summary>
         *      /// 分页获取数据列表
         *      /// </summary>
         *      public DataSet GetList(int PageSize,int PageIndex,string strWhere)
         *      {
         *              SQLiteParameter[] parameters = {
         *                              new SQLiteParameter("@tblName", DbType.VarChar, 255),
         *                              new SQLiteParameter("@fldName", DbType.VarChar, 255),
         *                              new SQLiteParameter("@PageSize", DbType.Int32),
         *                              new SQLiteParameter("@PageIndex", DbType.Int32),
         *                              new SQLiteParameter("@IsReCount", DbType.bit),
         *                              new SQLiteParameter("@OrderType", DbType.bit),
         *                              new SQLiteParameter("@strWhere", DbType.VarChar,1000),
         *                              };
         *              parameters[0].Value = "business_feedback";
         *              parameters[1].Value = "id";
         *              parameters[2].Value = PageSize;
         *              parameters[3].Value = PageIndex;
         *              parameters[4].Value = 0;
         *              parameters[5].Value = 0;
         *              parameters[6].Value = strWhere;
         *              return DbHelperSQLite.RunProcedure("UP_GetRecordByPage",parameters,"ds");
         *      }*/

        #endregion  BasicMethod
        #region  ExtensionMethod
        public bool UpdateAll(string strSet)
        {
            string strSql = string.Format("update business_feedback set {0}", strSet);
            int    rows   = DbHelperSQLite.ExecuteSql(strSql);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #28
0
        public bool UpdateStatus(int status, string serverid)
        {
            string sql          = "update IO_DEVICE set IO_DEVICE_STATUS=" + status + " where IO_SERVER_ID='" + serverid + "'";
            int    rowsAffected = DbHelperSQLite.ExecuteSql(sql.ToString());

            if (rowsAffected > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #29
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Blogs.Model.BlogUser model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update BlogUser set ");
            strSql.Append("loginname=@loginname,");
            strSql.Append("oginpwd=@oginpwd,");
            strSql.Append("cnname=@cnname,");
            strSql.Append("email=@email,");
            strSql.Append("islock=@islock,");
            strSql.Append("isdel=@isdel,");
            strSql.Append("addtime=@addtime,");
            strSql.Append("lastlogintime=@lastlogintime,");
            strSql.Append("lastloginip=@lastloginip");
            strSql.Append(" where id=@id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@loginname",     DbType.String),
                new SQLiteParameter("@oginpwd",       DbType.String),
                new SQLiteParameter("@cnname",        DbType.String),
                new SQLiteParameter("@email",         DbType.String),
                new SQLiteParameter("@islock",        DbType.bit,       1),
                new SQLiteParameter("@isdel",         DbType.bit,       1),
                new SQLiteParameter("@addtime",       DbType.DateTime),
                new SQLiteParameter("@lastlogintime", DbType.DateTime),
                new SQLiteParameter("@lastloginip",   DbType.String),
                new SQLiteParameter("@id",            DbType.Int32, 8)
            };
            parameters[0].Value = model.loginname;
            parameters[1].Value = model.oginpwd;
            parameters[2].Value = model.cnname;
            parameters[3].Value = model.email;
            parameters[4].Value = model.islock;
            parameters[5].Value = model.isdel;
            parameters[6].Value = model.addtime;
            parameters[7].Value = model.lastlogintime;
            parameters[8].Value = model.lastloginip;
            parameters[9].Value = model.id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #30
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(DXD.Model.insurance_report model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update insurance_report set ");
            strSql.Append("query_id=@query_id,");
            strSql.Append("query_date=@query_date,");
            strSql.Append("ins_name=@ins_name,");
            strSql.Append("ins_no=@ins_no,");
            strSql.Append("ins_company=@ins_company,");
            strSql.Append("ins_value=@ins_value,");
            strSql.Append("remark=@remark,");
            strSql.Append("add_user=@add_user,");
            strSql.Append("add_time=@add_time");
            strSql.Append(" where id=@id");
            SQLiteParameter[] parameters =
            {
                new SQLiteParameter("@query_id",    DbType.Int32,       8),
                new SQLiteParameter("@query_date",  DbType.DateTime),
                new SQLiteParameter("@ins_name",    DbType.String,    255),
                new SQLiteParameter("@ins_no",      DbType.String,     50),
                new SQLiteParameter("@ins_company", DbType.String,    200),
                new SQLiteParameter("@ins_value",   DbType.Decimal,     4),
                new SQLiteParameter("@remark",      DbType.String,    255),
                new SQLiteParameter("@add_user",    DbType.String,     50),
                new SQLiteParameter("@add_time",    DbType.DateTime),
                new SQLiteParameter("@id",          DbType.Int32, 8)
            };
            parameters[0].Value = model.query_id;
            parameters[1].Value = model.query_date;
            parameters[2].Value = model.ins_name;
            parameters[3].Value = model.ins_no;
            parameters[4].Value = model.ins_company;
            parameters[5].Value = model.ins_value;
            parameters[6].Value = model.remark;
            parameters[7].Value = model.add_user;
            parameters[8].Value = model.add_time;
            parameters[9].Value = model.id;

            int rows = DbHelperSQLite.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }