Пример #1
0
 /// <summary>
 /// 更新主机信息
 /// </summary>
 /// <param name="sch"></param>
 /// <returns></returns>
 public int exchost(SC_HOST sch)
 {
     try
     {
         DSCfunction dsc = new DSCfunction();
         sch.STATE_DATE = DateTime.Now;
         return(dsc.UPDATE_HOST(sch));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #2
0
        /// <summary>
        /// 更新建筑数据
        /// </summary>
        /// <param name="info">建筑数据</param>
        /// <param name="userid">操作ID</param>
        /// <returns></returns>
        public int EditLandata(LanData info, int userid)
        {
            try
            {
                DLanData dld = new DLanData();
                if (info.PASSWD != "")
                {
                    info.PASSWD = md5.Md5Encode(info.PASSWD);
                }
                else
                {
                    info.PASSWD = dld.SELECT_BY_ID(info.ID).PASSWD;
                }
                info.Isused = true;
                int result = dld.UPDATE(info);


                DSCfunction dsc = new DSCfunction();
                SC_HOST     sch = dsc.SELECT_HOST_ID(info.ID);
                sch.HOST_CODE = info.HOST_CODE;
                sch.PASSWD    = info.PASSWD;
                sch.ACTIVE    = info.ACTIVE;
                dsc.UPDATE_HOST(sch);

                Log log = new Log();
                log.Tablename   = "LanData";
                log.Tableid     = result;
                log.Mid         = userid;
                log.Datetime    = DateTime.Now;
                log.Discription = "Update";
                DLog dl = new DLog();
                dl.INSERT(log);

                return(result);
            }
            catch
            {
                return(0);
            }
        }