/// <summary> /// Method to Get Menus. /// </summary> /// <param name="argEn">Menu Entity is an Input.MenuID is an Input Property</param> /// <returns>List of Menu Entity</returns> public MenuEn GetMenus(MenuEn argEn) { MenuEn loEnList = new MenuEn(); string sqlCmd = "select PageName from UR_MenuMaster where MenuID ='" + argEn.MenuId + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { loEnList = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get Cheque Item /// </summary> /// <param name="argEn">Cheques Entity is an Input.ProcessID is Input Property.</param> /// <returns>Returns a Cheque Item</returns> public ChequeEn GetItem(ChequeEn argEn) { ChequeEn loItem = new ChequeEn(); string sqlCmd = "Select * FROM SAS_Cheque WHERE ProcessID = @ProcessID"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@ProcessID", DbType.String, argEn.ProcessID); _DbParameterCollection = cmd.Parameters; using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { if (loReader != null) { loReader.Read(); loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
/// <summary> /// Method to Get DegreeType Entity /// </summary> /// <param name="argEn">DegreeType Entity is an Input</param> /// <returns>Returns DegreeType Entity</returns> public DegreeTypeEn GetItem(DegreeTypeEn argEn) { DegreeTypeEn loItem = new DegreeTypeEn(); string sqlCmd = "Select * FROM SAS_DegreeType WHERE SADT_Code = @SADT_Code"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { if (loReader != null) { loReader.Read(); loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
public int UpdateReviewApprove(int WorkflowId, short WorkflowStatus, string WorkFlowRole, string UserId) { //variable declarations string SqlStatement = null; try { //Build Sql Statement - Start SqlStatement += "INSERT INTO sas_workflow_status(workflow_id, workflow_status, date_time, workflow_role,user_name) VALUES ("; //SqlStatement += clsGeneric.AddComma() + WorkflowId; SqlStatement += WorkflowId; SqlStatement += clsGeneric.AddComma() + WorkflowStatus; SqlStatement += clsGeneric.AddComma() + clsGeneric.AddQuotes(Helper.DateConversion(DateTime.Now)); SqlStatement += clsGeneric.AddComma() + clsGeneric.AddQuotes(WorkFlowRole); SqlStatement += clsGeneric.AddComma() + clsGeneric.AddQuotes(UserId); SqlStatement += ")"; //Build Sql Statement - Stop if (!FormHelp.IsBlank(SqlStatement)) { //track workdflow status - start return(_DatabaseFactory.ExecuteSqlStatement(Helper.GetDataBaseType, DataBaseConnectionString, SqlStatement)); //track workdflow status - stop } return(1); } catch (Exception ex) { MaxModule.Helper.LogError(ex.Message); return(-1); } }
public List <WorkflowEn> GetList() { List <WorkflowEn> loEnList = new List <WorkflowEn>(); string sqlCmd = "SELECT * FROM sas_workflow"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { WorkflowEn loItem = LoadObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of Menus /// </summary> /// <param name="argEn">StudentCategoryAccess Entity as an Input.MenuName as Input Property.</param> /// <returns>Returns List of StudentCategoryAccess</returns> public List <StudentCategoryAccessEn> GetMenuList(StudentCategoryAccessEn argEn) { List <StudentCategoryAccessEn> loEnList = new List <StudentCategoryAccessEn>(); string sqlCmd = "select * from UR_MenuMaster where MenuID <> 114 AND status = true AND MenuName= '" + argEn.MenuName + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { StudentCategoryAccessEn loItem = LoadMenuObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of All StudentCategoryAccess /// </summary> /// <param name="argEn">StudentCategoryAccess Entity as an Input.StudentCategoryCode as Input Property.</param> /// <returns>Returns List of StudentCategoryAccess</returns> public List <StudentCategoryAccessEn> GetStuCatAccessList(StudentCategoryAccessEn argEn) { List <StudentCategoryAccessEn> loEnList = new List <StudentCategoryAccessEn>(); string sqlCmd = "select SCA.MenuID,MM.MenuName,MM.PageName,SCA.Status,SCA.SASC_Code" + " from SAS_StudentCategoryAccess SCA INNER JOIN UR_MenuMaster MM" + " on SCA.MenuID=MM.MenuID where MM.MenuID <> 114 and SCA.SASC_Code=@SASC_Code"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SASC_Code", DbType.String, argEn.StudentCategoryCode); _DbParameterCollection = cmd.Parameters; using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { while (loReader.Read()) { StudentCategoryAccessEn loItem = LoadObject(loReader); loItem.MenuName = GetValue <string>(loReader, "MenuName"); loItem.PageName = GetValue <string>(loReader, "PageName"); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get StudentStatus Entity /// </summary> /// <param name="argEn">StudentStatus Entity is an Input.MatricNo as Input Property.</param> /// <returns>Returns StudentStatus Entity</returns> public StudentStatusEn GetItem(StudentStatusEn argEn) { StudentStatusEn loItem = new StudentStatusEn(); string sqlCmd = "Select * FROM SAS_StudentStatus WHERE SASS_Code = " + clsGeneric.AddQuotes(argEn.Code.ToString()); try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { if (loReader != null) { loReader.Read(); loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
/// <summary> /// Method to Get StudentStatus by StudentStatusCode /// </summary> /// <param name="argEn">StudentStatusCode as an Input.</param> /// <returns>Returns StudentStatus Entity</returns> public StudentStatusEn GetStudentBlStatus(string argEn) { StudentStatusEn loItem = new StudentStatusEn(); string sqlCmd = "select * from SAS_StudentStatus where SASS_Code='" + argEn + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
public SagaEn GetSelectedSaga(int posting_type) { SagaEn loItem = new SagaEn(); string sqlCmd = "SELECT * FROM SAS_Saga WHERE Posting_Type = " + posting_type; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { loItem = LoadObjectSaga(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
public List <SagaEn> GetList(SagaEn argEn) { List <SagaEn> loEnList = new List <SagaEn>(); string sqlCmd = "SELECT * FROM SAS_Saga "; if (argEn.Posting_Type != -1) { sqlCmd = sqlCmd + " WHERE Posting_Type = " + argEn.Posting_Type + " "; } try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { SagaEn loItem = LoadObjectSaga(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of KokoCharges /// </summary> /// <param name="argEn">KokoCharges Entity is an Input.FTCode is an Input Property</param> /// <returns>Returns List of KokoCharges</returns> public List <FeeChargesEn> GetKokoCharges(FeeChargesEn argEn) { List <FeeChargesEn> loEnList = new List <FeeChargesEn>(); string sqlCmd = "SELECT SAKOD_CategoryCode, SAKOD_FeeAmount, SAKO_Code,SAKOD_CategoryName FROM SAS_KokorikulumDetails WHERE " + "SAKO_Code =@SAKO_Code"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SAKO_Code", DbType.String, argEn.FTCode); _DbParameterCollection = cmd.Parameters; using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { while (loReader.Read()) { FeeChargesEn loItem = LoadObjectKoko(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of ProgramAccount /// </summary> /// <param name="argEn">ProgramAccount Entity is an Input.</param> /// <returns>Returns List of ProgramAccount</returns> public List <ProgramAccountEn> GetListProgramCombine(ProgramAccountEn argEn) { List <ProgramAccountEn> loEnList = new List <ProgramAccountEn>(); string sqlCmd = "select PR.SAPG_ProgramBM as descProgram from SAS_Program PR UNION "; sqlCmd += "Select 'AFC-' || FC.SAFC_Desc from SAS_Faculty FC UNION "; sqlCmd += "Select 'AFC-' || SS.SAST_Code from SAS_SemesterSetup SS"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { ProgramAccountEn loItem = LoadObject2(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of SelectionCriteria /// </summary> /// <param name="argEn">SelectionCriteria Entity is an Input.</param> /// <returns>Returns List of SelectionCriteria</returns> public SelectionCriteriaEn GetSCByBatchCode(SelectionCriteriaEn argEn) { SelectionCriteriaEn loItem = new SelectionCriteriaEn(); string sqlCmd = "select * from SAS_Selection_Criteria where BatchCode = '" + argEn.BatchCode + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { //if (loReader != null) //{ // loReader.Read(); // loItem = LoadObject(loReader); //} if (loReader.Read()) { loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
public int GetGroupID(string DeptID, string GroupName) { int UserGroupId = 0; string sqlGetID = "Select usergroupid as id FROM UR_UserGroups WHERE Departmentid = " + clsGeneric.AddQuotes(DeptID); sqlGetID = sqlGetID + " and UserGroupName = " + clsGeneric.AddQuotes(GroupName); try { if (!FormHelp.IsBlank(sqlGetID)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlGetID).CreateDataReader()) { while (loReader.Read()) { UserGroupId = clsGeneric.NullToInteger(loReader["id"]); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(UserGroupId); }
/// <summary> /// Method to Update PayMode /// </summary> /// <param name="argEn">PayMode Entity is an Input.</param> /// <returns>Returns Boolean</returns> public bool Update(PayModeEn argEn) { bool lbRes = false; int iOut = 0; string sqlCmd = "Select count(*) as cnt From SAS_PayMode WHERE SAPM_Code != @SAPM_Code and SAPM_Des = @SAPM_Des"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmdSel = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmdSel, "@SAPM_Code", DbType.String, argEn.SAPM_Code); _DatabaseFactory.AddInParameter(ref cmdSel, "@SAPM_Des", DbType.String, argEn.SAPM_Des); _DbParameterCollection = cmdSel.Parameters; using (IDataReader dr = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmdSel, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { if (dr.Read()) { iOut = clsGeneric.NullToInteger(dr["cnt"]); } if (iOut > 0) { throw new Exception("Record Already Exist"); } } if (iOut == 0) { sqlCmd = "UPDATE SAS_PayMode SET SAPM_Code = @SAPM_Code, SAPM_Des = @SAPM_Des, SAPM_Status = @SAPM_Status WHERE SAPM_Code = @SAPM_Code"; if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SAPM_Code", DbType.String, argEn.SAPM_Code); _DatabaseFactory.AddInParameter(ref cmd, "@SAPM_Des", DbType.String, argEn.SAPM_Des); _DatabaseFactory.AddInParameter(ref cmd, "@SAPM_Status", DbType.Boolean, argEn.SAPM_Status); _DbParameterCollection = cmd.Parameters; int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection); if (liRowAffected > -1) { lbRes = true; } else { throw new Exception("Update Failed! No Row has been updated..."); } } } } } catch (Exception ex) { throw ex; } return(lbRes); }
/// <summary> /// Method to Insert UserGroupsMenu /// </summary> /// <param name="argEn">UserGroups Entity is an Input.</param> /// <returns>Returns Boolean</returns> public bool InsertUserGroupMenu(UserGroupsEn argEn) { List <UserRightsEn> loEnList = new List <UserRightsEn>(); string sqlCmd = "select * from UR_MenuMaster "; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { UserRightsEn loItem = new UserRightsEn(); loItem.MenuID = GetValue <int>(loReader, "MenuID"); loItem.UserGroup = argEn.UserGroupId; loItem.LastUser = argEn.LastUpdatedBy; loItem.LastDtTm = argEn.LastUpdatedDtTm; loEnList.Add(loItem); } loReader.Close(); } UserRightsDAL userRights = new UserRightsDAL(); userRights.InsertUserRights(loEnList); } } catch (Exception ex) { throw ex; } return(true); }
/// <summary> /// Method to Get List of Faculty /// </summary> /// <param name="argEn">Faculty Entity is an Input.</param> /// <returns>Returns List of Faculty</returns> public List <FacultyEn> GetList(FacultyEn argEn) { List <FacultyEn> loEnList = new List <FacultyEn>(); argEn.SAFC_Code = argEn.SAFC_Code.Replace("*", "%"); string sqlCmd = "select * from SAS_Faculty WHERE SAFC_CODE <> '0' and SAFC_Status = 't' "; if (argEn.SAFC_Code.Length != 0) { sqlCmd = sqlCmd + " and SAFC_CODE like '" + argEn.SAFC_Code + "'"; } try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { FacultyEn loItem = LoadObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Insert StudentCategoryAccess /// </summary> /// <param name="argEn">StudentCategoryAccess Entity is an Input.</param> /// <returns>Returns Boolean</returns> public bool Insert(StudentCategoryAccessEn argEn) { bool lbRes = false; string sqlCmd = "INSERT INTO SAS_StudentCategoryAccess(SASC_Code,MenuID,Status) VALUES (@SASC_Code,@MenuID,@Status) "; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SASC_Code", DbType.String, argEn.StudentCategoryCode); _DatabaseFactory.AddInParameter(ref cmd, "@MenuID", DbType.Int32, argEn.MenuID); _DatabaseFactory.AddInParameter(ref cmd, "@Status", DbType.Boolean, argEn.Status); _DbParameterCollection = cmd.Parameters; int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection); if (liRowAffected > -1) { lbRes = true; } else { throw new Exception("Insertion Failed! No Row has been updated..."); } } } catch (Exception ex) { throw ex; } return(lbRes); }
/// <summary> /// Method to Get Menus. /// </summary> /// <param name="argEn">Menu Entity is an Input.MenuID is an Input Property</param> /// <returns>List of Menu Entity</returns> public ConnectionEn GetConnectionString(ConnectionEn argEn) { ConnectionEn loEnList = new ConnectionEn(); string sqlCmd = "select CF_Conn from SAS_CF where CF_Code ='" + argEn.Code + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { loEnList = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
public int GetWorkflowProcess(int WorkflowId, string WorkFlowRole) { int IntProcess = 0; string sqlGetReviewer = "select count(*) as GroupUser from sas_workflow_status where workflow_id = " + WorkflowId + " and workflow_role = " + clsGeneric.AddQuotes(WorkFlowRole); try { if (!FormHelp.IsBlank(sqlGetReviewer)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlGetReviewer).CreateDataReader()) { while (loReader.Read()) { IntProcess = clsGeneric.NullToInteger(loReader["GroupUser"]); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(IntProcess); }
/// <summary> /// Method to Get List of StudentSponsor by MatricNo /// </summary> /// <param name="argEn">StudentSponsor Entity as an Input.MatricNo as Input Property.</param> /// <returns>Returns List of StudentSponsor</returns> public List <StudentSponEn> GetStudentSpn(string argEn) { List <StudentSponEn> loEnList = new List <StudentSponEn>(); string sqlCmd = "select * from SAS_StudentSpon where SASI_MatricNo='" + argEn + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { StudentSponEn loItem = LoadObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
public int DeleteReviewApprove(int WorkflowId, short WorkflowStatus, string WorkFlowRole, string UserId) { //variable declarations string SqlStatement = null; try { //Build Sql Statement - Start SqlStatement += "DELETE FROM sas_workflow_status WHERE workflow_id = " + WorkflowId; SqlStatement += " AND workflow_status = " + WorkflowStatus; SqlStatement += " AND workflow_role = " + clsGeneric.AddQuotes(WorkFlowRole); SqlStatement += " AND user_name = " + clsGeneric.AddQuotes(UserId); //Build Sql Statement - Stop if (!FormHelp.IsBlank(SqlStatement)) { //track workdflow status - start return(_DatabaseFactory.ExecuteSqlStatement(Helper.GetDataBaseType, DataBaseConnectionString, SqlStatement)); //track workdflow status - stop } return(1); } catch (Exception ex) { MaxModule.Helper.LogError(ex.Message); return(-1); } }
/// <summary> /// Method to Delete UniversityProfile /// </summary> /// <param name="argEn">UniversityProfile Entity is an Input.UniversityProfileCode as Input Propoerty.</param> /// <returns>Returns Boolean</returns> public bool Delete(UniversityProfileEn argEn) { bool lbRes = false; string sqlCmd = "DELETE FROM SAS_UniversityProfile WHERE SAUP_Code = @SAUP_Code"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SAUP_Code", DbType.String, argEn.UniversityProfileCode); _DbParameterCollection = cmd.Parameters; int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection); if (liRowAffected > -1) { lbRes = true; } else { throw new Exception("Delete Failed! No Row has been deleted..."); } } } catch (Exception ex) { throw ex; } return(lbRes); }
/// <summary> /// Method to Get StudentCategory Entity /// </summary> /// <param name="argEn">StudentCategory Entity is an Input.StudentCategoryCode as Input Property.</param> /// <returns>Returns StudentCategory Entity</returns> public StudentCategoryEn GetItem(StudentCategoryEn argEn) { StudentCategoryEn loItem = new StudentCategoryEn(); string sqlCmd = "Select * FROM SAS_StudentCategory WHERE SASC_Code = @SASC_Code"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@SASC_Code", DbType.String, argEn.StudentCategoryCode); _DbParameterCollection = cmd.Parameters; using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { if (loReader != null) { loReader.Read(); loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
/// <summary> /// Method to Get UserGroups Entity /// </summary> /// <param name="argEn">UserGroups Entity is an Input.UserGroupId and UserGroupName as Input Properties.</param> /// <returns>Returns UserGroups Entity</returns> public UserGroupsEn GetItem(UserGroupsEn argEn) { UserGroupsEn loItem = new UserGroupsEn(); string sqlCmd = "Select * FROM UR_UserGroups WHERE UserGroupId = @UserGroupId and UserGroupName = @UserGroupName"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmd, "@UserGroupId", DbType.Int32, argEn.UserGroupId); _DatabaseFactory.AddInParameter(ref cmd, "@UserGroupName", DbType.String, argEn.UserGroupName); _DbParameterCollection = cmd.Parameters; using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd, DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader()) { if (loReader != null) { loReader.Read(); loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }
/// <summary> /// Method to Delete Cheques /// </summary> /// <param name="argEn">Cheques Entity is the Input.ProcessID is the Input Property.</param> /// <returns>Returns Boolean.</returns> public bool Delete(ChequeEn argEn) { bool lbRes = false; string sqlCmd = "DELETE FROM SAS_Cheque WHERE ProcessID = @ProcessID"; try { if (!FormHelp.IsBlank(sqlCmd)) { DbCommand cmdSel = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString); _DatabaseFactory.AddInParameter(ref cmdSel, "@ProcessID", DbType.String, argEn.ProcessID); _DbParameterCollection = cmdSel.Parameters; int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmdSel, DataBaseConnectionString, sqlCmd, _DbParameterCollection); if (liRowAffected > -1) { lbRes = true; } else { throw new Exception("Insertion Failed! No Row has been updated..."); } } } catch (Exception ex) { throw ex; } return(lbRes); }
/// <summary> /// Method to Get List of Active UserGroups /// </summary> /// <returns>Returns List of UserGroups</returns> public List <UserGroupsEn> GetUserGroups() { List <UserGroupsEn> loEnList = new List <UserGroupsEn>(); //string sqlCmd = "select * from UR_UserGroups where Status=1"; string sqlCmd = "select * from UR_UserGroups where Status='true'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { UserGroupsEn loItem = LoadObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
/// <summary> /// Method to Get List of DegreeTypes /// </summary> /// <param name="argEn">DegreeType Entity is an Input.</param> /// <returns>Returns List of DegreeTypes</returns> public List <DegreeTypeEn> GetList(DegreeTypeEn argEn) { List <DegreeTypeEn> loEnList = new List <DegreeTypeEn>(); string sqlCmd = "select * from SAS_DegreeType"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { DegreeTypeEn loItem = LoadObject(loReader); loEnList.Add(loItem); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loEnList); }
public BidangEn GetSelectedBidang(string argEn) { BidangEn loItem = new BidangEn(); string sqlCmd = "select * from sas_bidang WHERE sabp_code ='" + argEn + "'"; try { if (!FormHelp.IsBlank(sqlCmd)) { using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType, DataBaseConnectionString, sqlCmd).CreateDataReader()) { while (loReader.Read()) { loItem = LoadObject(loReader); } loReader.Close(); } } } catch (Exception ex) { throw ex; } return(loItem); }