public int InsertRecruitmentList(TRNRecruitmentList objRecruitmentList) { objRecruitmentList.RecruitmentID = 1; BeginTransaction(); try { objRecruitmentList.RecruitmentID = Insert(objRecruitmentList); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objRecruitmentList.RecruitmentID = -1; } return objRecruitmentList.RecruitmentID; }
public int UpdateRecruitmentList(TRNRecruitmentList objRecruitmentList) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "OrganizationID", "SaMIProfileID", "Status", "UpdatedBy", "UpdatedDate" }; rowsaffected = Update(objRecruitmentList, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
// GET api/trnrecruitmentlist public IEnumerable<TRNRecruitmentList> Get(int Organization) { List<TRNRecruitmentList> listTRNRecruitmentList = new List<TRNRecruitmentList>(); DataView dvUsers = UserBO.GetUsersIDByOrganization(Organization); ////PUT The Organization As Dynamic string TempCreatedBy = ""; if (dvUsers.Count > 0) { foreach (DataRowView drvUsers in dvUsers) { TempCreatedBy += "CreatedBy=" + drvUsers["UserID"] + " OR "; } string CreatedBy = TempCreatedBy.Remove(TempCreatedBy.Length - 3); DataView dvlistTRNRecruitmentList = TRNRecruitmentListBO.GetTRNRecruitmentListIDForSync(CreatedBy); foreach (DataRowView drvTRNRecruitmentList in dvlistTRNRecruitmentList) { TRNRecruitmentList TRNRecruitmentList = new TRNRecruitmentList(); listTRNRecruitmentList.Add(TRNRecruitmentListBO.GetTRNRecruitmentList(Convert.ToInt32(drvTRNRecruitmentList["RecruitmentID"]))); } } return listTRNRecruitmentList; }
// POST api/trnrecruitmentlist public TRNRecruitmentList Post(TRNRecruitmentList TRNRecruitmentList) { if (TRNRecruitmentList.GUID > 0) { TRNRecruitmentList.RecruitmentID = TRNRecruitmentList.GUID; TRNRecruitmentList.SyncStatus = 1; int rowResult = TRNRecruitmentListBO.UpdateRecruitmentList(TRNRecruitmentList); //Return Back to The Client return TRNRecruitmentList; } else { TRNRecruitmentList.SyncStatus = 1; int rowResult = TRNRecruitmentListBO.InsertRecruitmentList(TRNRecruitmentList); TRNRecruitmentList.RecruitmentID = rowResult; //Return Back to The Client return TRNRecruitmentList; } }
TRNRecruitmentList MapRecruitmentList() { TRNRecruitmentList objRecruitmentList = new TRNRecruitmentList(); int saMIOrganizationID = UserAuthentication.GetSaMIOrganizationId(this.Page); objRecruitmentList.OrganizationID = saMIOrganizationID; objRecruitmentList.ReferStatus = 1; objRecruitmentList.CreatedBy = UserAuthentication.GetUserId(this.Page); objRecruitmentList.CreatedDate = DateTime.Now; objRecruitmentList.SyncStatus = 0; return objRecruitmentList; }
public static TRNRecruitmentList GetTRNRecruitmentList(int RecruitmentID) { TRNRecruitmentList objRecruitment = new TRNRecruitmentList(); return (TRNRecruitmentList)(new TRNRecruitmentListDAO().FillDTO(objRecruitment, "RecruitmentID=" + RecruitmentID)); }
public static int UpdateRecruitmentList(TRNRecruitmentList objRecruitmentList) { return new TRNRecruitmentListDAO().UpdateRecruitmentList(objRecruitmentList); }
public static int InsertRecruitmentList(TRNRecruitmentList objRecruitmentList) { return new TRNRecruitmentListDAO().InsertRecruitmentList(objRecruitmentList); }