Ejemplo n.º 1
0
        }                                                 //End public void Update

        public void Delete(string id)
        {
            string vsMsgErr = "";

            try
            {
                using (var db = new DBMAINContext())
                {
                    Config_cparid oModel = db.Config_cparids.Find(id);
                    db.Config_cparids.Remove(oModel);
                    db.SaveChanges();
                }                                         //End using
            }                                             //End try
            catch (Exception e) { vsMsgErr = e.Message; } //End catch
        }                                                 //End public void Delete
Ejemplo n.º 2
0
        }                                                 //End public void Delete

        public void Create_prepare(Config_cparid_DetailVM poViewModel)
        {
            string vsMsgErr = "";

            try
            {
                using (var db = new DBMAINContext())
                {
                    Config_cparid oModel = new Config_cparid();
                    //Map Form Data
                    Mapper.CreateMap <Config_cparid_DetailVM, Config_cparid>();
                    oModel = Mapper.Map <Config_cparid_DetailVM, Config_cparid>(poViewModel);
                    //Set Field Header
                    oModel.setFIELD_HEADER(hlpFlags_CRUDOption.CREATE);
                    this.oModel = oModel;
                }                                         //End using
            }                                             //End try
            catch (Exception e) { vsMsgErr = e.Message; } //End catch
        }                                                 //End public void Create_prepare(Config_cparid_DetailVM poViewModel)
Ejemplo n.º 3
0
        }                                                 //End public void Create_prepare(Config_cparid_DetailVM poViewModel)

        public void Update_prepare(Config_cparid_DetailVM poViewModel)
        {
            string vsMsgErr = "";

            try
            {
                using (var db = new DBMAINContext())
                {
                    Config_cparid oModel = db.Config_cparids.AsNoTracking().SingleOrDefault(fld => fld.RUID == poViewModel.RUID);
                    //Map Form Data
                    Mapper.CreateMap <Config_cparid_DetailVM, Config_cparid>();
                    oModel = Mapper.Map <Config_cparid_DetailVM, Config_cparid>(poViewModel);
                    //Set Field Header
                    oModel.setFIELD_HEADER(hlpFlags_CRUDOption.UPDATE);
                    this.oModel = oModel;
                }                                         //End using
            }                                             //End try
            catch (Exception e) { vsMsgErr = e.Message; } //End catch
        }                                                 //End public Config_cparid Update_prepare(Config_cparid_DetailVM poViewModel)