public int InsertCaseReferred(CaseReferred objCaseReferred)
        {
            objCaseReferred.CaseReferredID = 1;
            BeginTransaction();

            try
            {
                objCaseReferred.CaseReferredID = Insert(objCaseReferred);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objCaseReferred.CaseReferredID = -1;
            }

            return objCaseReferred.CaseReferredID;
        }
        public int UpdateCaseReferred(CaseReferred objCaseReferred)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "SaMIProfileID", "ReferStatus", "UpdatedBy", "UpdatedDate" };
                rowsaffected = Update(objCaseReferred, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Exemple #3
0
        protected void btnSaveForeignEmployment_Click(object sender, EventArgs e)
        {
            int ForeignEmploymentId = 0;
            int SaMIProfileID = Convert.ToInt32(Request.QueryString.Get("ID")); ;

            ForeignEmploymentStatus objForeignEmploymentStatus = ForeignEmploymentStatusBO.GetFEStatus(SaMIProfileID);

            if (objForeignEmploymentStatus.ForeignEmploymentStatusID > 0)
            {
                ForeignEmploymentStatus objForeignEmploymentStatusNew = MapForeignEmploymentStatusDTO();
                objForeignEmploymentStatusNew.SaMIProfileID = SaMIProfileID;
                objForeignEmploymentStatusNew.ForeignEmploymentStatusID = objForeignEmploymentStatus.ForeignEmploymentStatusID;
                objForeignEmploymentStatusNew.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objForeignEmploymentStatusNew.UpdatedDate = DateTime.Now;
                ForeignEmploymentId = ForeignEmploymentStatusBO.UpdateFEStatus(objForeignEmploymentStatusNew);
            }
            else
            {
                objForeignEmploymentStatus = MapForeignEmploymentStatusDTO();
                objForeignEmploymentStatus.SaMIProfileID = SaMIProfileID;
                objForeignEmploymentStatus.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objForeignEmploymentStatus.CreatedDate = DateTime.Now;
                ForeignEmploymentId = ForeignEmploymentStatusBO.InsertFEStatus(objForeignEmploymentStatus);
            }
            if (ForeignEmploymentId > 0)
            {
                hfForeignEmploymentID.Value = ForeignEmploymentId.ToString();
            }

            //Refer To F-Skill
            DataView dvCheckReferStatus = TRNRecruitmentListBO.GetStatus(Convert.ToInt32(hfSaMIProfileID.Value));
            if (dvCheckReferStatus.Count == 0)
            {
                if (chkReferred.Checked)
                {
                    TRNRecruitmentList objRecruitmentList = MapRecruitmentList();
                    objRecruitmentList.SaMIProfileID = Convert.ToInt32(hfSaMIProfileID.Value);
                    int ReferStatus = TRNRecruitmentListBO.InsertRecruitmentList(objRecruitmentList);
                }
            }
            else
            {
                if (chkReferred.Checked == false)
                {
                    int Status = TRNRecruitmentListBO.DeleteRecruitmentList(Convert.ToInt32(hfSaMIProfileID.Value));
                }
            }

            //Refer To Case
            DataView dvCheckReferStatusToCase = CaseReferredBO.GetStatus(Convert.ToInt32(hfSaMIProfileID.Value));
            if (dvCheckReferStatusToCase.Count == 0)
            {
                if (chkReferredToCase.Checked)
                {
                    CaseReferred objCaseReferred = new CaseReferred();
                    objCaseReferred.SaMIProfileID = Convert.ToInt32(hfSaMIProfileID.Value);
                    objCaseReferred.ReferStatus = 1;
                    objCaseReferred.CreatedBy = UserAuthentication.GetUserId(this.Page);
                    objCaseReferred.CreatedDate = DateTime.Now;
                    objCaseReferred.SyncStatus = 0;
                    int ReferStatus = CaseReferredBO.InsertCaseReferred(objCaseReferred);
                }
            }
            else
            {
                if (chkReferred.Checked == false)
                {
                    int Status = CaseReferredBO.DeleteCaseReferred(Convert.ToInt32(hfSaMIProfileID.Value));
                }
            }

            Response.Redirect("~/Profile/Edit.aspx?ID=" + Convert.ToInt32(hfSaMIProfileID.Value));

            LoadForeignEmploymentOptions();
            LoadForeignEmploymentStatus(SaMIProfileID);
            LoadValidRegions(Convert.ToInt32(ddlEthnicity.SelectedValue));
        }