Ejemplo n.º 1
0
 public void DeleteCost(int id)
 {
     APIWorker.PostRequest("api/main/deletecosts", new CostBindingModel {
         Id = id
     });
     Response.Redirect("../Cost");
 }
Ejemplo n.º 2
0
 public void DeleteWork(int id)
 {
     APIWorker.PostRequest("api/main/deleteworks", new WorkBindingModel {
         Id = id
     });
     Response.Redirect("../Index");
 }
Ejemplo n.º 3
0
        public void BindCost(int id, string costName, decimal costPrice, int request)
        {
            RequestViewModel Request = APIWorker.GetRequest <RequestViewModel>($"api/main/getrequestnl?Id={request}");
            Dictionary <int, (string, decimal)> requestCost = Request.RequestCosts;

            if (requestCost.ContainsKey(Convert.ToInt32(id)))
            {
                requestCost[id] = (costName, costPrice);
            }
            else
            {
                requestCost.Add(id, (costName, costPrice));
            }

            APIWorker.PostRequest("api/main/updaterequests", new RequestBindingModel
            {
                Id           = Request.Id,
                ClientId     = Request.ClientId,
                RequestName  = Request.RequestName,
                RequestWorks = Request.RequestWorks,
                RequestCosts = Request.RequestCosts,
            });

            Response.Redirect("../Cost");
        }
Ejemplo n.º 4
0
        public void CreateCost(string costName, decimal costPrice)
        {
            APIWorker.PostRequest("api/main/createorupdatecosts", new CostBindingModel
            {
                WorkerId  = Program.Worker.Id,
                CostName  = costName,
                CostPrice = costPrice
            });

            Response.Redirect("Cost");
        }
Ejemplo n.º 5
0
        public void CreateWork(string workName, decimal workPrice)
        {
            APIWorker.PostRequest("api/main/creatework", new WorkBindingModel
            {
                WorkerId  = Program.Worker.Id,
                WorkName  = workName,
                WorkPrice = workPrice
            });

            Response.Redirect("Index");
        }
Ejemplo n.º 6
0
        public void UpdateCost(int id, string costName, decimal costPrice)
        {
            var Cost = APIWorker.GetRequest <WorkerViewModel>($"api/main/getcosts?costId={id}");

            APIWorker.PostRequest("api/main/createorupdatecost", new CostBindingModel
            {
                Id        = id,
                WorkerId  = Cost.WorkerId,
                CostName  = costName,
                CostPrice = costPrice
            });

            Response.Redirect("../Cost");
        }
Ejemplo n.º 7
0
        public void UpdateWork(int id, string workName, decimal workPrice)
        {
            var Work = APIWorker.GetRequest <WorkerViewModel>($"api/main/getworks?workId={id}");

            APIWorker.PostRequest("api/main/updateworks", new WorkBindingModel
            {
                Id        = id,
                WorkerId  = Work.WorkerId,
                WorkName  = workName,
                WorkPrice = workPrice
            });

            Response.Redirect("../Index");
        }
Ejemplo n.º 8
0
 public void Register(string fio, string email, string password, string numberPhone)
 {
     if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password))
     {
         APIWorker.PostRequest("api/worker/register", new WorkerBindingModel
         {
             FIO         = fio,
             Email       = email,
             Password    = password,
             NumberPhone = numberPhone,
         });
         Response.Redirect("Enter");
         return;
     }
     throw new Exception("Введите email и пароль");
 }
Ejemplo n.º 9
0
 public void Privacy(string email, string password)
 {
     if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password))
     {
         APIWorker.PostRequest("api/worker/updatedata", new WorkerBindingModel
         {
             Id       = Program.Worker.Id,
             Email    = email,
             Password = password,
         });
         Program.Worker.Email    = email;
         Program.Worker.Password = password;
         Response.Redirect("Index");
         return;
     }
     throw new Exception("Введите логин и пароль");
 }