Example #1
0
        public IEnumerable<StaffRole> PostStaffRoleDeleteAll(StaffRole item)
        {
            objConn = objDB.EstablishConnection();
            List<StaffRole> staffroledelete = new List<StaffRole>();

            string strSQL = "UPDATE staffrole SET Deleted = '" + item.Deleted + "'";
            strSQL += "WHERE StaffRoleID = '" + item.StaffRoleID + "';";
            objDB.sqlExecute(strSQL, objConn);
            objConn.Close();

            return staffroledelete.ToArray();
        }
Example #2
0
        public IEnumerable<StaffRole> GetStaffRoleAll()
        {
            objConn = objDB.EstablishConnection();
            List<StaffRole> staff = new List<StaffRole>();
            string strSQL = "SELECT * FROM staffrole WHERE Deleted = 0";
            DataTable dt = objDB.List(strSQL, objConn);
            objConn.Close();
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    StaffRole staffData = new StaffRole();
                    staffData.StaffRoleID = Convert.ToInt32(dt.Rows[i]["StaffRoleID"].ToString());
                    staffData.StaffRoleName = dt.Rows[i]["StaffRoleName"].ToString();

                    staff.Add(staffData);
                }
            }
            return staff.ToArray();
        }
Example #3
0
        public StaffRole GetStaffRoleAll(int id)
        {
            objConn = objDB.EstablishConnection();
            StaffRole staffrole = new StaffRole();
            string strSQL = "SELECT * FROM staffrole sr INNER JOIN staffaccess sa ON sa.StaffRoleID = sr.StaffRoleID WHERE sr.StaffRoleID = '" + id + "'";
            DataTable dt = objDB.List(strSQL, objConn);
            objConn.Close();

            staffrole.StaffRoleID = Convert.ToInt32(dt.Rows[0]["StaffRoleID"].ToString());
            staffrole.StaffRoleName = dt.Rows[0]["StaffRoleName"].ToString();

            return staffrole;
        }
Example #4
0
 public IEnumerable<StaffRole> PostStaffRoleDelete(StaffRole item)
 {
     return repository.PostStaffRoleDeleteAll(item);
 }