Exemplo n.º 1
0
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Update(CFG_USERINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("UPDATE CFG_USERINFO SET NAME='" + info.NAME + "',SEX=" + info.SEX + ",AGE='" + info.AGE + "',TELEPHONE='" + info.TELEPHONE + "',CERTIFICATETYPE=" + info.CERTIFICATETYPE + ",");
            pUpdateText.Append("CERTIFICATENUM='" + info.CERTIFICATENUM + "',DIRECTION='" + info.DIRECTION + "',BELONGDEPTID=" + info.BELONGDEPTID + ",BELONGNETID=" + info.BELONGNETID + ",ADDRESS='" + info.ADDRESS + "', ");
            pUpdateText.Append("REMARK='" + info.REMARK + "',USERTYPE=" + info.USERTYPE + ",VIRTUALTRUMPET='" + info.VIRTUALTRUMPET + "',USERNAME='******',USERPWD='" + info.USERPWD + "',LOGINTYPE= " + info.LOGINTYPE + " ");
            pUpdateText.Append("WHERE ID=" + info.ID);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_USERINFO> db = new DbBase<CFG_USERINFO>();
            //db.Update(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Add(CFG_USERINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pInsertText = new StringBuilder();

            pInsertText.Append("INSERT INTO CFG_USERINFO(NAME,SEX,AGE,TELEPHONE,CERTIFICATETYPE,CERTIFICATENUM,DIRECTION,BELONGDEPTID,BELONGNETID,ADDRESS,REMARK,ISDELETED,USERTYPE,VIRTUALTRUMPET,USERNAME,USERPWD,LOGINTYPE) VALUES('");
            pInsertText.Append(info.NAME + "'," + info.SEX + ",'" + info.AGE + "','" + info.TELEPHONE + "'," + info.CERTIFICATETYPE + ",'" + info.CERTIFICATENUM + "','" + info.DIRECTION + "',");
            pInsertText.Append(info.BELONGDEPTID + "," + info.BELONGNETID + ",'" + info.ADDRESS + "','" + info.REMARK + "'," + info.ISDELETED + "," + info.USERTYPE + ",'");
            pInsertText.Append(info.VIRTUALTRUMPET + "','" + info.USERNAME + "','" + info.USERPWD + "'," + info.LOGINTYPE + ")");

            try
            {
                OracleOperateBLL.ExecuteSql(pInsertText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_USERINFO> db = new DbBase<CFG_USERINFO>();
            //db.Insert(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 3
0
        /// <summary>
        /// 修改网格信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Update(CFG_NETINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("UPDATE CFG_NETINFO SET NAME='" + info.NAME + "',POPULATIONINFO='" + info.POPULATIONINFO + "',HOUSEINFO='" + info.HOUSEINFO + "',UNITSTOREINFO='" + info.UNITSTOREINFO + "',BELONGAREA='" + info.BELONGAREA + "',");
            pUpdateText.Append("BELONGDEPTID=" + info.BELONGDEPTID + ",REMARK='" + info.REMARK + "',NETCOLOR='" + info.NETCOLOR + "',LONANDLAT='" + info.LONANDLAT + "' ");
            pUpdateText.Append("WHERE ID=" + info.ID);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_NETINFO> db = new DbBase<CFG_NETINFO>();
            //db.Update(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 4
0
        /// <summary>
        /// 删除用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool Delete(int id)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("DELETE FROM CFG_USERINFO WHERE ID=" + id);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_USERINFO> db = new DbBase<CFG_USERINFO>();
            //db.Delete(p => p.ID == id);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 5
0
        /// <summary>
        /// 删除网格信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool Delete(int id)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("UPDATE CFG_NETINFO SET ISDELETED=1 WHERE ID=" + id);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_NETINFO> db = new DbBase<CFG_NETINFO>();
            //var info = Get(id);
            //info.ISDELETED = 1;
            //db.Update(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 6
0
        /// <summary>
        /// 添加网格信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Add(CFG_NETINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pInsertText = new StringBuilder();

            pInsertText.Append("INSERT INTO CFG_NETINFO(NAME,POPULATIONINFO,HOUSEINFO,UNITSTOREINFO,BELONGAREA,BELONGDEPTID,REMARK,ISDELETED,NETCOLOR,LONANDLAT) VALUES('");
            pInsertText.Append(info.NAME + "','" + info.POPULATIONINFO + "','" + info.HOUSEINFO + "','" + info.UNITSTOREINFO + "','" + info.BELONGAREA + "'," + info.BELONGDEPTID + ",'" + info.REMARK + "',");
            pInsertText.Append(info.ISDELETED + ",'" + info.NETCOLOR + "','" + info.LONANDLAT + "')");

            try
            {
                OracleOperateBLL.ExecuteSql(pInsertText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_NETINFO> db = new DbBase<CFG_NETINFO>();
            //db.Insert(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加报警信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Add(INFO_ALARMINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pInsertText = new StringBuilder();

            pInsertText.Append("INSERT INTO INFO_ALARMINFO(ALARMINFO,ALARMTIME,ALARMADDRESS,ALARMTYPE,ALARMOBJECTNAME) VALUES('");
            pInsertText.Append(info.ALARMINFO + "',TO_DATE('" + info.ALARMTIME.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-mm-dd hh24:mi:ss'),'" + info.ALARMADDRESS + "','" + info.ALARMTYPE + "','" + info.ALARMOBJECTNAME + "')");

            try
            {
                OracleOperateBLL.ExecuteSql(pInsertText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);
            //DbBase<INFO_ALARMINFO> db = new DbBase<INFO_ALARMINFO>();
            //db.Insert(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 8
0
        /// <summary>
        /// 修改是否已读
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Update(MESSAGE info)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("UPDATE MESSAGE SET ISREAD_PLATFORM= " + info.ISREAD_PLATFORM + " ");
            pUpdateText.Append("WHERE ID=" + info.ID);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<MESSAGE> db = new DbBase<MESSAGE>();
            //db.Update(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 9
0
        /// <summary>
        /// 添加文件
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Add(INFO_FILEINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pInsertText = new StringBuilder();

            pInsertText.Append("INSERT INTO INFO_FILEINFO(FILENAME,FILEURL,UPLOADTIME,FILESIZE,UPLOADUSER) VALUES('");
            pInsertText.Append(info.FILENAME + "','" + info.FILEURL + "',TO_DATE('" + info.UPLOADTIME.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-mm-dd hh24:mi:ss'),'" + info.FILESIZE + "'," + info.UPLOADUSER + ")");

            try
            {
                OracleOperateBLL.ExecuteSql(pInsertText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);
            //DbBase<INFO_FILEINFO> db = new DbBase<INFO_FILEINFO>();
            //db.Insert(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 10
0
        /// <summary>
        /// 删除文件
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public static bool Delete(int[] ids)
        {
            bool isSuccess = true;

            foreach (var id in ids)
            {
                StringBuilder pUpdateText = new StringBuilder();
                pUpdateText.Append("DELETE FROM INFO_FILEINFO WHERE ID=" + id);

                try
                {
                    OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
                }
                catch
                {
                    isSuccess = false;
                }
            }
            return(isSuccess);

            //DbBase<INFO_FILEINFO> db = new DbBase<INFO_FILEINFO>();
            //List<INFO_FILEINFO> infoList = new List<INFO_FILEINFO>();
            //foreach (var id in ids)
            //{
            //    db.Delete(p => p.ID == id);
            //}
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 11
0
        /// <summary>
        /// 修改车辆信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Update(CFG_CARINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pUpdateText = new StringBuilder();

            pUpdateText.Append("UPDATE CFG_CARINFO SET VEHICLENO='" + info.VEHICLENO + "',VEHICLETYPE=" + info.VEHICLETYPE + ",VEHICLEBRAND='" + info.VEHICLEBRAND + "',BELONGDEPTID=" + info.BELONGDEPTID + ",BELONGNETID=" + info.BELONGNETID + ",");
            pUpdateText.Append("REMARK='" + info.REMARK + "',OWNER='" + info.OWNER + "',OWNERTYPE=" + info.OWNERTYPE + ",CLDWZDSBH='" + info.CLDWZDSBH + "',WLWKHM='" + info.WLWKHM + "' ");
            pUpdateText.Append("WHERE ID=" + info.ID);

            try
            {
                OracleOperateBLL.ExecuteSql(pUpdateText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);

            //DbBase<CFG_CARINFO> db = new DbBase<CFG_CARINFO>();
            //db.Update(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 12
0
        /// <summary>
        /// 添加车辆信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public static bool Add(CFG_CARINFO info)
        {
            bool          isSuccess   = true;
            StringBuilder pInsertText = new StringBuilder();

            pInsertText.Append("INSERT INTO CFG_CARINFO(VEHICLENO,VEHICLETYPE,VEHICLEBRAND,BELONGDEPTID,BELONGNETID,REMARK,ISDELETED,OWNER,OWNERTYPE,CLDWZDSBH,WLWKHM) VALUES('");
            pInsertText.Append(info.VEHICLENO + "'," + info.VEHICLETYPE + ",'" + info.VEHICLEBRAND + "'," + info.BELONGDEPTID + "," + info.BELONGNETID + ",'" + info.REMARK + "'," + info.ISDELETED + ",'");
            pInsertText.Append(info.OWNER + "'," + info.OWNERTYPE + ",'" + info.CLDWZDSBH + "','" + info.WLWKHM + "')");

            try
            {
                OracleOperateBLL.ExecuteSql(pInsertText.ToString());
            }
            catch
            {
                isSuccess = false;
            }

            return(isSuccess);
            //DbBase<CFG_CARINFO> db = new DbBase<CFG_CARINFO>();
            //db.Insert(info);
            //if (db.SaveChanges() >= 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Exemplo n.º 13
0
        /// <summary>
        /// 更新消息
        /// </summary>
        /// <param name="ids"></param>
        public static void UpdateMessage(List <int> ids)
        {
            StringBuilder pSBQueryText = new StringBuilder();

            pSBQueryText.Append("UPDATE MESSAGE SET ISSHOW_PLATFORM=1 WHERE ID IN(" + string.Join(",", ids) + ")");

            try
            {
                OracleOperateBLL.ExecuteSql(pSBQueryText.ToString());
            }
            catch
            {
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 更新定位实时信息
        /// </summary>
        /// <param name="objectName"></param>
        /// <returns></returns>
        public static void UpdateGpsInfo(string objectName)
        {
            StringBuilder pSBQueryText = new StringBuilder();

            pSBQueryText.Append("UPDATE GPS_REAL SET LASTALARMTIME=TO_DATE('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-mm-dd hh24:mi:ss') WHERE OBJECTNAME='" + objectName + "'");

            try
            {
                OracleOperateBLL.ExecuteSql(pSBQueryText.ToString());
            }
            catch
            {
            }
        }
Exemplo n.º 15
0
        public static void AddLog(LogInfo info)
        {
            StringBuilder pSBQueryText = new StringBuilder();

            pSBQueryText.Append("INSERT INTO SYS_LOG(USER_ID,USERNAME,OPERATION,TIME,METHOD,PARAMS,IP,GMT_CREATE) VALUES('" + info.User_Id + "','" + info.UserName + "','" + info.Operation + "','" + 0 + "','" + info.Method + "','" + info.Params + "','" + info.Ip + "'," + "sysdate)");

            try
            {
                OracleOperateBLL.ExecuteSql(pSBQueryText.ToString());
            }
            catch
            {
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="password"></param>
        public static bool UpdateUserPwd(int userId, string password)
        {
            bool          success      = true;
            StringBuilder pSBQueryText = new StringBuilder();

            pSBQueryText.Append("UPDATE CFG_USERINFO SET USERPWD='" + password + "' WHERE ID=" + userId + "");

            try
            {
                OracleOperateBLL.ExecuteSql(pSBQueryText.ToString());
            }
            catch
            {
                success = false;
            }

            return(success);
        }