public bool CreateAndSave(YandexXmlConfig config) { config.ProjectModule.Code = ModuleCode; config.ProjectModule.CreatedTime = DateTime.Now; config.ProjectModule.ProjectId = config.ProjectModule.ProjectId; return(Context.Repository.AddModule(config.ProjectModule) & Context.Repository.AddYandexXmlConfig(config)); }
public bool SaveConfig(YandexXmlConfig config) { var projectModule = Context.Repository.GetModule(Id); projectModule.Name = config.ProjectModule.Name; projectModule.Description = config.ProjectModule.Description; Configuration.PageLimit = Configuration.ProjectModuleId = projectModule.Id; Configuration.User = config.User; Configuration.Key = config.Key; Configuration.Region = config.Region; Configuration.Filter = config.Filter; Configuration.PageLimit = config.PageLimit; Configuration.HttpModuleId = config.HttpModuleId; return(Context.Repository.UpdateModule(projectModule) & Context.Repository.UpdateYandexXmlConfig(Configuration)); }