public ActionResult EditMap(FormCollection fc) { var model = new Data.Users(); model.ID = TypeConverter.StrToInt(fc["hidUserID"]); model.StartLat = TypeConverter.StrToDouble(fc["StartLat"], 0); model.Address = fc["add"]; model.StartLong = TypeConverter.StrToDouble(fc["StartLong"], 0); AjaxJson aj = new AjaxJson(); if (model.ID > 0) { aj.success = Data.UsersDB.SaveEditUsers_Map(model); } //else //{ // aj.success = Data.UsersDB.AddUsers(model) > 0; //} return(Json(new { success = aj.success }, JsonRequestBehavior.AllowGet)); }
public ActionResult iMap(FormCollection fc) { if (umodel == null || umodel.ID < 1) { return(Json(new { success = false, msg = 1 }, JsonRequestBehavior.AllowGet)); } else { var model = new Data.Users(); model.ID = TypeConverter.StrToInt(fc["hidUserID"]); model.StartLat = TypeConverter.StrToDouble(fc["StartLat"], 0); model.Address = fc["add"]; model.StartLong = TypeConverter.StrToDouble(fc["StartLong"], 0); AjaxJson aj = new AjaxJson(); if (model.ID > 0) { aj.success = Data.UsersDB.SaveEditUsers_Map(model); } return(Json(new { success = aj.success }, JsonRequestBehavior.AllowGet)); } }
public ActionResult EditMyProfile(FormCollection fc) { var model = new Data.Users(); model.ID = TypeConverter.StrToInt(fc["hidUserID"]); //model.StartLat = TypeConverter.StrToDouble(fc["StartLat"], 0); //model.EndLong = TypeConverter.StrToDouble(fc["EndLong"], 0); //model.EndLat = TypeConverter.StrToDouble(fc["EndLat"], 0); model.CreateTime = DateTime.Now; model.EndAddress = fc["EndAddress"]; model.ParentUserID = iRequest.GetQueryInt("ParentID", 0); model.WXUserID = 0; model.isFinal = true; model.Address = fc["Address"]; string _starttime = DateTime.Now.ToString("yyyy-MM-dd"); _starttime = _starttime + " " + fc["StartTime1"] + ":" + fc["StartTime2"] + ":00"; model.StartTime = TypeConverter.StrToDateTime(_starttime); string _endtime = DateTime.Now.ToString("yyyy-MM-dd"); _endtime = _endtime + " " + fc["EndTime1"] + ":" + fc["EndTime2"] + ":00"; model.EndTime = TypeConverter.StrToDateTime(_endtime); //model.StartLong = TypeConverter.StrToDouble(fc["StartLong"], 0); AjaxJson aj = new AjaxJson(); if (model.ID > 0) { aj.success = Data.UsersDB.SaveEditUsers_NoMap(model); } else { aj.success = Data.UsersDB.AddUsers(model) > 0; } return(Json(new { success = aj.success }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 文件上传方法 /// </summary> /// <param name="postedFile">文件流</param> /// <param name="isThumbnail">是否生成缩略图</param> /// <param name="isWater">是否打水印</param> /// <returns>上传后文件信息</returns> public bool FileSaveAs(Microsoft.AspNetCore.Http.IFormFile postedFile, bool isThumbnail, bool isWater, ref AjaxJson _ajv) { try { string fileExt = Path.GetExtension(postedFile.FileName)?[1..]; // postedFile.FileName.Split('.')[1]; //文件扩展名,不含“.”