public string AddPODETAIL(PODETAIL _PODETAIL)
        {
            string Result = "Success";

            try
            {
                poDb.PODETAILs.Add(_PODETAIL);
                poDb.SaveChanges();
            }
            catch (Exception ex)
            {
                Result = ex.Message;
            }
            return(Result);
        }
        public string UpdatePODETAIL(PODETAIL _PODETAIL)
        {
            string Result = "Success";

            try
            {
                Purchase_Order_Processing_System.PODETAIL _podetail = poDb.PODETAILs.Where(x => x.PONO == _PODETAIL.PONO).ToList().FirstOrDefault();
                _podetail.ITCODE   = _PODETAIL.ITCODE;
                _podetail.ITEM     = _PODETAIL.ITEM;
                _podetail.POMASTER = _PODETAIL.POMASTER;
                _podetail.QTY      = _PODETAIL.QTY;
                poDb.SaveChanges();
            }
            catch (Exception ex)
            {
                Result = ex.Message;
            }
            return(Result);
        }
Example #3
0
        public void UpdatePurchaseOrder(PurchaseOrderModel POModel)
        {
            var dbMaster = new POMASTER
            {
                PONO   = POModel.PONumber,
                PODATE = POModel.Date,
                SUPLNO = POModel.SupplierNumber
            };

            var dbDetail = new PODETAIL
            {
                PONO   = POModel.PONumber,
                ITCODE = POModel.ItemCode,
                QTY    = POModel.Quantity
            };

            dbContext.Entry(dbMaster).State = EntityState.Modified;
            dbContext.Entry(dbDetail).State = EntityState.Modified;
            dbContext.SaveChanges();
        }
Example #4
0
        ///////////////

        public void CreatePurchaseOrder(PurchaseOrderModel POModel)
        {
            var dbMaster = new POMASTER
            {
                PONO   = POModel.PONumber,
                PODATE = POModel.Date,
                SUPLNO = POModel.SupplierNumber
            };

            var dbDetail = new PODETAIL
            {
                PONO   = POModel.PONumber,
                ITCODE = POModel.ItemCode,
                QTY    = POModel.Quantity
            };

            dbContext.POMASTER.Add(dbMaster);
            dbContext.PODETAIL.Add(dbDetail);
            dbContext.SaveChanges();
        }