private void GetRefEvent(CRMEventModel model) { var db = eventService.GetById(model.Id); if (db != null) { db.FilesList = fileService.GetServerFile(model.Id, new CRMEventModel().GetType().ToString()); db.FilesList = db.FilesList ?? new List <ServerFile>(); model.CreatedBy = db.CreatedBy; model.FilesList = db.FilesList; model.UsersFollow = db.UsersFollow; model.UserFollowNames = db.UserFollowNames; } }
public ActionResult Edit(long cusId, long id = 0) { var model = new CrmCusDocumentModel { CrmCusId = cusId, FilesList = new List <ServerFile>() }; var doc = documentService.GetModel(id); crmCustomer = crmCustomer ?? crmCustomerService.GetModelById(cusId); if (doc != null) { model = doc; model.FilesList = fileService.GetServerFile(id, new CrmCusDocumentModel().GetType().ToString()); } var value = new { Views = this.RenderPartialView("_TemplateEditView", model), Title = string.Format(@"{0} tài liệu {1} ", id > 0 ? "Sửa " : "Tạo ", crmCustomer.CompanyShortName), }; return(JsonResult(value, true)); }