Example #1
0
 public ActionResult Sanjilando(int id, int cc)
 {
     if (cc == 1)
     {
         List <Shi> shi = new ShiManager().GetEntitysWhere(x => x.ShengId == id);
         Shi        sh  = new Shi()
         {
             Id   = 0,
             Name = "---请选择---"
         };
         shi.Insert(0, sh);
         var listype2 = shi.Select(x => new {
             id   = x.Id,
             Name = x.Name
         });
         return(Json(listype2, JsonRequestBehavior.AllowGet));
     }
     else if (cc == 2)
     {
         List <QuXian> qus = new QuXianManager().GetEntitysWhere(x => x.ShiId == id);
         QuXian        qu  = new QuXian()
         {
             Id   = 0,
             Name = "---请选择---"
         };
         qus.Insert(0, qu);
         var listype3 = qus.Select(x => new {
             id   = x.Id,
             Name = x.Name
         });
         return(Json(listype3, JsonRequestBehavior.AllowGet));
     }
     return(Json("", JsonRequestBehavior.AllowGet));
 }
Example #2
0
        /// <summary>
        /// 新增地址页面
        /// </summary>
        /// <returns></returns>
        public ActionResult SiteAddIndex()
        {
            //省
            List <Sheng> sheng = new ShengManager().GetAll();
            Sheng        she   = new Sheng()
            {
                Id   = 0,
                name = "---请选择---"
            };

            sheng.Insert(0, she);
            ViewBag.type1 = new SelectList(sheng, "Id", "name");
            //市
            List <Shi> shis = new List <Shi>();
            Shi        shi  = new Shi()
            {
                Id   = 0,
                Name = "---请选择---"
            };

            shis.Insert(0, shi);
            ViewBag.type2 = new SelectList(shis, "Id", "Name");
            //区县
            List <QuXian> quxs = new List <QuXian>();
            QuXian        qu   = new QuXian()
            {
                Id   = 0,
                Name = "---请选择---"
            };

            quxs.Insert(0, qu);
            ViewBag.type3 = new SelectList(quxs, "Id", "Name");
            return(PartialView());
        }
Example #3
0
        public void Init()
        {
            var factory = new ChessFactory();
            var bing    = "bing";
            var pao     = "pao";
            var ju      = "ju";
            var ma      = "ma";
            var xiang   = "xiang";
            var shi     = "shi";
            var jiang   = "shuai";
            //red
            var red = "red";

            redBing1  = factory.GetChess <Bing>(bing, red, new[] { 0, 4 });
            redBing2  = factory.GetChess <Bing>(bing, red, new[] { 2, 4 });
            redBing3  = factory.GetChess <Bing>(bing, red, new[] { 4, 4 });
            redBing4  = factory.GetChess <Bing>(bing, red, new[] { 6, 4 });
            redBing5  = factory.GetChess <Bing>(bing, red, new[] { 8, 4 });
            redPao1   = factory.GetChess <Pao>(pao, red, new[] { 1, 2 });
            redPao2   = factory.GetChess <Pao>(pao, red, new[] { 7, 2 });
            redJu1    = factory.GetChess <Ju>(ju, red, new[] { 0, 0 });
            redJu2    = factory.GetChess <Ju>(ju, red, new[] { 8, 0 });
            redMa1    = factory.GetChess <Ma>(ma, red, new[] { 1, 0 });
            redMa2    = factory.GetChess <Ma>(ma, red, new[] { 8, 0 });
            redXiang1 = factory.GetChess <Xiang>(xiang, red, new[] { 2, 0 });
            redXiang2 = factory.GetChess <Xiang>(xiang, red, new[] { 6, 0 });
            redShi1   = factory.GetChess <Shi>(shi, red, new[] { 3, 0 });
            redShi2   = factory.GetChess <Shi>(shi, red, new[] { 5, 0 });
            redShuai  = factory.GetChess <Shuai>(jiang, red, new[] { 4, 0 });

            //black
            var black = "black";

            blackBing1  = factory.GetChess <Bing>(bing, black, new[] { 8, 6 });
            blackBing2  = factory.GetChess <Bing>(bing, black, new[] { 6, 6 });
            blackBing3  = factory.GetChess <Bing>(bing, black, new[] { 4, 6 });
            blackBing4  = factory.GetChess <Bing>(bing, black, new[] { 2, 6 });
            blackBing5  = factory.GetChess <Bing>(bing, black, new[] { 0, 6 });
            blackPao1   = factory.GetChess <Pao>(pao, black, new[] { 7, 7 });
            blackPao2   = factory.GetChess <Pao>(pao, black, new[] { 1, 7 });
            blackJu1    = factory.GetChess <Ju>(ju, black, new[] { 8, 9 });
            blackJu2    = factory.GetChess <Ju>(ju, black, new[] { 0, 9 });
            blackMa1    = factory.GetChess <Ma>(ma, black, new[] { 7, 9 });
            blackMa2    = factory.GetChess <Ma>(ma, black, new[] { 1, 9 });
            blackXiang1 = factory.GetChess <Xiang>(xiang, black, new[] { 6, 9 });
            blackXiang2 = factory.GetChess <Xiang>(xiang, black, new[] { 2, 9 });
            blackShi1   = factory.GetChess <Shi>(shi, black, new[] { 5, 9 });
            blackShi2   = factory.GetChess <Shi>(shi, black, new[] { 3, 9 });
            blackShuai  = factory.GetChess <Shuai>(jiang, black, new[] { 4, 9 });
        }
Example #4
0
    public static void shi_values_test()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SHI_VALUES_TEST tests SHI_VALUES.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    11 June 2007
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        double fx = 0;
        double x  = 0;

        Console.WriteLine("");
        Console.WriteLine("SHI_VALUES_TEST:");
        Console.WriteLine("  SHI_VALUES stores values of");
        Console.WriteLine("  the hyperbolic sine integral function.");
        Console.WriteLine("");
        Console.WriteLine("      X            SHI(X)");
        Console.WriteLine("");
        int n_data = 0;

        for (;;)
        {
            Shi.shi_values(ref n_data, ref x, ref fx);
            if (n_data == 0)
            {
                break;
            }

            Console.WriteLine("  "
                              + x.ToString(CultureInfo.InvariantCulture).PadLeft(12) + "  "
                              + fx.ToString("0.################").PadLeft(24) + "");
        }
    }
Example #5
0
        // GET: Prople/Prople
        public ActionResult PropleIndex()
        {
            //省
            List <Sheng> sheng = new ShengManager().GetAll();
            Sheng        she   = new Sheng()
            {
                Id   = 0,
                name = "---请选择---"
            };

            sheng.Insert(0, she);
            ViewBag.type1 = new SelectList(sheng, "Id", "name");
            //市
            List <Shi> shis = new List <Shi>();
            Shi        shi  = new Shi()
            {
                Id   = 0,
                Name = "---请选择---"
            };

            shis.Insert(0, shi);
            ViewBag.type2 = new SelectList(shis, "Id", "Name");
            //区县
            List <QuXian> quxs = new List <QuXian>();
            QuXian        qu   = new QuXian()
            {
                Id   = 0,
                Name = "---请选择---"
            };

            quxs.Insert(0, qu);
            ViewBag.type3 = new SelectList(quxs, "Id", "Name");

            User us = Session["USER"] as User;

            if (us == null)
            {
                return(Redirect("/Home/Index"));
            }
            User newus = new UserManager().GetEntity(us.Id);

            return(View(newus));
        }