コード例 #1
0
        public IQueryable <ShipmentActivity> getShipmentList()
        {
            var db = new ShipmentActivityContext();
            IQueryable <ShipmentActivity> query = db.ShipmentActivities;

            System.Diagnostics.Debug.WriteLine("CMS Debug: Querying Shipment Activities");
            return(query);
        }
コード例 #2
0
        protected void deleteRecord(object sender, EventArgs e)
        {
            var db = new ShipmentActivityContext();
            IQueryable <ShipmentActivity> query = db.ShipmentActivities;
            int sid = Int32.Parse(shipmentid.Value);

            query = query.Where(p => p.ShipmentID == sid);
            if (query.Count() != 0)
            {
                db.Entry(query.First()).State = System.Data.Entity.EntityState.Deleted;
                db.SaveChanges();
            }
        }
コード例 #3
0
        protected void getRecord(object sender, EventArgs e)
        {
            var db = new ShipmentActivityContext();
            IQueryable <ShipmentActivity> query = db.ShipmentActivities;
            int sid = Int32.Parse(shipmentid.Value);

            query = query.Where(p => p.ShipmentID == sid);
            var shipdata = query.First();

            shipname.Value         = shipdata.Shipname;
            shipmentsize.Value     = shipdata.ShipmentSize;
            shipmentdate.Value     = shipdata.ShipmentDate;
            shipmentlocation.Value = shipdata.ShipmentLocation;
            shipmentstatus.Value   = shipdata.ShipmentStatus;
        }
コード例 #4
0
        protected void addRecord(object sender, EventArgs e)
        {
            //System.Diagnostics.Debug.WriteLine(shipname.Value);

            var newshipinfo = new ShipmentActivity
            {
                Shipname         = shipname.Value,
                ShipmentSize     = shipmentsize.Value,
                ShipmentDate     = shipmentdate.Value,
                ShipmentLocation = shipmentlocation.Value,
                ShipmentStatus   = shipmentstatus.Value
            };

            var db = new ShipmentActivityContext();

            db.ShipmentActivities.Add(newshipinfo);
            db.SaveChanges();

            Response.Redirect(Request.RawUrl);
        }
コード例 #5
0
        protected void updateRecord(object sender, EventArgs e)
        {
            int sid         = Int32.Parse(shipmentid.Value);
            var newshipinfo = new ShipmentActivity
            {
                ShipmentID       = sid,
                Shipname         = shipname.Value,
                ShipmentSize     = shipmentsize.Value,
                ShipmentDate     = shipmentdate.Value,
                ShipmentLocation = shipmentlocation.Value,
                ShipmentStatus   = shipmentstatus.Value
            };

            var db = new ShipmentActivityContext();

            db.Entry(newshipinfo).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();

            Response.Redirect(Request.RawUrl);
        }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var db = new ShipmentActivityContext();
     IQueryable <ShipmentActivity> query        = db.ShipmentActivities;
     List <ShipmentActivity>       shipmentlist = query.ToList();
 }