예제 #1
0
 public int AddEmp2Roles()
 {
     int role_id = int.Parse(Request["role_id"]);
     string emp_ids = Request["emp_ids"];
     var b = new AutekInfo.BLL.M_Emp_Role();
     emp_ids = emp_ids.Remove(emp_ids.Length-1,1);//去掉最后一个逗号
     string[] arr_ids = emp_ids.Split(',');
     foreach (string id in arr_ids)
     {
         var l = b.GetModelList(String.Format(" emp_id={0} and role_id={1}",id,role_id));
         if (l.Count < 1)
         {
             var m = new AutekInfo.Model.M_Emp_Role();
             m.emp_id = int.Parse(id);
             m.role_id = role_id;
             b.Add(m);
         }
     }
     return 1;
 }
예제 #2
0
 public string DelEmp2Roles()
 {
     string ids = Request.QueryString["ids"];
     var b = new AutekInfo.BLL.M_Emp_Role();
     return b.DeleteList(ids).ToString().ToLower();
 }