コード例 #1
0
        public bool Delete(int MinibookingMiniUnitAssignmentId, bool IsStorageUnit)
        {
            bool isDeleted = true;

            try
            {
                using (WTCCeresEntities db = new WTCCeresEntities())
                {
                    if (IsStorageUnit == false)
                    {
                        bus = db.MinibookingMiniUnitAssignment.Find(MinibookingMiniUnitAssignmentId);
                        db.MinibookingMiniUnitAssignment.Remove(bus);
                    }
                    else
                    {
                        gima = db.GrainInvMinibookingAssignment.Find(MinibookingMiniUnitAssignmentId);
                        db.GrainInvMinibookingAssignment.Remove(gima);
                    }

                    db.SaveChanges();
                }
            }
            catch
            {
                isDeleted = false;
            }
            return(isDeleted);
        }
コード例 #2
0
        public bool UpdateGrainInvMinibookingAssignment(int GrainInvMinibookingAssignmentId, int MinibookingId, int GrainInvStorageLocationId, double QuantityAssigned, DateTime AssignedAt)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    gima = db.GrainInvMinibookingAssignment.Find(GrainInvMinibookingAssignmentId);
                    gima.MinibookingId             = MinibookingId;
                    gima.GrainInvStorageLocationId = GrainInvStorageLocationId;
                    gima.QuantityAssigned          = QuantityAssigned;
                    gima.AssignedAt = AssignedAt;

                    db.GrainInvMinibookingAssignment.AddOrUpdate(gima);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    var msg = e.Message;
                    isSaved = false;
                }
            }
            return(isSaved);
        }
コード例 #3
0
        public bool DeleteGrainInvMinibookingAssignment(int GrainInvMinibookingAssignmenId)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    gima = db.GrainInvMinibookingAssignment.Find(GrainInvMinibookingAssignmenId);
                    db.GrainInvMinibookingAssignment.Remove(gima);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    var msg = e.Message;
                    isSaved = false;
                }
            }
            return(isSaved);
        }