Example #1
0
        //屏蔽注册、登录时间 Edited By Liangsx 2011-01-24
        public bool Update(BasUser model)
        {
            bool blFlag;

            try
            {
                StringBuilder strb = new StringBuilder();
                strb.Append(" Update bas_user ");
                strb.Append(" Set ");
                strb.Append("orgid   = " + Hi.Common.Utils.IsNull(model.OrgId, "0") + ",");
                strb.Append("orgname = '" + model.OrgName + "',");
                strb.Append("usercode       = '" + model.UserCode + "',");
                //strb.Append("userpassword   = '******',");
                strb.Append("realname       = '" + model.RealName + "',");

                strb.Append("sex            = '" + model.Sex + "',");
                strb.Append("usertelephone  = '" + model.UserTelephone + "',");
                strb.Append("email          = '" + model.Email + "',");
                strb.Append("qq             = '" + model.Qq + "',");
                //strb.Append("regtime        = '" + model.Regtime + "',");
                strb.Append("address        = '" + model.Address + "',");
                strb.Append("IsLocked       = " + model.IsLocked + ",");
                //strb.Append("lastloginip    = '" + model.Lastloginip + "',");
                //strb.Append("logintimes     = " + model.Logintimes + ",");
                //strb.Append("lastlogintime  = '" + model.Lastlogintime + "',");
                strb.Append("remark         = '" + model.Remark + "'");
                strb.Append(" where userid = " + model.UserId.ToString());
                blFlag = DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(blFlag);
        }
Example #2
0
        public bool Add(Org model)
        {
            if (model == null)
            {
                return(false);
            }
            StringBuilder strb = new StringBuilder();

            strb.Append(" Insert Into bas_org ");
            strb.Append(" ( ");
            //strb.Append("id, ");
            strb.Append("org_name, ");
            strb.Append("link_name, ");
            strb.Append("link_tel, ");
            strb.Append("link_mobile ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("" + model.Id + ", ");
            strb.Append("'" + model.OrgName + "', ");
            strb.Append("'" + model.LinkName + "', ");
            strb.Append("'" + model.LinkTel + "', ");
            strb.Append("'" + model.LinkMobile + "' ");
            strb.Append(" )");

            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #3
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool ParamDelete(string id)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" delete from bas_param where id=" + id + " and enable_flag<>'2'");
            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool ParamAdd(BasParam model)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" Insert Into bas_param ");
            strb.Append(" ( ");
            //strb.Append("id, ");
            strb.Append("parent_id, ");
            strb.Append("grade, ");
            strb.Append("code, ");
            strb.Append("title, ");
            //strb.Append("enumvalue, ");
            strb.Append("remark, ");
            strb.Append("sort, ");
            strb.Append("enable_flag ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("" + model.Id + ", ");
            strb.Append("" + model.ParentId + ", ");
            strb.Append("'" + model.Grade + "', ");
            strb.Append("'" + model.Code + "', ");
            strb.Append("'" + model.Title + "', ");

            strb.Append("'" + model.Remark + "', ");
            strb.Append("'" + model.Sort + "', ");
            strb.Append("'" + model.EnableFlag + "' ");
            strb.Append(" )");


            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #5
0
        public bool Add(BasUser model)
        {
            if (model == null)
            {
                return(false);
            }
            StringBuilder strb = new StringBuilder();

            strb.Append(" Insert Into bas_user ");
            strb.Append(" ( ");
            //strb.Append("userid, ");//主键是自动增长列,请屏蔽赋值
            strb.Append("orgid, ");
            strb.Append("orgname,");
            strb.Append("usercode, ");
            strb.Append("userpassword, ");
            strb.Append("realname, ");

            strb.Append("sex, ");
            strb.Append("usertelephone, ");
            strb.Append("email, ");
            strb.Append("qq, ");
            strb.Append("regtime, ");
            strb.Append("address, ");
            strb.Append("islocked, ");
            // strb.Append("lastloginip, ");
            // strb.Append("logintimes, ");
            // strb.Append("lastlogintime, ");
            strb.Append("remark ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("'" + model.Userid + "', ");
            strb.Append("" + Hi.Common.Utils.IsNull(model.OrgId, "0") + ", ");
            strb.Append("'" + model.OrgName + "', ");
            strb.Append("'" + model.UserCode + "', ");
            strb.Append("'" + model.UserPassword + "', ");
            strb.Append("'" + model.RealName + "', ");

            strb.Append("'" + model.Sex + "', ");
            strb.Append("'" + model.UserTelephone + "', ");
            strb.Append("'" + model.Email + "', ");
            strb.Append("'" + model.Qq + "', ");
            strb.Append("'" + model.Regtime + "', ");
            strb.Append("'" + model.Address + "', ");
            strb.Append("" + model.IsLocked + ", ");
            //strb.Append("'" + model.Lastloginip + "', ");
            // strb.Append("" + model.Logintimes + ", ");
            // strb.Append("'" + model.Lastlogintime + "', ");
            strb.Append("'" + model.Remark + "' ");
            strb.Append(" )");
            try
            {
                return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
            }
            catch
            {
                return(false);
            }
        }
Example #6
0
 public int Add(BasLog model)
 {
     try
     {
         return(DataBase.ExecuteNonQuery(""));
     }
     catch
     {
         return(-1);
     }
 }
Example #7
0
 public bool AddRole(BasRole model)
 {
     try
     {
         int count = DataBase.ExecuteNonQuery("");
         return(count > -1 ? true : false);
     }
     catch
     {
         return(false);
     }
 }
Example #8
0
        public int DeleteBasLogSql(string id)
        {
            int    num = -1;
            string sql = "delete from bas_log_sql where id=" + id;

            try
            {
                num = DataBase.ExecuteNonQuery(sql);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num);
        }
Example #9
0
        public bool Update(Org model)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" Update bas_org ");
            strb.Append(" Set ");
            //strb.Append("id               = " + model.Id + ",");
            strb.Append("org_name  = '" + model.OrgName + "',");
            strb.Append("link_name        = '" + model.LinkName + "',");
            strb.Append("link_tel         = '" + model.LinkTel + "',");
            strb.Append("link_mobile      = '" + model.LinkMobile + "'");
            strb.Append(" where id = " + model.Id);

            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #10
0
        public bool UpdateRole(BasRole model)
        {
            bool blFlag = false;
            int  num;

            try
            {
                num = DataBase.ExecuteNonQuery("");
            }
            catch (Exception exception)
            {
                throw exception;
            }
            blFlag = (num > 0 ? true : false);
            return(blFlag);
        }
Example #11
0
        public bool DeleteRole(string id)
        {
            bool   blFlag = false;
            int    num    = -1;
            string sql    = "delete from bas_role where id=" + id + " and id not in (select role_id from bas_module_role )";

            try
            {
                num = DataBase.ExecuteNonQuery(sql);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            blFlag = (num > 0 ? true : false);
            return(blFlag);
        }
Example #12
0
        public int Delete(string filter)
        {
            int    num = -1;
            string sql = "delete from " + this.tableName;

            if (!string.IsNullOrEmpty(filter.Trim()))
            {
                sql = sql + "  where  " + filter;
            }
            try
            {
                num = DataBase.ExecuteNonQuery(sql);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(num);
        }
Example #13
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool ParamUpdate(BasParam model)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" Update bas_param ");
            strb.Append(" Set ");
            //strb.Append("id         = " + model.Id + ",");
            strb.Append("parent_id       = " + model.ParentId + ",");
            strb.Append("grade        = '" + model.Grade + "',");
            strb.Append("code         = '" + model.Code + "',");
            strb.Append("title        = '" + model.Title + "',");

            strb.Append("remark       = '" + model.Remark + "',");
            strb.Append("sort         = '" + model.Sort + "',");
            strb.Append("enable_flag  = '" + model.EnableFlag + "'");
            strb.Append(" where  id = " + model.Id);

            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #14
0
        /// <summary>
        /// 重设密码
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <param name="newPassword">新密码</param>
        /// <returns></returns>
        public bool ResetPassword(string UserID, string newPassword)
        {
            try
            {
                StringBuilder strb = new StringBuilder();
                strb.Append(" Update bas_user ");
                strb.Append(" Set ");

                strb.Append("userpassword   = '******'");

                strb.Append(" where userid = " + UserID);
                DataBase.ExecuteNonQuery(strb.ToString());
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Example #15
0
        public bool UpdateLogin(BasUser model)
        {
            try
            {
                StringBuilder strb = new StringBuilder();
                strb.Append(" Update bas_user ");
                strb.Append(" Set ");
                strb.Append("lastloginip    = '" + model.LastLoginIp + "',");
                strb.Append("logintimes     = " + model.LoginTimes + ",");
                strb.Append("lastlogintime  = '" + model.LastLoginTime + "'");

                strb.Append(" where userid = " + model.UserId.ToString());
                DataBase.ExecuteNonQuery(strb.ToString());
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Example #16
0
        /// <summary>
        /// 更新一条数据

        /// </summary>
        public bool BasModuleUpdate(BasModule model)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" Update Bas_Module ");
            strb.Append(" Set ");
            //strb.Append("module_id       = " + model.ModuleId + ",");
            strb.Append("module_father   = " + model.ModuleFather + ",");
            strb.Append("module_code     = '" + model.ModuleCode + "',");
            strb.Append("module_name     = '" + model.ModuleName + "',");
            strb.Append("module_icon     = '" + model.ModuleIcon + "',");
            strb.Append("module_width    = " + model.ModuleWidth + ",");
            strb.Append("module_height   = " + model.ModuleHeight + ",");
            strb.Append("module_url      = '" + model.ModuleUrl + "',");
            strb.Append("module_sort     = '" + model.ModuleSort + "',");
            strb.Append("enable_flag     = '" + model.EnableFlag + "',");
            strb.Append("toolbar_flag    = '" + model.ToolbarFlag + "',");
            strb.Append("module_purview  = '" + model.ModulePurview + "'");
            strb.Append(" where module_id = " + model.ModuleId);

            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #17
0
        public bool Delete(string id)
        {
            bool   blFlag = false;
            int    num    = -1;
            string sql    = "delete from bas_org where id=" + id;
            string count  = DataBase.ExecuteScalarToStr("select count(*) from bas_user where orgid=" + id);

            if (Hi.Common.Utils.StrToInt(count) > 0)
            {
                return(false);
            }

            try
            {
                num = DataBase.ExecuteNonQuery(sql);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            blFlag = (num > 0 ? true : false);
            return(blFlag);
        }
Example #18
0
        /// <summary>
        /// 增加一条数据

        /// </summary>
        public bool BasModuleAdd(BasModule model)
        {
            StringBuilder strb = new StringBuilder();

            strb.Append(" Insert Into Bas_Module ");
            strb.Append(" ( ");
            //strb.Append("module_id, ");
            strb.Append("module_father, ");
            strb.Append("module_code, ");
            strb.Append("module_name, ");
            strb.Append("module_icon, ");
            strb.Append("module_width, ");
            strb.Append("module_height, ");
            strb.Append("module_url, ");
            strb.Append("module_sort, ");
            strb.Append("enable_flag, ");
            strb.Append("toolbar_flag, ");
            strb.Append("module_purview ");
            strb.Append(" )");
            strb.Append(" Values( ");
            //strb.Append("" + model.ModuleId + ", ");
            strb.Append("" + model.ModuleFather + ", ");
            strb.Append("'" + model.ModuleCode + "', ");
            strb.Append("'" + model.ModuleName + "', ");
            strb.Append("'" + model.ModuleIcon + "', ");
            strb.Append("" + model.ModuleWidth + ", ");
            strb.Append("" + model.ModuleHeight + ", ");
            strb.Append("'" + model.ModuleUrl + "', ");
            strb.Append("'" + model.ModuleSort + "', ");
            strb.Append("'" + model.EnableFlag + "', ");
            strb.Append("'" + model.ToolbarFlag + "', ");
            strb.Append("'" + model.ModulePurview + "' ");
            strb.Append(" )");


            return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false);
        }
Example #19
0
        /// <summary>
        /// 更新用户操作权限
        /// </summary>
        /// <param name="user_id"></param>
        /// <param name="strPurview"></param>
        /// <returns></returns>
        public bool UpdatePurview(string user_id, string strPurview)
        {
            string strSql = "update bas_user set purview='" + strPurview + "' where userid=" + user_id;

            return(DataBase.ExecuteNonQuery(strSql) > 0 ? true : false);
        }
Example #20
0
 public bool Delete(string user_id)
 {
     return(DataBase.ExecuteNonQuery("select from bas_user where userid=" + user_id) > 0 ? true : false);
 }
Example #21
0
        /// <summary>
        /// 删除一条数据

        /// </summary>
        public bool BasModuleDelete(string id)
        {
            string strSql = "delete from Bas_Module where module_id =" + id + " and module_id not in (select module_id from bas_module_role ) ";

            return(DataBase.ExecuteNonQuery(strSql) > 0 ? true : false);
        }