Beispiel #1
0
        public void addlBtotitle(LB_INFO lb)
        {
            //创建一个帖子
            int            M_Id  = -1; //这是老兵模块的初始ID值
            int            U_ID  = 1;  //这个是管理员值
            BBSTITLE_TABLE newt1 = new BBSTITLE_TABLE();

            newt1.M_ID       = M_Id;
            newt1.U_ID       = U_ID;
            newt1.T_key      = lb.LBname;
            newt1.TITLE      = lb.LBname;
            newt1.Context    = lb.LBexperience;
            newt1.is_pass    = 1;
            newt1.N_RESPONSE = 0;
            newt1.N_YES      = 0;
            newt1.pass_TIME  = DateTime.ParseExact("9999/12/31", "yyyy/MM/dd", null);
            newt1.F_TIME     = DateTime.Now;
            newt1.Authonrity = 10;
            newt1.MD5        = redmomery.Common.MD5Helper.EncryptString(newt1.Authonrity + newt1.F_TIME.ToString() + newt1.M_ID.ToString() + newt1.Context + newt1.TITLE);
            try
            {
                int count = titledal.addNew(newt1);
                newt1   = titledal.getByMD5(newt1.MD5);
                lb.T_ID = newt1.ID;
                lbdal.update(lb);
            }
            catch (Exception ex)
            {
                redmomery.command.createlog.createlogs(ex.Message + "\n\r" + ex.StackTrace.ToString());
            }
        }
Beispiel #2
0
        //开始进行模型修改
        public void testgeogecoding()
        {
            //开始从指定的对象中获取地址,并将其保存会
            //也就是取出所有模型
            string[] lbs = new string[1000];
            //赋值
            for (int i = 0; i < lbs.Length; i++)
            {
                lbs[i] = i.ToString();
            }

            redmomery.DAL.LB_INFODAL lt = new LB_INFODAL();

            List <LB_INFO> result = new List <LB_INFO>();

            Console.WriteLine("正在读取数据。。。。");
            List <LB_INFO> temp = (List <LB_INFO>)lt.ListAll();

            if (temp != null)
            {
                result.AddRange(temp);
            }
            Console.WriteLine("正在转换数据。。。");
            for (int i = 0; i < result.Count; i++)
            {
                if (i == 343)
                {
                    Console.WriteLine();
                }
                //进行获取数据库
                LB_INFO temp1 = getGecoding(result[i]);
                result[i] = temp1;
                //开始进行WKT的生成
                result[i].T_ID = -1;
                if (result[i].X.ToString() != "" && result[i].Y.ToString() != "")
                {
                    result[i].Location = lt.localtiontoWKT(result[i]);
                }
                Console.Write((i + 1).ToString() + "/");
            }
            //现在开始逐行更改
            int count = 0;

            Console.WriteLine("正在提交数据");
            for (int i = 0; i < result.Count; i++)
            {
                count += lt.update(result[i] as LB_INFO) ? 1 : -1;
                Console.Write((i + 1).ToString() + "/");
            }
            Console.WriteLine();
            Console.WriteLine("\n\r有{0}行受到了影响,共计{1}", count, result.Count.ToString());
        }