/// <summary> /// method /// saves the checklist's read only roles in the database /// </summary> /// <param name="lStatusCode"></param> /// <param name="strStatusComment"></param> /// <returns></returns> protected CStatus SaveCLReadOnly() { CChecklistData cld = new CChecklistData(BaseMstr.BaseData); CStatus status = cld.DeleteAllCLReadOnlyRoles(ChecklistID); if (!status.Status) { return(status); } foreach (ListItem li in cblReadOnly.Items) { if (li.Selected) { CCLReadOnlyDataItem di = new CCLReadOnlyDataItem(); di.ChecklistID = ChecklistID; di.UserRoleID = Convert.ToInt32(li.Value); status = cld.InsertCLReadOnlyRole(di); if (!status.Status) { return(status); } } } return(new CStatus()); }
/// <summary> /// Used to insert read only roles for a checklist /// </summary> /// <param name="cli"></param> /// <param name="lStatusCode"></param> /// <param name="strStatus"></param> /// <returns></returns> public CStatus InsertCLReadOnlyRole(CCLReadOnlyDataItem cli) { //create a status object and check for valid dbconnection CStatus status = new CStatus(); status = DBConnValid(); if (!status.Status) { return(status); } //load the paramaters list CParameterList pList = new CParameterList(SessionID, ClientIP, UserID); //add the rest of the parameters pList.AddInputParameter("pi_nChecklistID", cli.ChecklistID); pList.AddInputParameter("pi_nUserRoleID", cli.UserRoleID); //execute the SP return(DBConn.ExecuteOracleSP("PCK_CHECKLIST.InsertCLReadOnlyRole", pList)); }