Zhimolostnova A.V. Hard lab work 5 #15

Closed
AnnZhimol wants to merge 8 commits from LabRab_5_Hard into LabRab_4_Hard
4 changed files with 17 additions and 10 deletions
Showing only changes of commit f01435276a - Show all commits

View File

@ -0,0 +1,7 @@
{
"profiles": {
"SoftwareInstallationView": {
"commandName": "Project"
}
}
}

View File

@ -149,7 +149,8 @@ namespace SoftwareInstallationDataBaseImplement.Implements
}
store.Update(model);
context.SaveChanges();
store.UpdatePackage(context, model);
if (model.StorePackages != null)
store.UpdatePackage(context, model);
transaction.Commit();
return store.GetViewModel;
}

View File

@ -61,18 +61,17 @@ namespace SoftwareInstallationClientApp.Controllers
}
[HttpPost]
public void Create(string name, string address, DateTime date, int count)
public void Create(string name, string adress, DateTime date, int count)
{
if (APIClient.Access == false)
{
throw new Exception("Необходима авторизация");
}
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(address)
|| count <= 0)
if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(adress) || count <= 0)
{
throw new Exception("Введите название");
}
if (string.IsNullOrEmpty(address))
if (string.IsNullOrEmpty(adress))
{
throw new Exception("Введите адрес");
}
@ -83,7 +82,7 @@ namespace SoftwareInstallationClientApp.Controllers
APIClient.PostRequest("api/store/createstore", new StoreBindingModel
{
StoreName = name,
StoreAdress = address,
StoreAdress = adress,
PackageMaxCount = count,
OpeningDate = date
});
@ -125,7 +124,7 @@ namespace SoftwareInstallationClientApp.Controllers
}
[HttpPost]
public void Update(int store, string name, string address, DateTime date, int count)
public void Update(int store, string name, string adress, DateTime date, int count)
{
if (APIClient.Access == false)
{
@ -135,7 +134,7 @@ namespace SoftwareInstallationClientApp.Controllers
{
throw new Exception("Название магазина не может быть пустым");
}
if (string.IsNullOrEmpty(address))
if (string.IsNullOrEmpty(adress))
{
throw new Exception("Адрес магазина не может быть пустым");
}
@ -147,7 +146,7 @@ namespace SoftwareInstallationClientApp.Controllers
{
Id = store,
StoreName = name,
StoreAdress = address,
StoreAdress = adress,
OpeningDate = date,
PackageMaxCount = count
});

View File

@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"IPAddress": "http://localhost:7051/",
"IPAddress": "https://localhost:7218/",
"PasswordStore": "password"
}