Esempio n. 1
0
 public ActionResult Del(EmpMod empMod)
 {
     return Json(empModOper.Del(empMod));
 }
Esempio n. 2
0
 public ActionResult Add(EmpMod empMod)
 {
     return Json(empModOper.Add(empMod));
 }
Esempio n. 3
0
 public ActionResult Update(EmpMod empMod)
 {
     return Json(empModOper.Update(empMod));
 }
Esempio n. 4
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);
            }
        }