예제 #1
0
        public FrayteResult AssignJobToOperator(OpeartorJob job)
        {
            FrayteResult result = new FrayteResult();

            try
            {
                if (job != null && job.OperatorId > 0 && job.jobs != null && job.jobs.Count > 0)
                {
                    foreach (var data in job.jobs)
                    {
                        var ship = dbContext.eCommerceShipments.Find(data.ShipmentId);
                        if (ship != null)
                        {
                            ship.AssignedTo = job.OperatorId;
                            //dbContext.Entry<ship>
                            dbContext.SaveChanges();
                            result.Status = true;
                        }
                    }
                }
                else
                {
                    result.Status = false;
                }
                return(result);
            }
            catch (Exception ex)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                result.Status = false;
                return(result);
            }
        }
예제 #2
0
 public IHttpActionResult AsssignJobs(OpeartorJob jobs)
 {
     try
     {
         FrayteResult result = new FrayteResult();
         result = new HsCodeJobRepository().AssignJobToOperator(jobs);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
         return(BadRequest("Couls not Complete the request."));
     }
 }