Пример #1
0
        public ActionResult GetMyModFunc()
        {
            IList<EmpModFunc> retVal = new List<EmpModFunc>();

            foreach (EmpModFunc empModFunc in MyModFunc)
            {
                EmpModFunc emf = new EmpModFunc();
                emf.ModFunc = new ModFunc();
                emf.ModFunc.Cls = empModFunc.ModFunc.Cls;
                emf.FuncNames = empModFunc.FuncNames;
                retVal.Add(emf);
            }

            return Json(retVal);
        }
        public IList<EmpModFunc> GetEmpModFuncs(EmpModFunc.RoleFlagVal roleFlag,Guid id)
        {
            IList<EmpModFunc> retVal = empModFuncOper.Get(
                delegate(object sender, ICriteria criteria)
                {
                    ICriterion criterion = null;

                    string strRoleFlag = EmpModFunc.RoleFlagValStr(roleFlag);
                    criterion = Restrictions.Eq("RoleFlag", strRoleFlag);
                    criteria.Add(criterion);
                    criterion = Restrictions.Eq("RoleId", id);
                    criteria.Add(criterion);
                }
                );
            return retVal;
        }
Пример #3
0
 public ActionResult Del(EmpModFunc empModFunc)
 {
     return Json(empModFuncOper.Del(empModFunc));
 }
Пример #4
0
 public ActionResult Update(EmpModFunc empModFunc)
 {
     return Json(empModFuncOper.Update(empModFunc));
 }
Пример #5
0
 public ActionResult Add(EmpModFunc empModFunc)
 {
     return Json(empModFuncOper.Add(empModFunc));
 }
 public IList<EmpModFunc> GetEmpModFunc()
 {
     IList<EmpModFunc> retVal = new List<EmpModFunc>();
     
     foreach (EmpModFunc empModFunc in CurEmpModFunc)
     {
         EmpModFunc emf = new EmpModFunc();
         emf.ModFunc = new ModFunc();
         emf.ModFunc.Cls = empModFunc.ModFunc.Cls;
         emf.ModFunc.FuncName = empModFunc.ModFunc.FuncName;
         retVal.Add(emf);
     }
     
     return retVal;
 }
Пример #7
0
        public void Init2()
        {
            try
            {
                //给员工初始化
                Employee e = new Employee();
                e.Code = "999";
                e.Name = "System";
                e.Pwd = "123456";
                e.Birthday = DateTime.Now;
                e.Entry = DateTime.Now;
                TbBaseOper<Employee> employeeOper = new TbBaseOper<Employee>(HibernateFactory.GetInstance(), typeof(Employee));
                employeeOper.Add(e);

                TbBaseOper<EmpModFunc> emfOper = new TbBaseOper<EmpModFunc>(HibernateFactory.GetInstance(), typeof(EmpModFunc));
                IList<ModFunc> funcs = modFuncOper.Get();

                foreach (ModFunc mf in funcs)
                {
                    EmpModFunc emf = new EmpModFunc();
                    emf.Emp = e;
                    emf.ModFunc = mf;
                    emf.FuncNames = "|Add|Update|Del|Get|";
                    emfOper.Add(emf);
                }

                TbBaseOper<EmpMod> emOper = new TbBaseOper<EmpMod>(HibernateFactory.GetInstance(), typeof(EmpMod));
                IList<Mod> mods = modOper.Get();

                foreach (Mod m in mods)
                {
                    EmpMod em = new EmpMod();
                    em.Emp = e;
                    em.Mod = m;
                    emOper.Add(em);
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
        }