예제 #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
예제 #2
0
        }                                                                                    //End public void Update

        public void Delete(int?id)
        {
            try
            {
                //Employee
                this.oModel = this.db.Employeeuser_infos.Find(id);
                this.oCRUD.Delete(this.oModel.ID);
                this.oCRUD.Commit();
                if (!this.oCRUD.isERR)
                {
                    //User
                    this.oCRUD_user.Delete(this.oModel.EMPUSER_ID);
                    this.oCRUD_user.Commit();
                }                                                                            //End if
            }                                                                                //End try
            catch (Exception e) { isERR = true; this.ERRMSG = "CRUD - Delete" + e.Message; } //End catch
        }                                                                                    //End public void Delete