private void T_Checkout_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         T_Service.Focus();
     }
 }
Exemplo n.º 2
0
        public ActionResult AddLeisureTourism(Service SV)
        {
            HYMSDTEntities context = new HYMSDTEntities();
            ReturnModel1   reModel = new ReturnModel1();

            reModel.status = false;
            try
            {
                T_Service model = new T_Service();
                model.S_Guid      = Guid.NewGuid();
                model.S_Address   = SV.S_Address;
                model.S_Cost      = SV.S_Cost;
                model.S_Introduce = SV.S_Introduce;
                model.S_Name      = SV.S_Name;
                model.S_PhotoList = SV.S_PhotoList;
                model.S_QH        = SV.S_QH;
                model.S_Star      = SV.S_Star;
                model.S_Type      = SV.S_Type;

                //转WKT
                string wktStr = string.Format("POINT ({0})", SV.S_Geo);
                model.S_Geo = GeoUtils.FromWkt("point", wktStr, 0);

                context.T_Service.Add(model);
                context.SaveChanges();

                reModel.status = true;
            }
            catch (Exception ex)
            {
                reModel.message = ex.ToString();
            }

            return(Json(reModel));
        }