Example #1
0
        public static int GetRecordCount(string Company, int i, string search)
        {
            string strSql = "select count(*) from CoorTransRec where Company='" + Company + "'and " + search;

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #2
0
File: News.cs Project: FineLqy/CQ
        /// <summary>
        /// 删除一条数据(根据UserName)
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static bool Delete(int ID)
        {
            string strSql = "delete from News where ID ='" + ID + "'";

            return(DBHelperSQL.GetNums(strSql, connectionString) == 1 ? true : false);
        }
Example #3
0
        /// <summary>
        /// 查询首字符信息
        /// </summary>
        /// <returns></returns>
        public static DataSet GetCharList()
        {
            string sql = "select Max(id) as id,Max(charIndex) as charIndex from AreaInfo group by charIndex order by charIndex asc";

            return(DBHelperSQL.Query(sql));
        }
Example #4
0
        /// <summary>
        /// 用户是否存在
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Exists(string OrderNumber)
        {
            string strSql = "select count(*) from OrderList where OrderNumber='" + OrderNumber + "'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #5
0
File: News.cs Project: FineLqy/CQ
        public static int GetRecordCount()
        {
            string strSql = "select count(*) from News";

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #6
0
        public static bool Exists(string SerialNumber, int i = 1)
        {
            string strSql = "select count(*) from DataCenter where SerialNumber='" + SerialNumber + "'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #7
0
        /// <summary>
        /// 删除一条数据(根据UserName)
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Delete(string OrderNumber)
        {
            string strSql = "delete from OrderList where OrderNumber ='" + OrderNumber + "'";

            return(DBHelperSQL.GetNums(strSql, connectionString) == 1 ? true : false);
        }
        /// <summary>
        /// 疑难问题设置
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int UpdateDiff(int id, int status)
        {
            string sql = "update QuestionInfo set infoTypeId = " + status + " where id = " + id;

            return(DBHelperSQL.ExecuteSql(sql));
        }
        /// <summary>
        /// 加图推荐
        /// </summary>
        /// <param name="id"></param>
        /// <param name="spic"></param>
        /// <returns></returns>
        public static int UpdateAddImgTj(int id, string spic)
        {
            string sql = "update QuestionInfo set questionRemark = '" + spic + "' where id = " + id;

            return(DBHelperSQL.ExecuteSql(sql));
        }
Example #10
0
        /// <summary>
        /// 删除一条数据(根据ID)
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Delete(int ID)
        {
            string strSql = "delete from CoorTransRec where ID =" + ID.ToString();

            return(DBHelperSQL.GetNums(strSql, connectionString) == 1 ? true : false);
        }
Example #11
0
        /// <summary>
        /// 删除多条数据(根据ID)
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Delete(string UserName)
        {
            string strSql = "delete from CoorTransRec where UserName ='******'";

            return(DBHelperSQL.GetNums(strSql, connectionString) >= 0 ? true : false);
        }
Example #12
0
        /// <summary>
        /// 是否存在用户UserName
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Exists(string UserName)
        {
            string strSql = "select count(*) from CoorTransRec where UserName='******'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #13
0
        public static int GetRecordCount(string UserName, bool b, string search = "")
        {
            string strSql = "select count(*) from CoorTransRec where UserName='******' and " + search;

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #14
0
        public static int GetRecordCount(string UserName, string Remark)
        {
            string strSql = "select count(*) from CoorTransRec where UserName='******' and Remark like'%" + Remark + "%'";

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #15
0
        public static int GetRecordCount(string DeviceType = "")
        {
            string strSql = "select count(*) from DataCenter where DeviceType like '%" + DeviceType + "%'";

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #16
0
        /// <summary>
        /// 更新问题的回答Quantity
        /// </summary>
        /// <param name="questionId"></param>
        /// <returns></returns>
        public static int UpdateAnswerCount(int questionId)
        {
            string sql = "update QuestionInfo set answerCount = answerCount + 1 where id = " + questionId;

            return(DBHelperSQL.ExecuteSql(sql));
        }
Example #17
0
        /// <summary>
        /// 设备类型
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Exists(string DeviceType)
        {
            string strSql = "select count(*) from DataCenter where DeviceType='" + DeviceType + "'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #18
0
        /// <summary>
        /// 推荐问题设置
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int UpdateTj(int id, int status)
        {
            string sql = "update QuestionInfo set remark = '" + status + "' where id = " + id;

            return(DBHelperSQL.ExecuteSql(sql));
        }
Example #19
0
        /// <summary>
        /// 专家顾问
        /// </summary>
        /// <returns></returns>
        public static DataSet GetListSpecial()
        {
            string sql = "select max(inviteName) as inviteName from Invite where inviteType = 0 and status = 0 group by inviteName order by inviteName asc ";

            return(DBHelperSQL.Query(sql));
        }
Example #20
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(Model.ProductType model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ProductType set ");
            strSql.Append("typeName=@typeName,");
            strSql.Append("parentId=@parentId,");
            strSql.Append("oneId=@oneId,");
            strSql.Append("oneName=@oneName,");
            strSql.Append("twoId=@twoId,");
            strSql.Append("twoName=@twoName,");
            strSql.Append("threeId=@threeId,");
            strSql.Append("threeName=@threeName,");
            strSql.Append("fourId=@fourId,");
            strSql.Append("fourName=@fourName,");
            strSql.Append("imgUrl=@imgUrl,");
            strSql.Append("diaryImg=@diaryImg,");
            strSql.Append("typeContent=@typeContent,");
            strSql.Append("typeDesc=@typeDesc,");
            strSql.Append("status=@status,");
            strSql.Append("remark=@remark,");
            strSql.Append("addTime=@addTime,");
            strSql.Append("addUser=@addUser,");
            strSql.Append("infoType=@infoType");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@typeName",    SqlDbType.VarChar,    150),
                new SqlParameter("@parentId",    SqlDbType.Int,          4),
                new SqlParameter("@oneId",       SqlDbType.Int,          4),
                new SqlParameter("@oneName",     SqlDbType.VarChar,    150),
                new SqlParameter("@twoId",       SqlDbType.Int,          4),
                new SqlParameter("@twoName",     SqlDbType.VarChar,    150),
                new SqlParameter("@threeId",     SqlDbType.Int,          4),
                new SqlParameter("@threeName",   SqlDbType.VarChar,    150),
                new SqlParameter("@fourId",      SqlDbType.Int,          4),
                new SqlParameter("@fourName",    SqlDbType.VarChar,    150),
                new SqlParameter("@imgUrl",      SqlDbType.VarChar,    150),
                new SqlParameter("@diaryImg",    SqlDbType.VarChar,    150),
                new SqlParameter("@typeContent", SqlDbType.NText),
                new SqlParameter("@typeDesc",    SqlDbType.VarChar,   1500),
                new SqlParameter("@status",      SqlDbType.Int,          4),
                new SqlParameter("@remark",      SqlDbType.VarChar,    150),
                new SqlParameter("@addTime",     SqlDbType.DateTime),
                new SqlParameter("@addUser",     SqlDbType.Int,          4),
                new SqlParameter("@infoType",    SqlDbType.Int,          4),
                new SqlParameter("@id",          SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.typeName;
            parameters[1].Value  = model.parentId;
            parameters[2].Value  = model.oneId;
            parameters[3].Value  = model.oneName;
            parameters[4].Value  = model.twoId;
            parameters[5].Value  = model.twoName;
            parameters[6].Value  = model.threeId;
            parameters[7].Value  = model.threeName;
            parameters[8].Value  = model.fourId;
            parameters[9].Value  = model.fourName;
            parameters[10].Value = model.imgUrl;
            parameters[11].Value = model.diaryImg;
            parameters[12].Value = model.typeContent;
            parameters[13].Value = model.typeDesc;
            parameters[14].Value = model.status;
            parameters[15].Value = model.remark;
            parameters[16].Value = model.addTime;
            parameters[17].Value = model.addUser;
            parameters[18].Value = model.infoType;
            parameters[19].Value = model.id;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #21
0
        public static int GetRecordCount(string search = "")
        {
            string strSql = "select count(*) from OrderList where OrderNumber like '%" + search + "%'";

            return(Convert.ToInt32(DBHelperSQL.GetResult(strSql, connectionString)));
        }
Example #22
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static int Add(Model.ProductType model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into ProductType(");
            strSql.Append("typeName,parentId,oneId,oneName,twoId,twoName,threeId,threeName,fourId,fourName,imgUrl,diaryImg,typeContent,typeDesc,status,remark,addTime,addUser,infoType)");
            strSql.Append(" values (");
            strSql.Append("@typeName,@parentId,@oneId,@oneName,@twoId,@twoName,@threeId,@threeName,@fourId,@fourName,@imgUrl,@diaryImg,@typeContent,@typeDesc,@status,@remark,@addTime,@addUser,@infoType)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@typeName",    SqlDbType.VarChar,    150),
                new SqlParameter("@parentId",    SqlDbType.Int,          4),
                new SqlParameter("@oneId",       SqlDbType.Int,          4),
                new SqlParameter("@oneName",     SqlDbType.VarChar,    150),
                new SqlParameter("@twoId",       SqlDbType.Int,          4),
                new SqlParameter("@twoName",     SqlDbType.VarChar,    150),
                new SqlParameter("@threeId",     SqlDbType.Int,          4),
                new SqlParameter("@threeName",   SqlDbType.VarChar,    150),
                new SqlParameter("@fourId",      SqlDbType.Int,          4),
                new SqlParameter("@fourName",    SqlDbType.VarChar,    150),
                new SqlParameter("@imgUrl",      SqlDbType.VarChar,    150),
                new SqlParameter("@diaryImg",    SqlDbType.VarChar,    150),
                new SqlParameter("@typeContent", SqlDbType.NText),
                new SqlParameter("@typeDesc",    SqlDbType.VarChar,   1500),
                new SqlParameter("@status",      SqlDbType.Int,          4),
                new SqlParameter("@remark",      SqlDbType.VarChar,    150),
                new SqlParameter("@addTime",     SqlDbType.DateTime),
                new SqlParameter("@addUser",     SqlDbType.Int,          4),
                new SqlParameter("@infoType",    SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.typeName;
            parameters[1].Value  = model.parentId;
            parameters[2].Value  = model.oneId;
            parameters[3].Value  = model.oneName;
            parameters[4].Value  = model.twoId;
            parameters[5].Value  = model.twoName;
            parameters[6].Value  = model.threeId;
            parameters[7].Value  = model.threeName;
            parameters[8].Value  = model.fourId;
            parameters[9].Value  = model.fourName;
            parameters[10].Value = model.imgUrl;
            parameters[11].Value = model.diaryImg;
            parameters[12].Value = model.typeContent;
            parameters[13].Value = model.typeDesc;
            parameters[14].Value = model.status;
            parameters[15].Value = model.remark;
            parameters[16].Value = model.addTime;
            parameters[17].Value = model.addUser;
            parameters[18].Value = model.infoType;

            object obj = DBHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Example #23
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(Model.Comment model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Comment set ");
            strSql.Append("orderId=@orderId,");
            strSql.Append("orderNo=@orderNo,");
            strSql.Append("productId=@productId,");
            strSql.Append("commentType=@commentType,");
            strSql.Append("dataType=@dataType,");
            strSql.Append("fromId=@fromId,");
            strSql.Append("commentInfo=@commentInfo,");
            strSql.Append("commentDesc=@commentDesc,");
            strSql.Append("img1Url=@img1Url,");
            strSql.Append("img2Url=@img2Url,");
            strSql.Append("img3Url=@img3Url,");
            strSql.Append("img4Url=@img4Url,");
            strSql.Append("status=@status,");
            strSql.Append("remark=@remark,");
            strSql.Append("addTime=@addTime,");
            strSql.Append("addUser=@addUser,");
            strSql.Append("infoType=@infoType");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@orderId",     SqlDbType.Int,          4),
                new SqlParameter("@orderNo",     SqlDbType.VarChar,     50),
                new SqlParameter("@productId",   SqlDbType.Int,          4),
                new SqlParameter("@commentType", SqlDbType.Int,          4),
                new SqlParameter("@dataType",    SqlDbType.Int,          4),
                new SqlParameter("@fromId",      SqlDbType.Int,          4),
                new SqlParameter("@commentInfo", SqlDbType.VarChar,   1500),
                new SqlParameter("@commentDesc", SqlDbType.VarChar,    150),
                new SqlParameter("@img1Url",     SqlDbType.VarChar,    150),
                new SqlParameter("@img2Url",     SqlDbType.VarChar,    150),
                new SqlParameter("@img3Url",     SqlDbType.VarChar,    150),
                new SqlParameter("@img4Url",     SqlDbType.VarChar,    150),
                new SqlParameter("@status",      SqlDbType.Int,          4),
                new SqlParameter("@remark",      SqlDbType.VarChar,    150),
                new SqlParameter("@addTime",     SqlDbType.DateTime),
                new SqlParameter("@addUser",     SqlDbType.Int,          4),
                new SqlParameter("@infoType",    SqlDbType.Int,          4),
                new SqlParameter("@id",          SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.orderId;
            parameters[1].Value  = model.orderNo;
            parameters[2].Value  = model.productId;
            parameters[3].Value  = model.commentType;
            parameters[4].Value  = model.dataType;
            parameters[5].Value  = model.fromId;
            parameters[6].Value  = model.commentInfo;
            parameters[7].Value  = model.commentDesc;
            parameters[8].Value  = model.img1Url;
            parameters[9].Value  = model.img2Url;
            parameters[10].Value = model.img3Url;
            parameters[11].Value = model.img4Url;
            parameters[12].Value = model.status;
            parameters[13].Value = model.remark;
            parameters[14].Value = model.addTime;
            parameters[15].Value = model.addUser;
            parameters[16].Value = model.infoType;
            parameters[17].Value = model.id;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #24
0
        /// <summary>
        /// 删除一条数据(根据StationOName)
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Delete(string StationOName)
        {
            string strSql = "delete from SiteMonitoring where StationOName ='" + StationOName + "'";

            return(DBHelperSQL.GetNums(strSql, connectionString) == 1 ? true : false);
        }
Example #25
0
File: News.cs Project: FineLqy/CQ
        /// <summary>
        /// 是否存在该ID主键
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static bool Exists(int ID)
        {
            string strSql = "select count(*) from News where ID=" + ID.ToString();

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #26
0
        /// <summary>
        /// 站点监视是否存在
        /// </summary>
        /// <param name="StationOName"></param>
        /// <returns></returns>
        public static bool Exists(string StationOName)
        {
            string strSql = "select count(*) from SiteMonitoring where StationOName='" + StationOName + "'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }
Example #27
0
File: News.cs Project: FineLqy/CQ
        /// <summary>
        /// 获得新闻列表
        /// </summary>
        /// <returns></returns>
        public static DataSet ListTop3()
        {
            string strSql = "select  top 3* from News  ";

            return(DBHelperSQL.GetDataSet(strSql, connectionString));
        }
Example #28
0
        /// <summary>
        /// 删除一条数据(根据SerialNumber)
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Delete(string SerialNumber)
        {
            string strSql = "delete from DataCenter where SerialNumber ='" + SerialNumber + "'";

            return(DBHelperSQL.GetNums(strSql, connectionString) == 1 ? true : false);
        }
Example #29
0
        /// <summary>
        /// 热门设置
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int SetHot(int id, int status)
        {
            string sql = "update AreaInfo set status = " + status + " where id = " + id;

            return(DBHelperSQL.ExecuteSql(sql));
        }
Example #30
0
        /// <summary>
        /// 类型
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool Exists(string Type)
        {
            string strSql = "select count(*) from InternetInformation where Type='" + Type + "'";

            return(DBHelperSQL.GetResult(strSql, connectionString).ToString().Trim() == "1" ? true : false);
        }