/// <summary> /// 提交,修改 /// </summary> /// <param name="tandasEntity"></param> /// <param name="keyValue"></param> public void SubmitForm(ProfileAmenitiesConstructionSiteEntity Entity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { Entity.Modify(keyValue); } else { Entity.Create(); } service.SubmitForm(Entity, keyValue); try { //添加日志 LogMess.addLog(DbLogType.Update.ToString(), "修改成功", "修改环卫在建工地信息【" + Entity.SiteName + "】成功!"); } catch { } }
public ActionResult SubmitForm(ProfileAmenitiesConstructionSiteEntity Entity, string keyValue) { App.SubmitForm(Entity, keyValue); return(Success("操作成功。")); }
public ActionResult SummitImport(string CityId, string CountyId, string projectId, int isRename = 1) { projectId = "dd1bbf6b-bcea-4cad-851b-1be4adf71860"; string path = @"C:\Users\zps\Desktop\聚力环境测评系统样版\聚力环境测评系统样版\附件6、虹口市容点位\"; string fileName = "Book1.xlsx"; #region 导出 if (FileHelper.IsExistFile(Path.Combine(path, fileName))) { using (ExcelHelper exHelp = new ExcelHelper(Path.Combine(path, fileName))) { var datatable = exHelp.ExcelToDataTable(fileName, true); //ProfileAmenitiesConstructionSiteEntiy ProfileAmenitiesConstructionSiteEntity[] models = new ProfileAmenitiesConstructionSiteEntity[datatable.Rows.Count]; ProfileAmenitiesConstructionSiteEntity model; for (int i = 0; i < datatable.Rows.Count; i++) { try { var jdName = datatable.Rows[i]["街道"].ToString(); var fCode = datatable.Rows[i]["序号"].ToString(); var address = datatable.Rows[i]["地址"].ToString(); var name = datatable.Rows[i]["工地名称"].ToString(); var StreetNamekey = StreetApp.GetDictionary(d => d.StreetName == jdName)[0].Key; var streetModel = StreetApp.GetForm(StreetNamekey); model = new ProfileAmenitiesConstructionSiteEntity() { CityId = streetModel.CityId, CountyId = streetModel.CountyId, StreetId = streetModel.F_Id, Address = address, F_EnCode = fCode, SiteName = name, ProjectId = projectId }; models[i] = model; } catch { } } var thapp = new ProfileAmenitiesConstructionSiteApp(); foreach (var item in models) { try { if (item == null) { continue; } thapp.SubmitForm(item, string.Empty); } catch { } } } } #endregion return(Success("ss")); }