Esempio n. 1
0
        }                                   //End Constructor

        public Transaction_inddetailVM setMonthRange(Transaction_indetailVM poViewModel, Transaction_inddetailVM poViewModel_detail)
        {
            Transaction_indetailVM  oViewModel = poViewModel;
            Transaction_inddetailVM vResult    = poViewModel_detail;

            try
            {
                vResult.TRND_ITEMID = oViewModel.MONTH1;
                vResult.TRND_QTY    = (oViewModel.MONTH2 - oViewModel.MONTH1) + 1;
            }                                                                                                            //End try
            catch (Exception e) { this.isERR = true; this.ERRMSG = "Error service worker setMonthRange: " + e.Message; } //End catch
            return(vResult);
        }                                                                                                                //End public void Update
Esempio n. 2
0
 } //End public void Create
 public void Update(Transaction_inddetailVM poViewModel)
 {
     try
     {
         this.oModel = this.db.Transaction_inds.AsNoTracking().SingleOrDefault(fld => fld.ID == poViewModel.ID);
         //Map Form Data
         this.oModel.InjectFrom(poViewModel);
         //Set Field Header
         this.oModel.setFIELD_HEADER(hlpFlags_CRUDOption.UPDATE);
         //Set DTA_STS
         this.oModel.DTA_STS = valFLAG.FLAG_DTA_STS_UPDATE;
         //Process CRUD
         this.db.Entry(oModel).State = EntityState.Modified;
         this.db.SaveChanges();
         this.ID = this.oModel.ID;
     } //End try
     catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Update" + e.Message; } //End catch
 } //End public void Update
Esempio n. 3
0
 } //End Constructor
 public void Create(Transaction_inddetailVM poViewModel)
 {
     try
     {
         this.oModel = new Transaction_ind();
         //Map Form Data
         this.oModel.InjectFrom(poViewModel);
         //Set Field Header
         this.oModel.setFIELD_HEADER(hlpFlags_CRUDOption.CREATE);
         //Set DTA_STS
         this.oModel.DTA_STS = valFLAG.FLAG_DTA_STS_CREATE;
         //Process CRUD
         this.db.Transaction_inds.Add(oModel);
         this.db.SaveChanges();
         this.ID = oModel.ID;
     } //End try
     catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Create: " + e.Message; } //End catch
 } //End public void Create
Esempio n. 4
0
        }                                   //End constructor

        public Transaction_inddetailVM Update_mapper(Transaction_indetailVM poViewModel, Transaction_inddetailVM poViewModel_detail)
        {
            Transaction_indetailVM  oViewModel = poViewModel;
            Transaction_inddetailVM vResult    = poViewModel_detail;

            try
            {
                //Actual
                vResult.TRND_PRICE  = oViewModel.TRN_AMOUNT;
                vResult.TRND_AMOUNT = oViewModel.TRN_AMOUNT;
                //Base
                vResult.TRND_PRICEBASE  = oViewModel.TRN_AMOUNT;
                vResult.TRND_AMOUNTBASE = oViewModel.TRN_AMOUNT;
                vResult.TRND_QTYBASE    = vResult.TRND_QTY;
                vResult.TRND_DESC       = oViewModel.TRN_DESC;
            }                                                                                                   //End try
            catch (Exception e) { this.isERR = true; this.ERRMSG = "Error mapping CRUD Update: " + e.Message; } //End catch

            return(vResult);
        } //End method