Exemplo n.º 1
0
        public void Update(ComplaintRequest obj)
        {
            DataHandler dh = new DataHandler();

            dh.Update(string.Format(
                          "UPDATE dbo.ComplaintRequest SET description='{1}' WHERE ComplaintRequestID={0}",
                          obj.Id,
                          obj.Description
                          //obj.serviceContract.id
                          ));

            dh.Dispose();

            RequestController requestController = new RequestController();

            requestController.Update(obj);
        }
        public int Create(NewContractRequest obj)
        {
            DataHandler dh = new DataHandler();

            RequestController requestController = new RequestController();

            obj.Id = requestController.Create(obj);

            dh.Insert(string.Format(
                          "INSERT INTO NewContractRequest(NewContractRequestID, ServiceContractID) VALUES ({0}, null)",
                          obj.Id
                          ));

            dh.Dispose();

            return(obj.Id);
        }
Exemplo n.º 3
0
        public void Update(ServiceRequest obj)
        {
            DataHandler dh = new DataHandler();

            dh.Update(string.Format(
                          "UPDATE dbo.ServiceRequest SET description='{1}', jobStarted='{2}' WHERE ServiceRequestID={0}",
                          obj.Id,
                          obj.Description,
                          obj.JobStarted == null ? null : obj.JobStarted.Value.ToString("yyyy-MM-dd HH:mm:ss.fff")
                          ));

            dh.Dispose();

            RequestController requestController = new RequestController();

            requestController.Update(obj);
        }
Exemplo n.º 4
0
        public int Create(ComplaintRequest obj)
        {
            DataHandler dh = new DataHandler();

            RequestController requestController = new RequestController();

            obj.Id = requestController.Create(obj);

            dh.Insert(string.Format(
                          "INSERT INTO ComplaintRequest(ComplaintRequestID, ServiceContractID, description) VALUES ({0}, null, '{1}')",
                          obj.Id,
                          obj.Description
                          ));

            dh.Dispose();

            return(obj.Id);
        }
Exemplo n.º 5
0
        public int Create(ServiceRequest obj)
        {
            DataHandler dh = new DataHandler();

            RequestController requestController = new RequestController();

            obj.Id = requestController.Create(obj);

            string query = string.Format(
                "INSERT INTO ServiceRequest(ServiceRequestID, description, jobStarted) VALUES ({0}, '{1}', '{2}')",
                obj.Id,
                obj.Description,
                obj.JobStarted == null ? null : obj.JobStarted.Value.ToString("yyyy-MM-dd HH:mm:ss.fff")
                );

            dh.Insert(query);

            dh.Dispose();

            return(obj.Id);
        }
        public void Update(NewContractRequest obj)
        {
            RequestController requestController = new RequestController();

            requestController.Update(obj);
        }