Esempio n. 1
0
        public bool DeleteGrainInventoryTransfer(int GrainInventoryTransferId)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    gitr = db.GrainInventoryTransfer.Find(GrainInventoryTransferId);
                    db.GrainInventoryTransfer.Remove(gitr);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    var msg = e.Message;
                    isSaved = false;
                }
            }
            return(isSaved);
        }
Esempio n. 2
0
        public bool UpdateGrainInventoryTransfer(int GrainInventoryTransferId, int GiverGrainInventoryId, int ReceiverGrainInventoryId, int GrainInventoryTransactionId)
        {
            bool isSaved = true;

            using (WTCCeresEntities db = new WTCCeresEntities())
            {
                try
                {
                    gitr = db.GrainInventoryTransfer.Find(GrainInventoryTransferId);
                    gitr.GiverGrainInventoryId       = GiverGrainInventoryId;
                    gitr.ReceiverGrainInventoryId    = ReceiverGrainInventoryId;
                    gitr.GrainInventoryTransactionId = GrainInventoryTransactionId;
                    db.GrainInventoryTransfer.AddOrUpdate(gitr);
                    db.SaveChanges();
                }
                catch (Exception e)
                {
                    var msg = e.Message;
                    isSaved = false;
                }
            }
            return(isSaved);
        }