Esempio n. 1
0
        string TestLocation(LocationM LocationMe)
        {
            LocationM Tehtanloc = new LocationM()
            {
                X = 35.699745178222656, Y = 51.337795257568359
            };

            return(GeoCodeCalc.CalcDistance(Tehtanloc, LocationMe).ToString().ToLocationDistance());
        }
Esempio n. 2
0
        public bool UpdateLocation(LocationM emsLocationM)
        {
            p = new SqlParameter[4];

            //p[0] = new SqlParameter("@LocationCode", SqlDbType.VarChar) { Value = emsLocationM.LocationCode };
            //p[1] = new SqlParameter("@Description", SqlDbType.VarChar) { Value = emsLocationM.Description };
            //p[2] = new SqlParameter("@TrnUser", SqlDbType.VarChar) { Value = emsLocationM.TrnUser};
            //p[3] = new SqlParameter("@TrnType", SqlDbType.VarChar) { Value = 2 };

            return(SqlHelper.ExecuteNonQuery(clsConnectionString.getConnectionString(), CommandType.StoredProcedure,
                                             "spLocationsM", p) > 0);
        }
Esempio n. 3
0
        public bool DeleteLocation(LocationM Location)
        {
            p = new SqlParameter[2];

            p[0] = new SqlParameter("@LocationCode", SqlDbType.VarChar)
            {
                Value = Location.LocationCode
            };
            //p[1] = new SqlParameter("@TrnUser", SqlDbType.VarChar) { Value = emsLocation.TrnUser };

            return(SqlHelper.ExecuteNonQuery(clsConnectionString.getConnectionString(), CommandType.StoredProcedure,
                                             "spDeleteLocationsM", p) > 0);
        }
        public ActionResult TheLocation(LocationM location, Users user, IFormCollection loc)
        {
            var selected = location.LocationsId;

            // var selected = loc["LocationId"];
            location.LocationsId   = int.Parse(loc["SL"]);
            TempData["locationid"] = location.LocationsId;

            //user.DefaultLocationFk = location.LocationsId;
            //TempData["msg"] = "user id " + user.UsersId + "name " + user.FirstName;
            // TempData["name"] = "user name " + user.FirstName + "last name " + user.FirstName;


            return(RedirectToAction("OrderSubmit", "Orders", user));
        }
Esempio n. 5
0
        public int UpdateLocation(LocationM Location, int UserId)
        {
            string  s1        = Location.X.ToString();
            string  s2        = Location.Y.ToString();
            Decimal Latitude  = Convert.ToDecimal(s1);
            Decimal Longitude = Convert.ToDecimal(s2);

            var userIdUbdatelocation = _db.Member.Where(x => x.UserId == UserId).FirstOrDefault();

            //userIdUbdatelocation.Location = new LocationM() { X = Location.X.LocationDecimals(), Y = Location.Y.LocationDecimals() };
            userIdUbdatelocation.X       = Location.X;
            userIdUbdatelocation.Y       = Location.Y;
            userIdUbdatelocation.Adrress = GeoCodeCalc.GetAddressFromLatLon(Latitude, Longitude);
            _db.SaveChanges();
            SetCurrentInstructionsUser(UserId, Selectoption.Mnu);
            return(0);
        }
        // GET
        public ActionResult TheLocation(Users user)
        {
            LocationM location = new LocationM();

            return(View(location));
        }