// POST api/foreignemploymentstatus public ForeignEmploymentStatus Post(ForeignEmploymentStatus ForeignEmploymentStatus) { if (ForeignEmploymentStatus.GUID > 0) { int ForeignEmploymentStatusID = ForeignEmploymentStatus.GUID; // ForeignEmploymentStatus.GUID = ForeignEmploymentStatus.SaMIProfileID; ForeignEmploymentStatus.ForeignEmploymentStatusID = ForeignEmploymentStatusID; int rowResult = ForeignEmploymentStatusBO.UpdateFEStatus(ForeignEmploymentStatus); //Return Back to The Client return ForeignEmploymentStatus; } else { // ForeignEmploymentStatus.GUID = ForeignEmploymentStatus.SaMIProfileID; ForeignEmploymentStatus.SyncStatus = 1; int rowResult = ForeignEmploymentStatusBO.InsertFEStatus(ForeignEmploymentStatus); ForeignEmploymentStatus.ForeignEmploymentStatusID = rowResult; //Return Back to The Client return ForeignEmploymentStatus; } }
public int UpdateFEStatus(ForeignEmploymentStatus objForeignEmploymentStatus) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "DecisionStatusID", "PassportStatusID", "HaveJobOffer", "JobOfferSourceID", "JobOfferedTypeID", "WorkTypeID", "MadePaymentAmount", "AskedPaymentAmount", "ICKnowledgeID", "NothingAskedYet", "HavePaymentReceipt", "ReceiptPaymentAmount", "UpdatedBy", "UpdatedDate", "CountryID", "ReferToFSkill", "ReferToCase", "SyncStatus" }; rowsaffected = Update(objForeignEmploymentStatus, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
public int InsertFEStatus(ForeignEmploymentStatus objForeignEmploymentStatus) { objForeignEmploymentStatus.ForeignEmploymentStatusID = 1; BeginTransaction(); try { objForeignEmploymentStatus.ForeignEmploymentStatusID = Insert(objForeignEmploymentStatus); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objForeignEmploymentStatus.ForeignEmploymentStatusID = -1; } return objForeignEmploymentStatus.ForeignEmploymentStatusID; }
public int UpdateFSkillReferred(ForeignEmploymentStatus objForeignEmploymentStatus) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "UpdatedBy", "UpdatedDate", "ReferToFSkill" }; rowsaffected = Update(objForeignEmploymentStatus, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
// GET api/foreignemploymentstatus public IEnumerable<ForeignEmploymentStatus> Get(int Organization) { List<ForeignEmploymentStatus> listForeignEmploymentStatus = new List<ForeignEmploymentStatus>(); DataView dvUsers = UserBO.GetUsersIDByOrganization(Organization); string TempCreatedBy = ""; if (dvUsers.Count > 0) { foreach (DataRowView drvUsers in dvUsers) { TempCreatedBy += "CreatedBy=" + drvUsers["UserID"] + " OR "; } string CreatedBy = TempCreatedBy.Remove(TempCreatedBy.Length - 3); DataView dvForeignEmploymentStatus = ForeignEmploymentStatusBO.GetForeignEmploymentStatusIDForSync(CreatedBy); foreach (DataRowView drvSaMIProfiles in dvForeignEmploymentStatus) { ForeignEmploymentStatus ForeignEmploymentStatus = new ForeignEmploymentStatus(); listForeignEmploymentStatus.Add(ForeignEmploymentStatusBO.GetForeignEStatus(Convert.ToInt32(drvSaMIProfiles["ForeignEmploymentStatusID"]))); } } return listForeignEmploymentStatus; }
ForeignEmploymentStatus MapForeignEmploymentStatusDTO() { ForeignEmploymentStatus objForeignEmploymentStatus = new ForeignEmploymentStatus(); objForeignEmploymentStatus.DecisionStatusID = Convert.ToInt32(ddlDecisionStatus.SelectedValue); objForeignEmploymentStatus.PassportStatusID = Convert.ToInt32(ddlPassportStatus.SelectedValue); if (rbJobOfferYes.Checked) { objForeignEmploymentStatus.HaveJobOffer = 1; objForeignEmploymentStatus.JobOfferSourceID = Convert.ToInt32(ddlJobOfferSource.SelectedValue); objForeignEmploymentStatus.JobOfferedTypeID = Convert.ToInt32(ddlJobOfferedType.SelectedValue); objForeignEmploymentStatus.WorkTypeID = 0; } else { objForeignEmploymentStatus.JobOfferSourceID = 0; objForeignEmploymentStatus.JobOfferedTypeID = 0; //objForeignEmploymentStatus.WorkTypeID = Convert.ToInt32(ddlWorkType.SelectedValue); } if (rbMadePaymentYes.Checked) { objForeignEmploymentStatus.MadePaymentAmount = txtMadePaymentAmount.Text; if (rblPaymentReceiptYes.Checked) { objForeignEmploymentStatus.HavePaymentReceipt = 1; objForeignEmploymentStatus.ReceiptPaymentAmount = txtReceiptPaymentAmount.Text; } else { objForeignEmploymentStatus.HavePaymentReceipt = 0; objForeignEmploymentStatus.ReceiptPaymentAmount = string.Empty; } } else { objForeignEmploymentStatus.MadePaymentAmount = string.Empty; if (!chkNothingYet.Checked) { objForeignEmploymentStatus.NothingAskedYet = 0; objForeignEmploymentStatus.AskedPaymentAmount = txtAskedPaymentAmount.Text; } else { objForeignEmploymentStatus.AskedPaymentAmount = string.Empty; objForeignEmploymentStatus.NothingAskedYet = 1; } } if (chkReferred.Checked) objForeignEmploymentStatus.ReferToFSkill = 1; else objForeignEmploymentStatus.ReferToFSkill = 0; if (chkReferredToCase.Checked) objForeignEmploymentStatus.ReferToCase = 1; else objForeignEmploymentStatus.ReferToCase = 0; //if (chkPotentialMigrants.Checked) // objForeignEmploymentStatus.PotentialAndNonPotentialMigrant = 1; //else // objForeignEmploymentStatus.PotentialAndNonPotentialMigrant = 0; //objForeignEmploymentStatus.ICKnowledgeID = 0;// Convert.ToInt32(ddlICKnowledge.SelectedValue); objForeignEmploymentStatus.CountryID = Convert.ToInt32(ddlWillingCountry.SelectedValue); objForeignEmploymentStatus.SyncStatus = 0; return objForeignEmploymentStatus; }
public static ForeignEmploymentStatus GetForeignEStatus(int ForeignEmploymentStatusID) { ForeignEmploymentStatus objForeignEmploymentStatus = new ForeignEmploymentStatus(); return (ForeignEmploymentStatus)(new ForeignEmploymentStatusDAO().FillDTO(objForeignEmploymentStatus, "ForeignEmploymentStatusID=" + ForeignEmploymentStatusID)); }
public static ForeignEmploymentStatus GetFEStatus(int SaMIProfileID) { ForeignEmploymentStatus objForeignEmploymentStatus = new ForeignEmploymentStatus(); return (ForeignEmploymentStatus)(new ForeignEmploymentStatusDAO().FillDTO(objForeignEmploymentStatus, "SaMIProfileID=" + SaMIProfileID)); }
public static int UpdateFEStatus(ForeignEmploymentStatus objForeignEmploymentStatus) { return new ForeignEmploymentStatusDAO().UpdateFEStatus(objForeignEmploymentStatus); }
public static int InsertFEStatus(ForeignEmploymentStatus objForeignEmploymentStatus) { return new ForeignEmploymentStatusDAO().InsertFEStatus(objForeignEmploymentStatus); }