Esempio n. 1
0
        }                                                                                      //End public void Create

        public void Update(EmployeeuserVM poViewModel, HttpPostedFileBase poFileimage = null)
        {
            try
            {
                this.oModel = this.db.Employeeuser_infos.AsNoTracking().SingleOrDefault(fld => fld.ID == poViewModel.ID);
                this.oVM    = new EmployeeVM();
                this.oVM.InjectFrom(oModel);
                this.oVM_user = new UserdetailVM();

                this.oViewModel            = poViewModel;
                this.oViewModel.EMPUSER_ID = this.oModel.EMPUSER_ID;
                //Employee
                this.mapEmployee();
                this.oCRUD.Update(oVM, poFileimage);
                this.oCRUD.Commit();
                this.ID = this.oCRUD.ID;
                if (!this.oCRUD.isERR)
                {
                    //User
                    this.mapUser();
                    this.oCRUD_user.Update(oVM_user, poFileimage);
                    this.oCRUD_user.Commit();
                }                                                                            //End if
            }                                                                                //End try
            catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Update" + e.Message; } //End catch
        }                                                                                    //End public void Update
Esempio n. 2
0
        } //End public EmployeeuserCRUD()

        //ACTION
        public void Create(EmployeeuserVM poViewModel, HttpPostedFileBase poFileimage = null)
        {
            try
            {
                this.oViewModel = poViewModel;
                //Employee
                this.mapEmployee();
                this.oCRUD.Create(oVM, poFileimage);
                this.oCRUD.Commit();
                this.ID = this.oCRUD.ID;
                if (!this.oCRUD.isERR)
                {
                    //user
                    this.mapUser();
                    this.oCRUD_user.Create(oVM_user, poFileimage);
                    this.oCRUD_user.Commit();
                }                                                                              //End if
            }                                                                                  //End try
            catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Create: " + e.Message; } //End catch
        }                                                                                      //End public void Create
Esempio n. 3
0
        } //End Constructor 1

        //Constructor 2
        public Employeeuser_Validation(EmployeeuserVM poViewModel, EmployeeuserDS poDS)
        {
            this.oViewModel = poViewModel;
            this.oDS        = poDS;
            aValidationMSG  = new List <ValidationMSG_VM>();
        } //End Constructor 2