Ejemplo n.º 1
0
        private void btnComplete_Click(object sender, EventArgs e)
        {
            var pudoService = new RelOrderPickUpDropOffLocationService();
            var pudo = new RelOrderPickUpDropOffLocation();
            if (isNewRecord)
            {
                pudo.ReleaseOrderId = My.MyProject.Forms.FrmUpdateReqStatus.SelectedReleaseOrder.ReleaseOrderId;
            }
            else
            {
                pudo = RelOrderPickUpDropOffLocationService.GetById(relPuDol.RelOrderPickUpDropOffLocationId);
            }

            pudo.PickUpTerminalId = Conversions.ToInteger(cbPickUp.SelectedValue);
            pudo.DropOffYardLocationId = Conversions.ToInteger(cbDropOff.SelectedValue);
            pudo.QtyPickUpDropOff = (int)Math.Round(nudQtyCans.Value);
            if (pudoService.AddOrUpdate(pudo))
            {
                Close();
            }
            else
            {
                My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("An error occurred", "Something happened and the information was not saved", this);
            }
        }
Ejemplo n.º 2
0
        public bool AddOrUpdate(RelOrderPickUpDropOffLocation relOrderPickUpDropOffLocation)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    db.RelOrderPickUpDropOffLocation.AddOrUpdate(relOrderPickUpDropOffLocation);
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    string msg = ex.InnerException.Message;
                    isSaved = false;
                }
            }

            return(isSaved);
        }
Ejemplo n.º 3
0
        public bool Delete(int RelOrderPickUpDropOffLocationId)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    RelOrderPickUpDropOffLocation rel = db.RelOrderPickUpDropOffLocation.Find(RelOrderPickUpDropOffLocationId);
                    db.RelOrderPickUpDropOffLocation.Remove(rel);
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    string msg = ex.InnerException.Message;
                    isSaved = false;
                }
            }

            return(isSaved);
        }
Ejemplo n.º 4
0
 public bool AddOrUpdate(RelOrderPickUpDropOffLocation relOrderPickUpDropOffLocation)
 {
     return(repository.AddOrUpdate(relOrderPickUpDropOffLocation));
 }