//public static PhoneFollowUp GetPhoneFollowUp(int SaMIProfileID)
        //{
        //    PhoneFollowUp objPhoneFollowUp = new PhoneFollowUp();
        //    return (PhoneFollowUp)(new PhoneFollowUpDAO().FillDTO(objPhoneFollowUp, "SaMIProfileID=" + SaMIProfileID));
        //}

        public int InsertPhoneFollowUp(PhoneFollowUp objPhonefollowup)
        {
            objPhonefollowup.PhoneFollowUpID = 1;
            BeginTransaction();

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

            return objPhonefollowup.PhoneFollowUpID;
        }
        public int DeletePhoneFollowUp(PhoneFollowUp objPhonefollowup)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objPhonefollowup, UpdateProperties);

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

        }
        public int UpdatePhoneFollowUp(PhoneFollowUp objPhonefollowup)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "LeftForFE", "VisitorsCurrentStatus", "VisitorsOtherStatus", "ContractNumber", "MigratedCountry", "MigratedDate", "MigratedAfterTraining",
                    "ManpowerAgent", "AmountPaidforFE", "SourceOfInvestment", "ReceiptReceived", "LeftDocumentBeforeDeparture", "SameWorkAsAgreement", 
                    "SameSalaryAsAgreement", "AdditionalInfo", "Recommendation", "InformantsName", "MigrantRelation", "FollowUpDate", 
                    "Remarks", "UpdatedBy", "UpdatedDate", "Status" };
                rowsaffected = Update(objPhonefollowup, UpdateProperties);

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

        }
Example #4
0
 protected void gvPhoneFollowUp_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("cmdEdit"))
     {
         hfPhoneFollowUpID.Value = e.CommandArgument.ToString();
         //PhoneFollowUp objPhoneFollowUp = PhoneFollowUpBO.GetPhoneFollowUp(Convert.ToInt32(e.CommandArgument.ToString()));
         
         LoadPhoneFollowUp(Convert.ToInt32(hfPhoneFollowUpID.Value));
         //ScriptManager.RegisterStartupScript(this, this.GetType(), "myalert", "alert('File already exists.');", true);
         //Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "abc()", true);
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Func()", true);
     }
     else if (e.CommandName.Equals("cmdDelete"))
     {
         hfPhoneFollowUpID.Value = e.CommandArgument.ToString();
         PhoneFollowUp objPhoneFollowUp = new PhoneFollowUp();
         objPhoneFollowUp.PhoneFollowUpID = Convert.ToInt32(e.CommandArgument.ToString());
         objPhoneFollowUp.Status = 0;
         objPhoneFollowUp.SyncStatus = 0;
         PhoneFollowUpBO.DeletePhoneFollowUp(objPhoneFollowUp);
         LoadPhoneFollowUpList(Convert.ToInt32(hfSaMIProfileID.Value));
         ClearPhoneFollowUpList();
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Func()", true);
     }
 }
