public string AddPOMASTER(POMASTER _PODETAIL)
        {
            string Result = "Success";

            try
            {
                poDb.POMASTERs.Add(_PODETAIL);
                poDb.SaveChanges();
            }
            catch (Exception ex)
            {
                Result = ex.Message;
            }
            return(Result);
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }
        public string UpdatePOMASTER(POMASTER _POMASTER)
        {
            string Result = "Success";

            try
            {
                Purchase_Order_Processing_System.POMASTER _pomaster = poDb.POMASTERs.Where(x => x.PONO == _POMASTER.PONO).ToList().FirstOrDefault();
                _pomaster.PODATE    = _POMASTER.PODATE;
                _pomaster.PODETAILs = _POMASTER.PODETAILs;
                _pomaster.SUPLNO    = _POMASTER.SUPLNO;
                _pomaster.SUPPLIER  = _POMASTER.SUPPLIER;

                poDb.SaveChanges();
            }
            catch (Exception ex)
            {
                Result = ex.Message;
            }
            return(Result);
        }