Ejemplo n.º 1
0
        public IEnumerable<PermissionItem> PostPermissionItemAll(PermissionItem item)
        {
            objConn = objDB.EstablishConnection();
            List<PermissionItem> permissionItem = new List<PermissionItem>();
            string strSQL = "SELECT PermissionItemID FROM staffrole sr INNER JOIN staffaccess sa ON sa.StaffRoleID = sr.StaffRoleID WHERE sr.StaffRoleID = '"+item.StaffRoleID+"';";
            DataTable dt = objDB.List(strSQL, objConn);
            objConn.Close();

            PermissionItem PermissionItem = new PermissionItem();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (i == 0)
                        PermissionItem.PermissionItemID += Convert.ToInt32(dt.Rows[i]["PermissionItemID"].ToString());
                    else
                        PermissionItem.PermissionItemID += "," + Convert.ToInt32(dt.Rows[i]["PermissionItemID"].ToString());

                }
            }
            permissionItem.Add(PermissionItem);

            return permissionItem.ToArray();
        }
Ejemplo n.º 2
0
 public IEnumerable<PermissionItem> PostPermissionItem(PermissionItem item)
 {
     return repository.PostPermissionItemAll(item);
 }