Example #5
0
        protected void btnSavePhoneFollowUp_Click(object sender, EventArgs e)
        {
            String sourceofInvestment = string.Empty;
            //DataView dvPhoneFollowUp = PhoneFollowUpBO.GetBySaMIProfileID(Convert.ToInt32(Request.QueryString.Get("ID")));
            //if (dvPhoneFollowUp.Count > 0)
            //{
            //    ID = Convert.ToInt32(dvPhoneFollowUp.Table.Rows[0]["PhoneFollowUpID"]);
            //}
            PhoneFollowUp objPhoneFollowUp = new PhoneFollowUp();

            int SaMIProfileId = Convert.ToInt32(hfSaMIProfileID.Value);
            objPhoneFollowUp.SaMIProfileID = SaMIProfileId;

            if (rbtnLeftFEYes.Checked)
            {
                objPhoneFollowUp.LeftForFE = 1;
                objPhoneFollowUp.ContractNumber = txtContractNumber.Text;
                objPhoneFollowUp.MigratedCountry = txtMigratedCountry.Text;
                objPhoneFollowUp.MigratedDate = txtMigratedDate.Text;
                if (rbtnMigratedAfterTrainingYes.Checked)
                {
                    objPhoneFollowUp.MigratedAfterTraining = 1;
                }
                else if (rbtnMigratedAfterTrainingNo.Checked)
                {
                    objPhoneFollowUp.MigratedAfterTraining = 0;
                }
                objPhoneFollowUp.ManpowerAgent = txtManpowerAgent.Text;
                objPhoneFollowUp.AmountPaidforFE = txtAmountPaidforFE.Text;

                for (int j = 0; j < chkSourceOfInvestment.Items.Count; j++)
                {
                    if (chkSourceOfInvestment.Items[j].Selected == true)
                    {
                        if (j == 0)
                            sourceofInvestment = chkSourceOfInvestment.Items[j].Value;
                        else
                            sourceofInvestment = sourceofInvestment + "," + chkSourceOfInvestment.Items[j].Value;
                    }
                }

                objPhoneFollowUp.SourceOfInvestment = sourceofInvestment;
                if (rbtnReceiptFromManpowerYes.Checked)
                    objPhoneFollowUp.ReceiptReceived = 1;
                else if (rbtnReceiptFromManpowerNo.Checked)
                    objPhoneFollowUp.ReceiptReceived = 0;
                if (rbtnLeftDocumentYes.Checked)
                    objPhoneFollowUp.LeftDocumentBeforeDeparture = 1;
                else if (rbtnLeftDocumentNo.Checked)
                    objPhoneFollowUp.LeftDocumentBeforeDeparture = 0;
                if (rbtnWorkAggreementYes.Checked)
                    objPhoneFollowUp.SameWorkAsAgreement = 1;
                else if (rbtnWorkAggreementNo.Checked)
                    objPhoneFollowUp.SameWorkAsAgreement = 0;
                if (rbtnSalaryAgreementYes.Checked)
                    objPhoneFollowUp.SameSalaryAsAgreement = 1;
                else if (rbtnSalaryAgreementNo.Checked)
                    objPhoneFollowUp.SameSalaryAsAgreement = 0;
            }
            else if (rbtnLeftFENo.Checked)
            {
                objPhoneFollowUp.LeftForFE = 0;
                objPhoneFollowUp.VisitorsCurrentStatus = ddlCurrentStatus.Text;
                objPhoneFollowUp.VisitorsOtherStatus = txtCurrentStatus.Text;
            }

            objPhoneFollowUp.AdditionalInfo = txtAdditionalInfo.Text;
            objPhoneFollowUp.Recommendation = txtRecommendations.Text;
            objPhoneFollowUp.InformantsName = txtNameOfInformants.Text;
            objPhoneFollowUp.MigrantRelation = txtRelationMigrant.Text;
            objPhoneFollowUp.FollowUpDate = txtDateOfFollowUp.Text;
            objPhoneFollowUp.Remarks = txtRemarks.Text;
            
            objPhoneFollowUp.Status = 1;
            objPhoneFollowUp.GUID = 0;
            objPhoneFollowUp.SyncStatus = 0;

            if (hfPhoneFollowUpID.Value != string.Empty)
            {
                objPhoneFollowUp.PhoneFollowUpID = Convert.ToInt32(hfPhoneFollowUpID.Value);
                objPhoneFollowUp.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objPhoneFollowUp.UpdatedDate = DateTime.Now;
                PhonefollowupId = PhoneFollowUpBO.UpdatePhoneFollowUp(objPhoneFollowUp);
            }
            else
            {
                objPhoneFollowUp.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objPhoneFollowUp.CreatedDate = DateTime.Now;
                PhonefollowupId = PhoneFollowUpBO.InsertPhoneFollowUp(objPhoneFollowUp);
            }
            if (PhonefollowupId > 0)
            {
                hfPhoneFollowUpID.Value = PhonefollowupId.ToString();
                LoadPhoneFollowUpList(SaMIProfileId);
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Func()", true);

                ClearPhoneFollowUpList();
                ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Func()", true);
            }
        }