Exemplo n.º 1
0
        public string CreateRequest(string clientName, int masterId, int operatorId, int serviceId, string comment,
            string adress, DateTime requestDate, DateTime closeDate, DateTime dateOfDeparture)
        {
            Clients client = new Clients();
            client.FullName = clientName;

            string message;
            this.secondaryRepo.CreateClient(client);
            message = "Заявка добавлена успешно";

            Requests request = new Requests();

            request.ClientId = client.Id;
            request.MasterId = masterId;
            request.OperatorId = operatorId;
            request.ServiceId = serviceId;
            request.Comment = comment;
            request.Address = adress;
            request.RequestDate = requestDate;
            request.CloseDate = closeDate;
            request.DateOfDeparture = dateOfDeparture;

            requestRepo.CreateRequest(request);
            return message;
        }
Exemplo n.º 2
0
 public Clients CreateClient(Clients client)
 {
     db.Clients.InsertOnSubmit(client);
     db.SubmitChanges();
     return client;
 }
Exemplo n.º 3
0
        public string UpdateRequest(Requests request, string clientName, int masterId, int operatorId, int serviceId, string comment, 
            string adress, DateTime requestDate, DateTime closeDate, DateTime dateOfDeparture)
        {
            Clients client = new Clients();
            client.FullName = clientName;
            request.Clients = secondaryRepo.CreateClient(client);
            request.Masters = GetMasterExact(masterId);
            request.Operators = GetOperatorExact(operatorId);
            request.Services = GetServiceExact(serviceId);
            request.Address = adress;
            request.Comment = comment;
            request.RequestDate = requestDate;
            request.CloseDate = closeDate;
            request.DateOfDeparture = dateOfDeparture;

            requestDBContext.SubmitChanges();
            requestRepo.UpdateRequest(request);

            return "Заявка успешно изменена";
        }
Exemplo n.º 4
0
 partial void DeleteClients(Clients instance);
Exemplo n.º 5
0
 partial void UpdateClients(Clients instance);
Exemplo n.º 6
0
 partial void InsertClients(Clients instance);