Exemplo n.º 1
0
        /// <summary>
        /// To Get Compensation Financial By ID
        /// </summary>
        /// <param name="CompensationFinancialID"></param>
        /// <returns></returns>
        public CompensationFinancialBO GetCompensationFinancialByID(int CompensationFinancialID)
        {
            proc = "USP_MST_GET_CompensationFinancialBYID";
            cnn  = new OracleConnection(con);
            CompensationFinancialBO objCompensationFinancial = null;

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("CompensationFinancialID_", CompensationFinancialID);

            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                while (dr.Read())
                {
                    objCompensationFinancial = new CompensationFinancialBO();
                    objCompensationFinancial = MapData(dr);
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(objCompensationFinancial);
        }
Exemplo n.º 2
0
        /// <summary>
        /// To Update Compensation Financial Closing Info
        /// </summary>
        /// <param name="oCompensationFinancial"></param>
        /// <returns></returns>
        public string AddPackageDeliveryInfo(CompensationFinancialBO oCompensationFinancial)
        {
            cnn = new OracleConnection(con);
            string returnResult = string.Empty;

            proc = "USP_TRN_CMP_INS_DELIVERY";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection.Open();

            cmd.Parameters.Add("HHID_", oCompensationFinancial.HHID);
            if (oCompensationFinancial.DeliveredBy != 0)
            {
                cmd.Parameters.Add("deliveredby_", oCompensationFinancial.DeliveredBy);
            }
            else
            {
                cmd.Parameters.Add("deliveredby_", DBNull.Value);
            }

            cmd.Parameters.Add("PAPAction_", oCompensationFinancial.PAPAction);

            if (!string.IsNullOrEmpty(oCompensationFinancial.DeliveryComments))
            {
                cmd.Parameters.Add("deliverycomments_", oCompensationFinancial.DeliveryComments);
            }
            else
            {
                cmd.Parameters.Add("deliverycomments_", DBNull.Value);
            }

            string dt = oCompensationFinancial.DeliveryDate.ToString().Substring(0, 8);

            if (dt == "1/1/0001")
            {
                cmd.Parameters.Add("deliverydate_", DBNull.Value);
            }
            else
            {
                cmd.Parameters.Add("deliverydate_", oCompensationFinancial.DeliveryDate);
            }

            cmd.Parameters.Add("createdby_", oCompensationFinancial.CreatedBy);
            cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;

            cmd.ExecuteNonQuery();

            if (cmd.Parameters["errorMessage_"].Value != null)
            {
                returnResult = cmd.Parameters["errorMessage_"].Value.ToString();
            }
            else
            {
                returnResult = string.Empty;
            }

            cmd.Connection.Close();
            return(returnResult);
        }
Exemplo n.º 3
0
        /// <summary>
        /// To Add Compensation Financial
        /// </summary>
        /// <param name="oCompensationFinancial"></param>
        /// <returns></returns>
        public string AddCompensationFinancial(CompensationFinancialBO oCompensationFinancial)
        {
            CompensationFinancialDAL oCompensationFinancialDAL = new CompensationFinancialDAL();

            try
            {
                return(oCompensationFinancialDAL.AddCompensationFinancial(oCompensationFinancial));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                oCompensationFinancial = null;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// To Update Compensation Financial Closing Info
        /// </summary>
        /// <param name="oCompensationFinancial"></param>
        /// <returns></returns>
        public string UpdateCompFinancial_ClosingInfo(CompensationFinancialBO oCompensationFinancial)
        {
            //From Clsoing Info Summery:
            CompensationFinancialDAL oCompensationFinancialDAL = new CompensationFinancialDAL();

            try
            {
                return(oCompensationFinancialDAL.UpdateCompFinancial_ClosingInfo(oCompensationFinancial));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                oCompensationFinancial = null;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// To Get Compensation Financial
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public CompensationFinancialBO GetCompensationFinancial(int HHID)
        {
            proc = "USP_TRN_GET_CMP_FINANCIALS";
            cnn  = new OracleConnection(con);
            CompensationFinancialBO oCompensationFinancial = null;

            CompensationFinancialList lstCompensationFinancial = new CompensationFinancialList();

            CompensationFinancialBO OCompensationFinancial = new CompensationFinancialBO();

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("hhid_", HHID);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                while (dr.Read())
                {
                    oCompensationFinancial = new CompensationFinancialBO();
                    oCompensationFinancial = MapData(dr);

                    lstCompensationFinancial.Add(oCompensationFinancial);
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (lstCompensationFinancial.Count > 0)
            {
                return(lstCompensationFinancial[lstCompensationFinancial.Count - 1]);
            }
            else
            {
                return(oCompensationFinancial);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// To Update Compensation Financial Closing Info
        /// </summary>
        /// <param name="objCompensationFinancial"></param>
        /// <returns></returns>
        public string UpdateCompFinancial_ClosingInfo(CompensationFinancialBO objCompensationFinancial)
        {
            cnn = new OracleConnection(con);
            string returnResult = string.Empty;

            proc = "USP_TRN_CMP_UPD_FINCLOSINGINFO";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection.Open();

            cmd.Parameters.Add("hhid_", objCompensationFinancial.HHID);
            cmd.Parameters.Add("resinkindcompensation_", objCompensationFinancial.ResInKindCompensation);

            cmd.Parameters.Add("updatedby", objCompensationFinancial.UpdatedBy);
            cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;
            try
            {
                cmd.ExecuteNonQuery();

                if (cmd.Parameters["errorMessage_"].Value != null)
                {
                    returnResult = cmd.Parameters["errorMessage_"].Value.ToString();
                }
                else
                {
                    returnResult = string.Empty;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                cmd.Connection.Close();
            }
            return(returnResult);
        }
Exemplo n.º 7
0
        /// <summary>
        /// To Update Compensation Financial Payment
        /// </summary>
        /// <param name="objCompensationFinancialBO"></param>
        public void UpdateCompensationFinancialPayment(CompensationFinancialBO objCompensationFinancialBO)
        {
            cnn = new OracleConnection(con);
            string returnResult = string.Empty;

            proc = "USP_TRN_UPD_CMP_FIN_PAYMENT";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection.Open();

            cmd.Parameters.Add("HHID_", objCompensationFinancialBO.HHID);
            cmd.Parameters.Add("CMP_PAYMENTID_", objCompensationFinancialBO.CompPaymentId);
            cmd.Parameters.Add("LANDVALUATIONPAID_", objCompensationFinancialBO.LandPaidValuation);
            cmd.Parameters.Add("RESVALUATIONPAID_", objCompensationFinancialBO.ResPaidValuation);
            cmd.Parameters.Add("FIXTUREVALUATIONPAID_", objCompensationFinancialBO.FixturePaidValuation);
            cmd.Parameters.Add("CROPVALUATIONPAID_", objCompensationFinancialBO.CropPaidValuation);
            cmd.Parameters.Add("CULTUREVALUATIONPAID_", objCompensationFinancialBO.CulturePropPaidValuation);
            cmd.Parameters.Add("DAMAGEDCROPVALUATIONPAID_", objCompensationFinancialBO.DamagedCropPaidValuation);
            cmd.Parameters.Add("FACILITATIONALLOWANCEPAID_", objCompensationFinancialBO.FacilitationAllowancePaid);
            cmd.Parameters.Add("NEGOTIATEDAMOUNTPAID_", objCompensationFinancialBO.NegotiatedAmountPaid);
            cmd.ExecuteNonQuery();
        }
Exemplo n.º 8
0
        /// <summary>
        /// To Update Compensation Financial Payment
        /// </summary>
        /// <param name="objCompensationFinancialBO"></param>
        public void UpdateCompensationFinancialPayment(CompensationFinancialBO objCompensationFinancialBO)
        {
            CompensationFinancialDAL CompensationFinancialDALObj = new CompensationFinancialDAL();

            CompensationFinancialDALObj.UpdateCompensationFinancialPayment(objCompensationFinancialBO);
        }
Exemplo n.º 9
0
        /// <summary>
        /// To Add Package Delivery Info
        /// </summary>
        /// <param name="oCompensationFinancial"></param>
        /// <returns></returns>
        public string AddPackageDeliveryInfo(CompensationFinancialBO oCompensationFinancial)
        {
            CompensationFinancialDAL oCompensationFinancialDAL = new CompensationFinancialDAL();

            return(oCompensationFinancialDAL.AddPackageDeliveryInfo(oCompensationFinancial));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Get the data from data base
        /// </summary>
        private void LoadData()
        {
            CompensationFinancialBO oCompensationFinancial = new CompensationFinancialBO();

            //oCompensationFinancial.Cmp_FinancialID = "";
            oCompensationFinancial.HHID = Convert.ToInt32(Session["HH_ID"]);
            CompensationFinancialBLL oCompensationFinancialBLL = new CompensationFinancialBLL();

            oCompensationFinancial = oCompensationFinancialBLL.GetCompensationFinancial(Convert.ToInt32(Session["HH_ID"]));

            if (oCompensationFinancial != null)
            {
                //LAND SECTION
                #region Land Section
                txtLandValuation.Text = UtilBO.CurrencyFormat(oCompensationFinancial.LandValuation);//oCompensationFinancial.LandValuation.ToString();
                if (oCompensationFinancial.LandDA > 0)
                {
                    txtLandDAinPercentage.Text = oCompensationFinancial.LandDA.ToString();
                }
                txtAcreageDifferencePayment.Text = UtilBO.CurrencyFormat(oCompensationFinancial.LandDiffPayment); //oCompensationFinancial.LandDiffPayment.ToString();

                //if (!string.IsNullOrEmpty(txtLandValuation.Text) && !string.IsNullOrEmpty(txtLandDAinAmount.Text))
                //    oCompensationFinancial.LandTotalValuation = Convert.ToDecimal(txtLandValuation.Text.Trim()) + Convert.ToDecimal(txtLandDAinAmount.Text.Trim());

                txtLandTotal.Text      = UtilBO.CurrencyFormat(oCompensationFinancial.LandTotalValuation);                                        //oCompensationFinancial.LandTotalValuation.ToString();
                txtLandDAinAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.LandTotalValuation - oCompensationFinancial.LandValuation); //(oCompensationFinancial.LandTotalValuation - oCompensationFinancial.LandValuation).ToString();
                txtLandComments.Text   = oCompensationFinancial.LandValComments;
                #endregion

                //RESIDENTIAL STRUCTURE
                #region Residencial Structure
                txtRSDepreciatedValue.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResDepreciatedValue); //oCompensationFinancial.ResDepreciatedValue.ToString();
                txtRSReplacementValue.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResReplacementValue); //oCompensationFinancial.ResReplacementValue.ToString();
                if (oCompensationFinancial.ResDA > 0)
                {
                    txtRSDAinPercentage.Text = oCompensationFinancial.ResDA.ToString();
                }

                txtRSMovingAllowance.Text       = UtilBO.CurrencyFormat(oCompensationFinancial.ResMovingAllowance); //oCompensationFinancial.ResMovingAllowance.ToString();
                txtRSLabourCost.Text            = UtilBO.CurrencyFormat(oCompensationFinancial.ResLabourCost);      //oCompensationFinancial.ResLabourCost.ToString();
                txtRSPaymentHighHouseValue.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResPayment);         //oCompensationFinancial.ResPayment.ToString();

                //if (!string.IsNullOrEmpty(txtRSReplacementValue.Text) && !string.IsNullOrEmpty(txtResidentialDAinAmount.Text))//Calculated mannually
                //    oCompensationFinancial.ResTotalValuation = Convert.ToDecimal(txtRSReplacementValue.Text.Trim()) + Convert.ToDecimal(txtResidentialDAinAmount.Text.Trim());

                //txtResidentialDAinAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResTotalValuation - oCompensationFinancial.ResReplacementValue); //(oCompensationFinancial.ResTotalValuation - oCompensationFinancial.ResReplacementValue).ToString();

                txtResidentialStructureComments.Text = oCompensationFinancial.ResComments;
                #endregion

                //FIXTURES
                #region Fixture Section

                txtFixturesValuation.Text = UtilBO.CurrencyFormat(oCompensationFinancial.FixtureValuation); //oCompensationFinancial.FixtureValuation.ToString();
                if (oCompensationFinancial.FixtureDA > 0)
                {
                    txtFixturesDAinPercentage.Text = oCompensationFinancial.FixtureDA.ToString();
                }

                //if (!string.IsNullOrEmpty(txtFixturesDAinAmount.Text) && !string.IsNullOrEmpty(txtFixturesValuation.Text))
                //    oCompensationFinancial.FixtureTotalValuation = Convert.ToDecimal(txtFixturesDAinAmount.Text.Trim()) + Convert.ToDecimal(txtFixturesValuation.Text.Trim());

                txtFixturesDAinAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.FixtureTotalValuation - oCompensationFinancial.FixtureValuation); //(oCompensationFinancial.FixtureTotalValuation - oCompensationFinancial.FixtureValuation).ToString();

                txtRSDepreciatedValue.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResDepreciatedValue);                                             //oCompensationFinancial.ResDepreciatedValue.ToString();
                txtFixturesComments.Text   = oCompensationFinancial.FixtureComments;
                #endregion

                //CROPS
                #region Crops Section
                txtCropsValuation.Text = UtilBO.CurrencyFormat(oCompensationFinancial.CropValuation); //oCompensationFinancial.CropValuation.ToString();

                //CheckBox

                if (oCompensationFinancial.CropMaxCapCase != null)
                {
                    if (oCompensationFinancial.CropMaxCapCase.ToUpper() == "YES")
                    {
                        chkMaxCapCase.Checked = true;
                    }
                    else
                    {
                        chkMaxCapCase.Checked = false;
                    }
                }
                else
                {
                    chkMaxCapCase.Checked = false;
                }

                txtValuationAfterMaxCap.Text = UtilBO.CurrencyFormat(oCompensationFinancial.CropValAftMaxCap); //oCompensationFinancial.CropValAftMaxCap.ToString();

                if (oCompensationFinancial.CropDA > 0)
                {
                    txtCropsDAinPercentage.Text = oCompensationFinancial.CropDA.ToString();
                }

                //if (!string.IsNullOrEmpty(txtCropsValuation.Text) && !string.IsNullOrEmpty(txtCropsDAinAmount.Text))
                //    oCompensationFinancial.CropTotalValuation = Convert.ToDecimal(txtCropsValuation.Text.Trim()) + Convert.ToDecimal(txtCropsDAinAmount.Text.Trim());

                if (oCompensationFinancial.CropMaxCapCase.ToUpper() == "YES")
                {
                    if (!string.IsNullOrEmpty(txtValuationAfterMaxCap.Text) && !string.IsNullOrEmpty(txtCropsDAinAmount.Text))
                    {
                        oCompensationFinancial.CropTotalValuation = Convert.ToDecimal(txtValuationAfterMaxCap.Text.Trim()) + Convert.ToDecimal(txtCropsDAinAmount.Text.Trim());
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(txtCropsValuation.Text) && !string.IsNullOrEmpty(txtCropsDAinAmount.Text))
                    {
                        oCompensationFinancial.CropTotalValuation = Convert.ToDecimal(txtCropsValuation.Text.Trim()) + Convert.ToDecimal(txtCropsDAinAmount.Text.Trim());
                    }
                }

                txtCropsDAinAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.CropTotalValuation - oCompensationFinancial.CropValuation); //(oCompensationFinancial.CropTotalValuation - oCompensationFinancial.CropValuation).ToString();

                txtCropsComments.Text = oCompensationFinancial.CropComments;

                #endregion

                //OTHERS
                #region Others
                txtCompensationForCultureProperty.Text = UtilBO.CurrencyFormat(oCompensationFinancial.CulturePropValuation); //oCompensationFinancial.CulturePropValuation.ToString();

                txtOtherDamagedCrops.Text = UtilBO.CurrencyFormat(oCompensationFinancial.DamagedCropValuation);              //oCompensationFinancial.DamagedCropValuation.ToString();

                //if (!string.IsNullOrEmpty(txtCulturePropertyValue.Text) && !string.IsNullOrEmpty(txtOtherDamagedCrops.Text))
                //    oCompensationFinancial.TotalOtherValuation = Convert.ToDecimal(txtCulturePropertyValue.Text.Trim()) + Convert.ToDecimal(txtOtherDamagedCrops.Text.Trim());
                txtOthersTotal.Text = UtilBO.CurrencyFormat(oCompensationFinancial.CulturePropValuation + oCompensationFinancial.DamagedCropValuation); //(oCompensationFinancial.CulturePropValuation + oCompensationFinancial.DamagedCropValuation).ToString();
                #endregion

                //SUMMERY
                #region Summery Section
                txtNegotiatedAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.NegotiatedAmount);

                decimal RDAllowance          = (oCompensationFinancial.ResDepreciatedValue * oCompensationFinancial.FixtureDA) / 100;
                decimal SummeryFixturesValue = (((oCompensationFinancial.FixtureValuation * oCompensationFinancial.FixtureDA) / 100) + oCompensationFinancial.FixtureValuation);
                txtSummeryFixturesValue.Text = UtilBO.CurrencyFormat(SummeryFixturesValue); //SummeryFixturesValue.ToString();
                decimal DamagedCropsValue = (((oCompensationFinancial.CropValuation * oCompensationFinancial.CropDA) / 100) + oCompensationFinancial.CropValuation);
                txtDamagedCropsValue.Text    = UtilBO.CurrencyFormat(DamagedCropsValue);    // DamagedCropsValue.ToString();
                txtDamagedCropsValue.Text    = txtOtherDamagedCrops.Text;
                txtCulturePropertyValue.Text = txtCompensationForCultureProperty.Text;
                txtInKindLand.Text           = oCompensationFinancial.LandInKindCompensation.ToString().Trim();

                ddlResidentialStructure.ClearSelection();
                if (string.IsNullOrEmpty(oCompensationFinancial.ResInKindCompensation))
                {
                    ddlResidentialStructure.SelectedValue = "0";
                }
                else
                {
                    ddlResidentialStructure.SelectedValue = oCompensationFinancial.ResInKindCompensation.ToString();
                }

                txtFacilitationallowances.Text = UtilBO.CurrencyFormat(oCompensationFinancial.FacilitationAllowance);
                //if (!string.IsNullOrEmpty(txtRSDepreciatedValue.Text))
                //    oCompensationFinancial.ResDepreciatedValue = Convert.ToDecimal(txtRSDepreciatedValue.Text.Trim());
                #endregion

                //PACKAGE DELIVERY INFO
                #region Package Delivery Section
                CompensationFinancialBO ooCompensationFinancial = new CompensationFinancialBO();
                ooCompensationFinancial = oCompensationFinancialBLL.getPackageDeliveryInfo(SessionHHID);

                if (ooCompensationFinancial != null)
                {
                    if (ooCompensationFinancial.DeliveryDate != DateTime.MinValue)
                    {
                        dpDeliveryDate.Text = ooCompensationFinancial.DeliveryDate.ToString(UtilBO.DateFormat);
                    }
                    else
                    {
                        dpDeliveryDate.Text = "";
                    }

                    if (ooCompensationFinancial.PAPAction == "Y")
                    {
                        rdoActionAccepted.Checked = true;
                    }
                    else if (ooCompensationFinancial.PAPAction == "N")
                    {
                        rdoActionRejected.Checked = true;
                    }

                    ddlDeliveredBy.SelectedValue        = ooCompensationFinancial.DeliveredBy.ToString();
                    txtPackageDeliveryInfoComments.Text = ooCompensationFinancial.DeliveryComments;
                }
                #endregion Package Delivery Section

                hdnDoCalc.Value = "1";

                btnSave.Text = "Update";
            }
            else
            {
                FinalValuationBLL oFinalValuationBLL = new FinalValuationBLL();
                FinalValuationBO  oFinalValuationBO  = new FinalValuationBO();

                if (SessionHHID > 0)
                {
                    oFinalValuationBO = oFinalValuationBLL.getFinalValuatin(SessionHHID);

                    if (oFinalValuationBO != null)
                    {
                        txtLandValuation.Text         = UtilBO.CurrencyFormat(oFinalValuationBO.LandValue);                                              //oFinalValuationBO.LandValue.ToString();
                        txtCropsValuation.Text        = UtilBO.CurrencyFormat(oFinalValuationBO.CropValue);                                              //oFinalValuationBO.CropValue.ToString();
                        txtFixturesValuation.Text     = UtilBO.CurrencyFormat(oFinalValuationBO.FixtureValue);                                           //oFinalValuationBO.FixtureValue.ToString();
                        txtHouseValues.Text           = UtilBO.CurrencyFormat(oFinalValuationBO.HouseValue);                                             //oFinalValuationBO.HouseValue.ToString();
                        txtReplacementHouseValue.Text = UtilBO.CurrencyFormat(oFinalValuationBO.ReplacementValue);                                       //oFinalValuationBO.ReplacementValue.ToString();

                        txtCompensationForCultureProperty.Text = UtilBO.CurrencyFormat(oFinalValuationBO.CulturalpropertyValue);                         //oFinalValuationBO.CulturalpropertyValue.ToString();
                        txtOtherDamagedCrops.Text = UtilBO.CurrencyFormat(oFinalValuationBO.DamagedcropValue);                                           // oFinalValuationBO.DamagedcropValue.ToString();
                        txtOthersTotal.Text       = UtilBO.CurrencyFormat(oFinalValuationBO.CulturalpropertyValue + oFinalValuationBO.DamagedcropValue); //(oFinalValuationBO.CulturalpropertyValue + oFinalValuationBO.DamagedcropValue).ToString();

                        txtDamagedCropsValue.Text    = UtilBO.CurrencyFormat(oFinalValuationBO.DamagedcropValue);                                        //oFinalValuationBO.DamagedcropValue.ToString();
                        txtCulturePropertyValue.Text = UtilBO.CurrencyFormat(oFinalValuationBO.CulturalpropertyValue);                                   //oFinalValuationBO.CulturalpropertyValue.ToString();

                        txtRSDepreciatedValue.Text = UtilBO.CurrencyFormat(oFinalValuationBO.HouseValue);                                                //oFinalValuationBO.HouseValue.ToString();
                        txtRSReplacementValue.Text = UtilBO.CurrencyFormat(oFinalValuationBO.ReplacementValue);                                          //oFinalValuationBO.ReplacementValue.ToString();
                        txtNegotiatedAmount.Text   = UtilBO.CurrencyFormat(oFinalValuationBO.NegotiatedAmount);                                          //oFinalValuationBO.NegotiatedAmount.ToString();
                        txtRSLabourCost.Text       = UtilBO.CurrencyFormat(oFinalValuationBO.ResLabourCost);
                        //txtFacilitationallowances.Text = "0";
                        txtFacilitationallowances.Text = UtilBO.CurrencyFormat(oFinalValuationBO.GOUAllowance);

                        if (oFinalValuationBO.Crop_Max_Cap_Case.ToLower() == "yes")
                        {
                            chkMaxCapCase.Checked = true;
                        }
                        else
                        {
                            chkMaxCapCase.Checked = false;
                        }
                        txtValuationAfterMaxCap.Text = UtilBO.CurrencyFormat(oFinalValuationBO.Crop_Val_Aft_Max_Cap);

                        hdnDoCalc.Value = "1";

                        ScriptManager.RegisterStartupScript(this, this.GetType(), "CalTotal", "CalcLandTotal();CalcResidenitalTotal();CalcFixtureTotal();CalcCropTotal();CalcOtherTotal();FindTotalAmount();", true);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public string UpdateCompensationFinancial(CompensationFinancialBO oCompensationFinancialBO)
        {
            string returnResult = string.Empty;

            OracleConnection OCon = new OracleConnection(con);

            OCon.Open();
            OracleCommand oCmd = new OracleCommand("USP_TRN_UPD_CMP_PAYMENTSUMMERY", OCon);

            oCmd.CommandType = CommandType.StoredProcedure;
            int count = Convert.ToInt32(oCmd.CommandType);

            try
            {
                oCmd.Parameters.Add("hhid_", oCompensationFinancialBO.HHID);
                oCmd.Parameters.Add("facilitationallowance_", oCompensationFinancialBO.FacilitationAllowance);

                if (oCompensationFinancialBO.LandInKindCompensation == 0 || oCompensationFinancialBO.LandInKindCompensation == -1)
                {
                    oCmd.Parameters.Add("resinkindcompensation_", DBNull.Value);
                }
                else
                {
                    oCmd.Parameters.Add("resinkindcompensation_", oCompensationFinancialBO.LandInKindCompensation);
                }

                if (oCompensationFinancialBO.ResInKindCompensation == "0" || oCompensationFinancialBO.ResInKindCompensation == "-1")
                {
                    oCmd.Parameters.Add("resinkindcompensation_", DBNull.Value);
                }
                else
                {
                    oCmd.Parameters.Add("resinkindcompensation_", oCompensationFinancialBO.ResInKindCompensation);
                }
                oCmd.Parameters.Add("updatedby_", oCompensationFinancialBO.UpdatedBy);

                oCmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;

                oCmd.ExecuteNonQuery(); //Executing Query

                if (oCmd.Parameters["errorMessage_"].Value != null)
                {
                    returnResult = oCmd.Parameters["errorMessage_"].Value.ToString();
                }
                else
                {
                    returnResult = string.Empty;
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                oCmd.Dispose();
                OCon.Close();
                OCon.Dispose();
            }
            return(returnResult);
        }
Exemplo n.º 12
0
        /// <summary>
        /// To get Package Delivery Info
        /// </summary>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public CompensationFinancialBO getPackageDeliveryInfo(int HHID)
        {
            proc = "USP_TRN_CMP_GET_DELIVERY";
            cnn  = new OracleConnection(con);
            CompensationFinancialBO objCompensationFinancial = null;

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("hhid_", HHID);

            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                while (dr.Read())
                {
                    objCompensationFinancial = new CompensationFinancialBO();
                    if (!dr.IsDBNull(dr.GetOrdinal("Cmp_DeliveryId")))
                    {
                        objCompensationFinancial.Cmp_DeliveryId = dr.GetInt32(dr.GetOrdinal("Cmp_DeliveryId"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                    {
                        objCompensationFinancial.HHID = dr.GetInt32(dr.GetOrdinal("HHID"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("DeliveryDate")))
                    {
                        objCompensationFinancial.DeliveryDate = dr.GetDateTime(dr.GetOrdinal("DeliveryDate"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("DeliveredBy")))
                    {
                        objCompensationFinancial.DeliveredBy = dr.GetInt32(dr.GetOrdinal("DeliveredBy"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("PAPAction")))
                    {
                        objCompensationFinancial.PAPAction = dr.GetString(dr.GetOrdinal("PAPAction"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("DeliveryComments")))
                    {
                        objCompensationFinancial.DeliveryComments = dr.GetString(dr.GetOrdinal("DeliveryComments"));
                    }

                    // Edwin: 30JUN2016 - Fix wrong delivery date issue
                    if (!dr.IsDBNull(dr.GetOrdinal("CreatedDate")))
                    {
                        objCompensationFinancial.DeliveryCreatedDate = Convert.ToDateTime(dr.GetValue(dr.GetOrdinal("CreatedDate")));
                    }
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(objCompensationFinancial);
        }
Exemplo n.º 13
0
        /// <summary>
        /// To Map Data
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        private CompensationFinancialBO MapData(IDataReader reader)
        {
            CompensationFinancialBO oCompFinancial = new CompensationFinancialBO();

            try
            {
                if (ColumnExists(reader, "Cmp_FinancialID") && !reader.IsDBNull(reader.GetOrdinal("Cmp_FinancialID")))
                {
                    oCompFinancial.Cmp_FinancialID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("Cmp_FinancialID")));
                }

                if (ColumnExists(reader, "HHID") && !reader.IsDBNull(reader.GetOrdinal("HHID")))
                {
                    oCompFinancial.HHID = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("HHID")));
                }

                #region Land Section
                if (ColumnExists(reader, "LandValuation") && !reader.IsDBNull(reader.GetOrdinal("LandValuation")))
                {
                    oCompFinancial.LandValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LandValuation")));
                }

                if (ColumnExists(reader, "LANDVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("LANDVALUATIONPAID")))
                {
                    oCompFinancial.LandPaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LANDVALUATIONPAID")));
                }

                if (ColumnExists(reader, "LandDA") && !reader.IsDBNull(reader.GetOrdinal("LandDA")))
                {
                    oCompFinancial.LandDA = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LandDA")));
                }

                if (ColumnExists(reader, "LandInKindCompensation") && !reader.IsDBNull(reader.GetOrdinal("LandInKindCompensation")))
                {
                    oCompFinancial.LandInKindCompensation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LandInKindCompensation")));
                }

                if (ColumnExists(reader, "LandDiffPayment") && !reader.IsDBNull(reader.GetOrdinal("LandDiffPayment")))
                {
                    oCompFinancial.LandDiffPayment = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LandDiffPayment")));
                }

                if (ColumnExists(reader, "LandValComments") && !reader.IsDBNull(reader.GetOrdinal("LandValComments")))
                {
                    oCompFinancial.LandValComments = reader.GetString(reader.GetOrdinal("LandValComments"));
                }

                if (ColumnExists(reader, "LANDTOTALVALUATION") && !reader.IsDBNull(reader.GetOrdinal("LANDTOTALVALUATION")))
                {
                    oCompFinancial.LandTotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("LANDTOTALVALUATION")));
                }
                #endregion

                #region Residential Structure Section
                if (ColumnExists(reader, "ResDepreciatedValue") && !reader.IsDBNull(reader.GetOrdinal("ResDepreciatedValue")))
                {
                    oCompFinancial.ResDepreciatedValue = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResDepreciatedValue")));
                }

                if (ColumnExists(reader, "RESVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("RESVALUATIONPAID")))
                {
                    oCompFinancial.ResPaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("RESVALUATIONPAID")));
                }

                if (ColumnExists(reader, "ResReplacementValue") && !reader.IsDBNull(reader.GetOrdinal("ResReplacementValue")))
                {
                    oCompFinancial.ResReplacementValue = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResReplacementValue")));
                }

                if (ColumnExists(reader, "ResDA") && !reader.IsDBNull(reader.GetOrdinal("ResDA")))
                {
                    oCompFinancial.ResDA = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResDA")));
                }

                if (ColumnExists(reader, "ResMovingAllowance") && !reader.IsDBNull(reader.GetOrdinal("ResMovingAllowance")))
                {
                    oCompFinancial.ResMovingAllowance = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResMovingAllowance")));
                }

                if (ColumnExists(reader, "ResLabourCost") && !reader.IsDBNull(reader.GetOrdinal("ResLabourCost")))
                {
                    oCompFinancial.ResLabourCost = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResLabourCost")));
                }

                if (ColumnExists(reader, "ResPayment") && !reader.IsDBNull(reader.GetOrdinal("ResPayment")))
                {
                    oCompFinancial.ResPayment = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("ResPayment")));
                }

                if (ColumnExists(reader, "ResInKindCompensation") && !reader.IsDBNull(reader.GetOrdinal("ResInKindCompensation")))
                {
                    //  string testing = reader.GetString(reader.GetOrdinal("ResInKindCompensation"));
                    oCompFinancial.ResInKindCompensation = reader.GetString(reader.GetOrdinal("ResInKindCompensation"));
                }

                if (ColumnExists(reader, "ResComments") && !reader.IsDBNull(reader.GetOrdinal("ResComments")))
                {
                    oCompFinancial.ResComments = reader.GetString(reader.GetOrdinal("ResComments"));
                }

                if (ColumnExists(reader, "RESTOTALVALUATION") && !reader.IsDBNull(reader.GetOrdinal("RESTOTALVALUATION")))
                {
                    oCompFinancial.ResTotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("RESTOTALVALUATION")));
                }
                #endregion

                #region Fixture Section
                if (ColumnExists(reader, "FixtureValuation") && !reader.IsDBNull(reader.GetOrdinal("FixtureValuation")))
                {
                    oCompFinancial.FixtureValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FixtureValuation")));
                }

                if (ColumnExists(reader, "FIXTUREVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("FIXTUREVALUATIONPAID")))
                {
                    oCompFinancial.FixturePaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FIXTUREVALUATIONPAID")));
                }

                if (ColumnExists(reader, "FixtureDA") && !reader.IsDBNull(reader.GetOrdinal("FixtureDA")))
                {
                    oCompFinancial.FixtureDA = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FixtureDA")));
                }

                if (ColumnExists(reader, "FixtureTotalValuation") && !reader.IsDBNull(reader.GetOrdinal("FixtureTotalValuation")))
                {
                    oCompFinancial.FixtureTotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FixtureTotalValuation")));
                }

                if (ColumnExists(reader, "FixtureComments") && !reader.IsDBNull(reader.GetOrdinal("FixtureComments")))
                {
                    oCompFinancial.FixtureComments = reader.GetString(reader.GetOrdinal("FixtureComments"));
                }

                if (ColumnExists(reader, "FIXTURETOTALVALUATION") && !reader.IsDBNull(reader.GetOrdinal("FIXTURETOTALVALUATION")))
                {
                    oCompFinancial.FixtureTotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FIXTURETOTALVALUATION")));
                }
                #endregion

                #region Crops Section
                if (ColumnExists(reader, "CropValuation") && !reader.IsDBNull(reader.GetOrdinal("CropValuation")))
                {
                    oCompFinancial.CropValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CropValuation")));
                }

                if (ColumnExists(reader, "CROPVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("CROPVALUATIONPAID")))
                {
                    oCompFinancial.CropPaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CROPVALUATIONPAID")));
                }

                if (ColumnExists(reader, "CropMaxCapCase") && !reader.IsDBNull(reader.GetOrdinal("CropMaxCapCase")))
                {
                    oCompFinancial.CropMaxCapCase = reader.GetString(reader.GetOrdinal("CropMaxCapCase"));
                }

                if (ColumnExists(reader, "CropValAftMaxCap") && !reader.IsDBNull(reader.GetOrdinal("CropValAftMaxCap")))
                {
                    oCompFinancial.CropValAftMaxCap = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CropValAftMaxCap")));
                }

                if (ColumnExists(reader, "CropDA") && !reader.IsDBNull(reader.GetOrdinal("CropDA")))
                {
                    oCompFinancial.CropDA = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CropDA")));
                }

                if (ColumnExists(reader, "CropComments") && !reader.IsDBNull(reader.GetOrdinal("CropComments")))
                {
                    oCompFinancial.CropComments = reader.GetString(reader.GetOrdinal("CropComments"));
                }

                if (ColumnExists(reader, "CROPTOTALVALUATION") && !reader.IsDBNull(reader.GetOrdinal("CROPTOTALVALUATION")))
                {
                    oCompFinancial.CropTotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CROPTOTALVALUATION")));
                }
                #endregion

                #region Summery Section
                if (ColumnExists(reader, "CulturePropValuation") && !reader.IsDBNull(reader.GetOrdinal("CulturePropValuation")))
                {
                    oCompFinancial.CulturePropValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CulturePropValuation")));
                }

                if (ColumnExists(reader, "DamagedCropValuation") && !reader.IsDBNull(reader.GetOrdinal("DamagedCropValuation")))
                {
                    oCompFinancial.DamagedCropValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("DamagedCropValuation")));
                }

                if (ColumnExists(reader, "CULTUREVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("CULTUREVALUATIONPAID")))
                {
                    oCompFinancial.CulturePropPaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("CULTUREVALUATIONPAID")));
                }

                if (ColumnExists(reader, "DAMAGEDCROPVALUATIONPAID") && !reader.IsDBNull(reader.GetOrdinal("DAMAGEDCROPVALUATIONPAID")))
                {
                    oCompFinancial.DamagedCropPaidValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("DAMAGEDCROPVALUATIONPAID")));
                }

                if (ColumnExists(reader, "TotalValuation"))
                {
                    if (!reader.IsDBNull(reader.GetOrdinal("TotalValuation")))
                    {
                        oCompFinancial.TotalValuation = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("TotalValuation")));
                    }
                }

                if (ColumnExists(reader, "NegotiatedAmount") && !reader.IsDBNull(reader.GetOrdinal("NegotiatedAmount")))
                {
                    oCompFinancial.NegotiatedAmount = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("NegotiatedAmount")));
                }

                if (ColumnExists(reader, "NEGOTIATEDAMOUNTPAID") && !reader.IsDBNull(reader.GetOrdinal("NEGOTIATEDAMOUNTPAID")))
                {
                    oCompFinancial.NegotiatedAmountPaid = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("NEGOTIATEDAMOUNTPAID")));
                }

                if (ColumnExists(reader, "FACILITATIONALLOWANCE") && !reader.IsDBNull(reader.GetOrdinal("FACILITATIONALLOWANCE")))
                {
                    oCompFinancial.FacilitationAllowance = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FACILITATIONALLOWANCE")));
                }

                if (ColumnExists(reader, "FACILITATIONALLOWANCEPAID") && !reader.IsDBNull(reader.GetOrdinal("FACILITATIONALLOWANCEPAID")))
                {
                    oCompFinancial.FacilitationAllowancePaid = Convert.ToDecimal(reader.GetValue(reader.GetOrdinal("FACILITATIONALLOWANCEPAID")));
                }

                #endregion

                #region Common Section

                /* if (ColumnExists(reader, "IsDeleted") && !reader.IsDBNull(reader.GetOrdinal("IsDeleted")))
                 * oCompFinancial.IsDeleted = reader.GetString(reader.GetOrdinal("IsDeleted"));
                 *
                 * if (ColumnExists(reader, "CreatedDate") && !reader.IsDBNull(reader.GetOrdinal("CreatedDate")))
                 * oCompFinancial.CreatedDate = reader.GetString(reader.GetOrdinal("CreatedDate"));
                 *
                 * if (ColumnExists(reader, "CreatedBy") && !reader.IsDBNull(reader.GetOrdinal("CreatedBy")))
                 * oCompFinancial.CreatedBy = Convert.ToInt32(reader.GetString(reader.GetOrdinal("CreatedBy")));
                 *
                 * if (ColumnExists(reader, "UpdatedDate") && !reader.IsDBNull(reader.GetOrdinal("UpdatedDate")))
                 * oCompFinancial.UpdatedDate = reader.GetString(reader.GetOrdinal("UpdatedDate"));
                 *
                 * if (ColumnExists(reader, "UpdatedBy") && !reader.IsDBNull(reader.GetOrdinal("UpdatedBy")))
                 * oCompFinancial.UpdatedBy = Convert.ToInt32(reader.GetString(reader.GetOrdinal("UpdatedBy")));*/
                #endregion

                if (ColumnExists(reader, "LAND_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("LAND_APPROVAL_STATUS")))
                {
                    oCompFinancial.Land_Approval_Status = reader.GetString(reader.GetOrdinal("LAND_APPROVAL_STATUS"));
                }

                if (ColumnExists(reader, "REPLACMENT_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("REPLACMENT_APPROVAL_STATUS")))
                {
                    oCompFinancial.Replacment_Approval_Status = reader.GetString(reader.GetOrdinal("REPLACMENT_APPROVAL_STATUS"));
                }

                if (ColumnExists(reader, "FIXTURE_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("FIXTURE_APPROVAL_STATUS")))
                {
                    oCompFinancial.Fixture_Approval_Status = reader.GetString(reader.GetOrdinal("FIXTURE_APPROVAL_STATUS"));
                }

                if (ColumnExists(reader, "CROP_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("CROP_APPROVAL_STATUS")))
                {
                    oCompFinancial.Crop_Approval_Status = reader.GetString(reader.GetOrdinal("CROP_APPROVAL_STATUS"));
                }

                //if (ColumnExists(reader, "LandValComments") && !reader.IsDBNull(reader.GetOrdinal("LandValComments")))
                //    oCompFinancial.LandValComments = reader.GetString(reader.GetOrdinal("LandValComments"));

                if (ColumnExists(reader, "CULTURE_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("CULTURE_APPROVAL_STATUS")))
                {
                    oCompFinancial.Culture_Approval_Status = reader.GetString(reader.GetOrdinal("CULTURE_APPROVAL_STATUS"));
                }

                if (ColumnExists(reader, "DAMAGED_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("DAMAGED_APPROVAL_STATUS")))
                {
                    oCompFinancial.Damaged_Approval_Status = reader.GetString(reader.GetOrdinal("DAMAGED_APPROVAL_STATUS"));
                }

                if (!reader.IsDBNull(reader.GetOrdinal("FACI_APPROVAL_STATUS")))
                {
                    oCompFinancial.Facilitation_Approval_Status = reader.GetValue(reader.GetOrdinal("FACI_APPROVAL_STATUS")).ToString();
                }

                if (ColumnExists(reader, "FINAL_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("FINAL_APPROVAL_STATUS")))
                {
                    oCompFinancial.Final_Approval_Status = reader.GetString(reader.GetOrdinal("FINAL_APPROVAL_STATUS"));
                }

                if (ColumnExists(reader, "NEGO_AMOUNT_APPROVAL_STATUS") && !reader.IsDBNull(reader.GetOrdinal("NEGO_AMOUNT_APPROVAL_STATUS")))
                {
                    oCompFinancial.Nego_Amount_Approval_Status = reader.GetString(reader.GetOrdinal("NEGO_AMOUNT_APPROVAL_STATUS"));
                }
            }
            catch (Exception ex)
            { throw ex; }

            return(oCompFinancial);
        }
Exemplo n.º 14
0
        /// <summary>
        /// To Add Compensation Financial
        /// </summary>
        /// <param name="oCompensationFinancial"></param>
        /// <returns></returns>
        public string AddCompensationFinancial(CompensationFinancialBO oCompensationFinancial)
        {
            cnn = new OracleConnection(con);
            string returnResult = string.Empty;

            proc = "USP_TRN_INS_CMP_FINANCIALS";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection.Open();

            cmd.Parameters.Add("HHID_", oCompensationFinancial.HHID);

            //LAND SECTION
            cmd.Parameters.Add("LandValuation_", oCompensationFinancial.LandValuation);
            cmd.Parameters.Add("LandDA_", oCompensationFinancial.LandDA);
            cmd.Parameters.Add("landtotalvaluation_", oCompensationFinancial.LandTotalValuation);
            cmd.Parameters.Add("LandDiffPayment_", oCompensationFinancial.LandDiffPayment);
            cmd.Parameters.Add("LandValComments_", oCompensationFinancial.LandValComments);

            //RESIDENTIAL STRUCTURE SECTION
            cmd.Parameters.Add("ResDepreciatedValue_", oCompensationFinancial.ResDepreciatedValue);
            cmd.Parameters.Add("ResReplacementValue_", oCompensationFinancial.ResReplacementValue);
            cmd.Parameters.Add("ResDA_", oCompensationFinancial.ResDA);
            cmd.Parameters.Add("ResMovingAllowance_", oCompensationFinancial.ResMovingAllowance);
            cmd.Parameters.Add("ResLabourCost_", oCompensationFinancial.ResLabourCost);
            cmd.Parameters.Add("ResPayment_", oCompensationFinancial.ResPayment);
            cmd.Parameters.Add("rescomments_", oCompensationFinancial.ResComments);
            cmd.Parameters.Add("restotalvaluation_", oCompensationFinancial.ResTotalValuation);

            //FIXTURES SECTION
            cmd.Parameters.Add("FixtureValuation_", oCompensationFinancial.FixtureValuation);
            cmd.Parameters.Add("FixtureDA_", oCompensationFinancial.FixtureDA);
            cmd.Parameters.Add("FixtureTotalValuation_", oCompensationFinancial.FixtureTotalValuation);
            cmd.Parameters.Add("FixtureComments_", oCompensationFinancial.FixtureComments);

            //CROP SECTION
            cmd.Parameters.Add("CropValuation_", oCompensationFinancial.CropValuation);
            cmd.Parameters.Add("CropMaxCapCase_", oCompensationFinancial.CropMaxCapCase);
            cmd.Parameters.Add("CropValAftMaxCap_", oCompensationFinancial.CropValAftMaxCap);
            cmd.Parameters.Add("CropDA_", oCompensationFinancial.CropDA);
            cmd.Parameters.Add("croptotalvaluation_", oCompensationFinancial.CropTotalValuation);
            cmd.Parameters.Add("CropComments_", oCompensationFinancial.CropComments);

            //SUMMERY SECTION
            cmd.Parameters.Add("CulturePropValuation_", oCompensationFinancial.CulturePropValuation);
            cmd.Parameters.Add("DamagedCropValuation_", oCompensationFinancial.DamagedCropValuation);
            cmd.Parameters.Add("totalothervaluation_", oCompensationFinancial.TotalOtherValuation);
            cmd.Parameters.Add("NegotiatedAmount_", oCompensationFinancial.NegotiatedAmount);
            cmd.Parameters.Add("LandInKindCompensation_", oCompensationFinancial.LandInKindCompensation);
            cmd.Parameters.Add("resinkindcompensation_", oCompensationFinancial.ResInKindCompensation);
            cmd.Parameters.Add("FacilitationAllowance_", oCompensationFinancial.FacilitationAllowance);

            //COMMON SECTION
            cmd.Parameters.Add("isdeleted_", oCompensationFinancial.IsDeleted);
            cmd.Parameters.Add("createdby_", oCompensationFinancial.CreatedBy);
            cmd.Parameters.Add("errorMessage_", OracleDbType.Varchar2, 500).Direction = ParameterDirection.Output;
            cmd.ExecuteNonQuery();

            if (cmd.Parameters["errorMessage_"].Value != null)
            {
                returnResult = cmd.Parameters["errorMessage_"].Value.ToString();
            }
            else
            {
                returnResult = string.Empty;
            }

            cmd.Connection.Close();
            return(returnResult);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Load Summery Details
        /// </summary>
        private void LoadSummery()
        {
            CompensationFinancialBLL oCompensationFinancialBLL = new CompensationFinancialBLL();
            CompensationFinancialBO  oCompensationFinancial    = oCompensationFinancialBLL.GetCompensationFinancial(Convert.ToInt32(Session["HH_ID"]));

            // Replaced on 08jan2013 ResPayment as ResTotalValuation
            if (oCompensationFinancial != null)
            {
                txtLandValuation.Text     = UtilBO.CurrencyFormat(oCompensationFinancial.LandTotalValuation);       //oCompensationFinancial.LandTotalValuation.ToString();
                txtFixturesValuation.Text = UtilBO.CurrencyFormat(oCompensationFinancial.FixtureTotalValuation);    //oCompensationFinancial.FixtureTotalValuation.ToString();
                txtCropsValuation.Text    = UtilBO.CurrencyFormat(oCompensationFinancial.CropTotalValuation);       //oCompensationFinancial.CropTotalValuation.ToString();
                //decimal ReplacementHouseValue = oCompensationFinancial.ResReplacementValue + (oCompensationFinancial.ResReplacementValue * oCompensationFinancial.ResDA) / 100;
                txtReplacementHouseValue.Text = UtilBO.CurrencyFormat(oCompensationFinancial.ResPayment);           //UtilBO.CurrencyFormat(oCompensationFinancial.ResTotalValuation);ResPayment //oCompensationFinancial.ResTotalValuation.ToString();//ReplacementHouseValue.ToString();
                txtDamagedCropValue.Text      = UtilBO.CurrencyFormat(oCompensationFinancial.DamagedCropValuation); //oCompensationFinancial.DamagedCropValuation.ToString();
                txtCultureProperty.Text       = UtilBO.CurrencyFormat(oCompensationFinancial.CulturePropValuation); //oCompensationFinancial.DamagedCropValuation.ToString();
                txtFacilitation.Text          = UtilBO.CurrencyFormat(oCompensationFinancial.FacilitationAllowance);
                txtFinalCompensation.Text     = UtilBO.CurrencyFormat(oCompensationFinancial.LandTotalValuation + oCompensationFinancial.FixtureTotalValuation +
                                                                      oCompensationFinancial.CropTotalValuation + oCompensationFinancial.ResPayment +
                                                                      oCompensationFinancial.DamagedCropValuation + oCompensationFinancial.CulturePropValuation + oCompensationFinancial.FacilitationAllowance); //oCompensationFinancial.TotalValuation.ToString();
                txtNegotiatedAmount.Text = UtilBO.CurrencyFormat(oCompensationFinancial.NegotiatedAmount);                                                                                                       //oCompensationFinancial.NegotiatedAmount.ToString();//Newly Added
                txtInKindLand.Text       = oCompensationFinancial.LandInKindCompensation.ToString().Trim();

                ddlResidentialStructure.ClearSelection();
                if (string.IsNullOrEmpty(oCompensationFinancial.ResInKindCompensation))
                {
                    ddlResidentialStructure.ClearSelection();
                }
                else
                {
                    if (ddlResidentialStructure.Items.FindByValue(oCompensationFinancial.ResInKindCompensation.ToString()) != null)
                    {
                        ddlResidentialStructure.ClearSelection();
                        ddlResidentialStructure.Items.FindByValue(oCompensationFinancial.ResInKindCompensation.ToString()).Selected = true;
                    }
                }
                txtResidentialStructure.Text = "";
                if (ddlResidentialStructure.SelectedIndex > 0)
                {
                    txtResidentialStructure.Text = ddlResidentialStructure.SelectedItem.Text;
                }
                //Displaying LABEL APPROVAL STATUS
                //--------------------------------------------LAND STATUS-----------------------------------------------------
                if (oCompensationFinancial.Land_Approval_Status != null && oCompensationFinancial.Land_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblLandValuationMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Land_Approval_Status + "</font>";
                }
                else
                {
                    lblLandValuationMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Land_Approval_Status + "</font>";
                }
                //--------------------------------------------FIXTURE STATUS-----------------------------------------------------
                if (oCompensationFinancial.Fixture_Approval_Status != null && oCompensationFinancial.Fixture_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblFixturesValuationMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Fixture_Approval_Status + "</font>";
                }
                else
                {
                    lblFixturesValuationMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Fixture_Approval_Status + "</font>";
                }
                //--------------------------------------------CROP STATUS-----------------------------------------------------
                if (oCompensationFinancial.Crop_Approval_Status != null && oCompensationFinancial.Crop_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblCropsValuationMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Crop_Approval_Status + "</font>";
                }
                else
                {
                    lblCropsValuationMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Crop_Approval_Status + "</font>";
                }
                //--------------------------------------------REPLACEMENT STATUS-----------------------------------------------------
                if (oCompensationFinancial.Replacment_Approval_Status != null && oCompensationFinancial.Replacment_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblReplacementHouseValueMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Replacment_Approval_Status + "</font>";
                }
                else
                {
                    lblReplacementHouseValueMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Replacment_Approval_Status + "</font>";
                }
                //--------------------------------------------DAMAGED STATUS-----------------------------------------------------
                if (oCompensationFinancial.Damaged_Approval_Status != null && oCompensationFinancial.Damaged_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblDamagedCropValueMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Damaged_Approval_Status + "</font>";
                }
                else
                {
                    lblDamagedCropValueMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Damaged_Approval_Status + "</font>";
                }
                //--------------------------------------------CULTURE PROPERTIES STATUS-----------------------------------------------------
                if (oCompensationFinancial.Culture_Approval_Status != null && oCompensationFinancial.Culture_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblCulturePropertyMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Culture_Approval_Status + "</font>";
                }
                else
                {
                    lblCulturePropertyMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Culture_Approval_Status + "</font>";
                }
                //--------------------------------------------FACILITATION PROPERTIES STATUS-----------------------------------------------------
                if (oCompensationFinancial.Facilitation_Approval_Status != null && oCompensationFinancial.Facilitation_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblFacilitationMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Facilitation_Approval_Status + "</font>";
                }
                else
                {
                    lblFacilitationMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Facilitation_Approval_Status + "</font>";
                }
                //--------------------------------------------FINAL STATUS-----------------------------------------------------
                if (oCompensationFinancial.Final_Approval_Status != null && oCompensationFinancial.Final_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblFinalCompensationMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Final_Approval_Status + "</font>";
                }
                else
                {
                    lblFinalCompensationMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Final_Approval_Status + "</font>";
                }
                //--------------------------------------------NEGOTIATED STATUS-----------------------------------------------------
                if (oCompensationFinancial.Nego_Amount_Approval_Status != null && oCompensationFinancial.Nego_Amount_Approval_Status.ToUpper() == "APPROVED")
                {
                    lblNegotiatedAmountMsg.Text = "<font class='StatusApproved'>" + oCompensationFinancial.Nego_Amount_Approval_Status + "</font>";
                }
                else
                {
                    lblNegotiatedAmountMsg.Text = "<font class='StatusPending'>" + oCompensationFinancial.Nego_Amount_Approval_Status + "</font>";
                }

                //Disabling Checkbox For Approved & Request Pending & Submitted
                string LAS = oCompensationFinancial.Land_Approval_Status;
                string FAS = oCompensationFinancial.Fixture_Approval_Status;
                string CAL = oCompensationFinancial.Crop_Approval_Status;

                string RAL = oCompensationFinancial.Replacment_Approval_Status;
                string DAL = oCompensationFinancial.Damaged_Approval_Status;
                string CPAL = oCompensationFinancial.Culture_Approval_Status;
                string OPAL = oCompensationFinancial.Facilitation_Approval_Status;
                string FCAL = oCompensationFinancial.Final_Approval_Status;
                string NAAS = oCompensationFinancial.Nego_Amount_Approval_Status;
                int    statusCount = 0;
                int    chkcount = 7;
                int    cl = 1, cf = 1, cc = 1, cd = 1, cr = 1, cneg = 0, ccu = 1, co = 1;
                // start
                if ((txtLandValuation.Text.Trim() == "" || oCompensationFinancial.LandTotalValuation == 0) &&
                    (txtInKindLand.Text.Trim() == "" || oCompensationFinancial.LandInKindCompensation == 0))
                {
                    chkLandValuation.Style.Add("display", "none");
                    chkcount--;
                    cl = 0;
                }

                if (txtFixturesValuation.Text.Trim() == "" || oCompensationFinancial.FixtureTotalValuation == 0)
                {
                    chkFixtureValuation.Style.Add("display", "none");
                    chkcount--;
                    cf = 0;
                }

                if (txtCropsValuation.Text.Trim() == "" || oCompensationFinancial.CropTotalValuation == 0)
                {
                    chkCropsValuation.Style.Add("display", "none");
                    chkcount--;
                    cc = 0;
                }

                if ((txtReplacementHouseValue.Text.Trim() == "" || oCompensationFinancial.ResPayment == 0) && (txtResidentialStructure.Text.Trim() == "" || txtResidentialStructure.Text.Trim().ToUpper() == "NA"))
                {
                    chkReplacementHouseValue.Style.Add("display", "none");
                    chkcount--;
                    cr = 0;
                }

                if (txtDamagedCropValue.Text.Trim() == "" || oCompensationFinancial.DamagedCropValuation == 0)
                {
                    chkDamagedCropValue.Style.Add("display", "none");
                    chkcount--;
                    cd = 0;
                }

                if (txtCultureProperty.Text.Trim() == "" || oCompensationFinancial.CulturePropValuation == 0)
                {
                    chkCulturePropertyValue.Style.Add("display", "none");
                    chkcount--;
                    ccu = 0;
                }

                if (txtFacilitation.Text.Trim() == "" || oCompensationFinancial.FacilitationAllowance == 0)
                {
                    chkFacilitationValue.Style.Add("display", "none");
                    chkcount--;
                    co = 0;
                }

                if ((cl + cf + cc + cd + cr + ccu + co) <= 0)
                {
                    ChkAll.Style.Add("display", "none");
                }
                chkcount = 7;
                //if (txtFinalCompensation.Text.Trim() == "" || oCompensationFinancial.TotalValuation == 0)
                //    chkFinalCompensation.Style.Add("display", "none");

                if (txtNegotiatedAmount.Text.Trim() == "" || oCompensationFinancial.NegotiatedAmount == 0)
                {
                    chkNegotiatedAmount.Style.Add("display", "none");
                }
                else
                {
                    cneg++;
                    chkLandValuation.Style.Add("display", "none");
                    chkFixtureValuation.Style.Add("display", "none");
                    chkCropsValuation.Style.Add("display", "none");
                    chkReplacementHouseValue.Style.Add("display", "none");
                    chkDamagedCropValue.Style.Add("display", "none");
                    chkCulturePropertyValue.Style.Add("display", "none");
                    chkFacilitationValue.Style.Add("display", "none");
                    ChkAll.Style.Add("display", "none");
                }
                //end

                if ((!string.IsNullOrEmpty(LAS) && LAS.Length > 3) && (LAS.Substring(0, 3).ToUpper() == "APP" || LAS.Substring(0, 3).ToUpper() == "SUB" || LAS.Substring(0, 3).ToUpper() == "REQ"))//LAS.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkLandValuation.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    cl = 0;
                }

                if ((!string.IsNullOrEmpty(FAS) && FAS.Length > 3) && (FAS.Substring(0, 3).ToUpper() == "APP" || FAS.Substring(0, 3).ToUpper() == "SUB" || FAS.Substring(0, 3).ToUpper() == "REQ"))//FAS.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkFixtureValuation.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    cf = 0;
                }

                if ((!string.IsNullOrEmpty(CAL) && CAL.Length > 3) && (CAL.Substring(0, 3).ToUpper() == "APP" || CAL.Substring(0, 3).ToUpper() == "SUB" || CAL.Substring(0, 3).ToUpper() == "REQ"))//CAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkCropsValuation.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    cc = 0;
                }

                if ((!string.IsNullOrEmpty(RAL) && RAL.Length > 3) && (RAL.Substring(0, 3).ToUpper() == "APP" || RAL.Substring(0, 3).ToUpper() == "SUB" || RAL.Substring(0, 3).ToUpper() == "REQ"))//RAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkReplacementHouseValue.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    cr = 0;
                }

                if ((!string.IsNullOrEmpty(DAL) && DAL.Length > 3) && (DAL.Substring(0, 3).ToUpper() == "APP" || DAL.Substring(0, 3).ToUpper() == "SUB" || DAL.Substring(0, 3).ToUpper() == "REQ"))//DAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkDamagedCropValue.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    cd = 0;
                }

                if ((!string.IsNullOrEmpty(CPAL) && CPAL.Length > 3) && (CPAL.Substring(0, 3).ToUpper() == "APP" || CPAL.Substring(0, 3).ToUpper() == "SUB" || CPAL.Substring(0, 3).ToUpper() == "REQ"))//CPAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkCulturePropertyValue.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    ccu = 0;
                }

                if ((!string.IsNullOrEmpty(OPAL) && OPAL.Length > 3) && (OPAL.Substring(0, 3).ToUpper() == "APP" || OPAL.Substring(0, 3).ToUpper() == "SUB" || OPAL.Substring(0, 3).ToUpper() == "REQ"))//CPAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    chkFacilitationValue.Style.Add("display", "none");
                    statusCount++;
                    chkcount--;
                    co = 0;
                }

                if ((cl + cf + cc + cd + cr + ccu + co) <= 0)
                {
                    ChkAll.Style.Add("display", "none");
                    pnlPaymentRequest.Visible = false;
                }

                if ((!string.IsNullOrEmpty(FCAL) && FCAL.Length > 3) && (FCAL.Substring(0, 3).ToUpper() == "APP" || FCAL.Substring(0, 3).ToUpper() == "SUB" || FCAL.Substring(0, 3).ToUpper() == "REQ"))//FCAL.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    DisableAllCheckBox();
                }

                if ((!string.IsNullOrEmpty(NAAS) && NAAS.Length > 3) && (NAAS.Substring(0, 3).ToUpper() == "APP" || NAAS.Substring(0, 3).ToUpper() == "SUB" || NAAS.Substring(0, 3).ToUpper() == "REQ"))//NAAS.Substring(0, 3).ToUpper() == "DEC" ||
                {
                    DisableAllCheckBox();
                }
                if (statusCount > 0)
                {
                    //chkFinalCompensation.Style.Add("display", "none");
                    chkNegotiatedAmount.Style.Add("display", "none");
                    cneg = 0;
                }
                if (cneg > 0)
                {
                    pnlPaymentRequest.Visible = true;
                }
                GetPAPValuationSummery_NegotiatedAmount((oCompensationFinancial.LandTotalValuation + oCompensationFinancial.FixtureTotalValuation +
                                                         oCompensationFinancial.CropTotalValuation + oCompensationFinancial.ResPayment +
                                                         oCompensationFinancial.DamagedCropValuation + oCompensationFinancial.CulturePropValuation + oCompensationFinancial.FacilitationAllowance), oCompensationFinancial.NegotiatedAmount);

                if ((!string.IsNullOrEmpty(LAS) && LAS.Length > 3) && (LAS.Substring(0, 3).ToUpper() == "SUB" || LAS.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(FAS) && FAS.Length > 3) && (FAS.Substring(0, 3).ToUpper() == "SUB" || FAS.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(CAL) && CAL.Length > 3) && (CAL.Substring(0, 3).ToUpper() == "SUB" || CAL.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(RAL) && RAL.Length > 3) && (RAL.Substring(0, 3).ToUpper() == "SUB" || RAL.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(DAL) && DAL.Length > 3) && (DAL.Substring(0, 3).ToUpper() == "SUB" || DAL.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(CPAL) && CPAL.Length > 3) && (CPAL.Substring(0, 3).ToUpper() == "SUB" || CPAL.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(OPAL) && OPAL.Length > 3) && (OPAL.Substring(0, 3).ToUpper() == "SUB" || OPAL.Substring(0, 3).ToUpper() == "REQ") ||
                    (!string.IsNullOrEmpty(NAAS) && NAAS.Length > 3) && (NAAS.Substring(0, 3).ToUpper() == "SUB" || NAAS.Substring(0, 3).ToUpper() == "REQ"))
                {
                    ViewState["Valuation_Status"] = "Request Pending";
                }
                else
                {
                    ViewState["Valuation_Status"] = "None";
                }
            }
            else
            {
                DisableAllCheckBox();
            }
        }
Exemplo n.º 16
0
 /// <summary>
 /// To Update Compensation Financial
 /// </summary>
 /// <param name="oCompensationFinancialBO"></param>
 /// <returns></returns>
 public string UpdateCompensationFinancial(CompensationFinancialBO oCompensationFinancialBO)//(int HHID,string ResStructInKindCompensation,decimal FacilitationAllowance,int UpdatedBy)
 {
     oPaymentDAL = new PaymentDAL();
     return(oPaymentDAL.UpdateCompensationFinancial(oCompensationFinancialBO));
 }
Exemplo n.º 17
0
        /// <summary>
        /// To Get Compensation Financial By Id
        /// </summary>
        /// <param name="CompPaymentId"></param>
        /// <param name="HHID"></param>
        /// <returns></returns>
        public CompensationFinancialBO GetCompensationFinancialById(int CompPaymentId, int HHID)
        {
            proc = "USP_TRN_GET_CMP_FIN_PAYBYID";
            cnn  = new OracleConnection(con);
            CompensationFinancialBO objCompensationFinancial = null;

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("HHID_", HHID);
            cmd.Parameters.Add("CMP_PAYMENTID_", CompPaymentId);
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                cmd.Connection.Open();
                OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                while (dr.Read())
                {
                    objCompensationFinancial = new CompensationFinancialBO();
                    if (!dr.IsDBNull(dr.GetOrdinal("CMP_PAYMENTID")))
                    {
                        objCompensationFinancial.CompPaymentId = dr.GetInt32(dr.GetOrdinal("CMP_PAYMENTID"));
                    }

                    if (!dr.IsDBNull(dr.GetOrdinal("HHID")))
                    {
                        objCompensationFinancial.HHID = dr.GetInt32(dr.GetOrdinal("HHID"));
                    }

                    if (ColumnExists(dr, "LANDVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("LANDVALUATIONPAID")))
                    {
                        objCompensationFinancial.LandPaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("LANDVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "RESVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("RESVALUATIONPAID")))
                    {
                        objCompensationFinancial.ResPaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("RESVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "FIXTUREVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("FIXTUREVALUATIONPAID")))
                    {
                        objCompensationFinancial.FixturePaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FIXTUREVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "CROPVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("CROPVALUATIONPAID")))
                    {
                        objCompensationFinancial.CropPaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("CROPVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "CULTUREVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("CULTUREVALUATIONPAID")))
                    {
                        objCompensationFinancial.CulturePropPaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("CULTUREVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "DAMAGEDCROPVALUATIONPAID") && !dr.IsDBNull(dr.GetOrdinal("DAMAGEDCROPVALUATIONPAID")))
                    {
                        objCompensationFinancial.DamagedCropPaidValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("DAMAGEDCROPVALUATIONPAID")));
                    }

                    if (ColumnExists(dr, "NEGOTIATEDAMOUNTPAID") && !dr.IsDBNull(dr.GetOrdinal("NEGOTIATEDAMOUNTPAID")))
                    {
                        objCompensationFinancial.NegotiatedAmountPaid = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("NEGOTIATEDAMOUNTPAID")));
                    }

                    if (ColumnExists(dr, "FACILITATIONALLOWANCEPAID") && !dr.IsDBNull(dr.GetOrdinal("FACILITATIONALLOWANCEPAID")))
                    {
                        objCompensationFinancial.FacilitationAllowancePaid = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FACILITATIONALLOWANCEPAID")));
                    }
                }

                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(objCompensationFinancial);
        }
Exemplo n.º 18
0
        public CompensationFinancialBO getCompnesationFinancial(int HHID)
        {
            OracleConnection cnn = new OracleConnection(con);
            OracleCommand    cmd;

            string proc = "USP_TRN_GET_CMP_PAYMENTSUMMERY";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("hhid_", HHID);
            cmd.Parameters.Add("Sp_recordset", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            cmd.Connection.Open();
            OracleDataReader        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            CompensationFinancialBO oCompensationFinancialBO = null;

            //CompensationFinancialList lstCompensationFinancial = new CompensationFinancialList();

            while (dr.Read())
            {
                oCompensationFinancialBO = new CompensationFinancialBO();

                if (ColumnExists(dr, "cmp_financialid") && !dr.IsDBNull(dr.GetOrdinal("cmp_financialid")))
                {
                    oCompensationFinancialBO.Cmp_FinancialID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("cmp_financialid")));
                }

                if (ColumnExists(dr, "HHID") && !dr.IsDBNull(dr.GetOrdinal("HHID")))
                {
                    oCompensationFinancialBO.HHID = Convert.ToInt32(dr.GetValue(dr.GetOrdinal("HHID")));
                }

                if (ColumnExists(dr, "FacilitationAllowance") && !dr.IsDBNull(dr.GetOrdinal("FacilitationAllowance")))
                {
                    oCompensationFinancialBO.FacilitationAllowance = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FacilitationAllowance")));
                }

                if (ColumnExists(dr, "FACILITATIONALLOWANCEPAID") && !dr.IsDBNull(dr.GetOrdinal("FACILITATIONALLOWANCEPAID")))
                {
                    oCompensationFinancialBO.FacilitationAllowancePaid = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("FACILITATIONALLOWANCEPAID")));
                }

                if (ColumnExists(dr, "TotalValuation") && !dr.IsDBNull(dr.GetOrdinal("TotalValuation")))
                {
                    oCompensationFinancialBO.TotalValuation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("TotalValuation")));
                }

                if (ColumnExists(dr, "ResInKindCompensation") && !dr.IsDBNull(dr.GetOrdinal("ResInKindCompensation")))
                {
                    oCompensationFinancialBO.ResInKindCompensation = dr.GetString(dr.GetOrdinal("ResInKindCompensation"));
                }

                if (ColumnExists(dr, "LandInKindCompensation") && !dr.IsDBNull(dr.GetOrdinal("LandInKindCompensation")))
                {
                    oCompensationFinancialBO.LandInKindCompensation = Convert.ToDecimal(dr.GetValue(dr.GetOrdinal("LandInKindCompensation")));
                }
            }

            dr.Close();

            return(oCompensationFinancialBO);
        }
Exemplo n.º 19
0
        /// <summary>
        /// to Add data to Datat base
        /// </summary>
        /// <returns></returns>
        private string AddData()
        {
            oCompensationFinancial = new WIS_BusinessObjects.CompensationFinancialBO();
            string strMax = string.Empty;

            //oCompensationFinancial.Cmp_FinancialID = "";
            if (Session["HH_ID"] != null)
            {
                oCompensationFinancial.HHID = Convert.ToInt32(Session["HH_ID"]);
            }
            oCompensationFinancialBLL = new CompensationFinancialBLL();

            oCompensationFinancial.CreatedBy = Convert.ToInt32(Session["USER_ID"].ToString());
            oCompensationFinancial.IsDeleted = "False";
            //LAND SECTION
            #region Land Section
            if (!string.IsNullOrEmpty(txtLandValuation.Text))
            {
                oCompensationFinancial.LandValuation = Convert.ToDecimal(txtLandValuation.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtLandDAinPercentage.Text))
            {
                oCompensationFinancial.LandDA = Convert.ToDecimal(txtLandDAinPercentage.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtAcreageDifferencePayment.Text))
            {
                oCompensationFinancial.LandDiffPayment = Convert.ToDecimal(txtAcreageDifferencePayment.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtLandValuation.Text) && !string.IsNullOrEmpty(txtLandDAinAmount.Text))
            {
                oCompensationFinancial.LandTotalValuation = Convert.ToDecimal(txtLandValuation.Text.Trim()) + Convert.ToDecimal(txtLandDAinAmount.Text.Trim());
            }

            strMax = txtLandComments.Text.Trim();
            if (strMax.Trim().Length > 1000)
            {
                strMax = txtLandComments.Text.Trim().Substring(0, 999);
            }

            oCompensationFinancial.LandValComments = strMax;
            #endregion

            //RESIDENTIAL STRUCTURE
            #region Residencial Structure
            if (!string.IsNullOrEmpty(txtRSDepreciatedValue.Text))
            {
                oCompensationFinancial.ResDepreciatedValue = Convert.ToDecimal(txtRSDepreciatedValue.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSReplacementValue.Text))
            {
                oCompensationFinancial.ResReplacementValue = Convert.ToDecimal(txtRSReplacementValue.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSDAinPercentage.Text))
            {
                oCompensationFinancial.ResDA = Convert.ToDecimal(txtRSDAinPercentage.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSMovingAllowance.Text))
            {
                oCompensationFinancial.ResMovingAllowance = Convert.ToDecimal(txtRSMovingAllowance.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSLabourCost.Text))
            {
                oCompensationFinancial.ResLabourCost = Convert.ToDecimal(txtRSLabourCost.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSPaymentHighHouseValue.Text))
            {
                oCompensationFinancial.ResPayment = Convert.ToDecimal(txtRSPaymentHighHouseValue.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSReplacementValue.Text))                                               // && !string.IsNullOrEmpty(txtResidentialDAinAmount.Text))//Calculated mannually
            {
                oCompensationFinancial.ResTotalValuation = Convert.ToDecimal(txtRSReplacementValue.Text.Trim()); // +Convert.ToDecimal(txtResidentialDAinAmount.Text.Trim());
            }
            strMax = txtResidentialStructureComments.Text.Trim();
            if (strMax.Trim().Length >= 1000)
            {
                strMax = txtLandComments.Text.Trim().Substring(0, 999);
            }
            oCompensationFinancial.ResComments = strMax;
            #endregion

            //FIXTURES
            #region Fixture Section
            if (!string.IsNullOrEmpty(txtFixturesValuation.Text))
            {
                oCompensationFinancial.FixtureValuation = Convert.ToDecimal(txtFixturesValuation.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtFixturesDAinPercentage.Text))
            {
                oCompensationFinancial.FixtureDA = Convert.ToDecimal(txtFixturesDAinPercentage.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtFixturesDAinAmount.Text) && !string.IsNullOrEmpty(txtFixturesValuation.Text))
            {
                oCompensationFinancial.FixtureTotalValuation = Convert.ToDecimal(txtFixturesDAinAmount.Text.Trim()) + Convert.ToDecimal(txtFixturesValuation.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtRSDepreciatedValue.Text))
            {
                oCompensationFinancial.ResDepreciatedValue = Convert.ToDecimal(txtRSDepreciatedValue.Text.Trim());
            }

            strMax = txtFixturesComments.Text.Trim();
            if (strMax.Trim().Length >= 1000)
            {
                strMax = txtLandComments.Text.Trim().Substring(0, 999);
            }
            oCompensationFinancial.FixtureComments = strMax;
            #endregion

            //CROPS
            #region Crops Section
            if (!string.IsNullOrEmpty(txtCropsValuation.Text))
            {
                oCompensationFinancial.CropValuation = Convert.ToDecimal(txtCropsValuation.Text.Trim());
            }

            //CheckBox
            if (chkMaxCapCase.Checked)
            {
                oCompensationFinancial.CropMaxCapCase = "Yes";
            }
            else
            {
                oCompensationFinancial.CropMaxCapCase = "No";
            }

            if (!string.IsNullOrEmpty(txtValuationAfterMaxCap.Text))
            {
                oCompensationFinancial.CropValAftMaxCap = Convert.ToDecimal(txtValuationAfterMaxCap.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtCropsDAinPercentage.Text))
            {
                oCompensationFinancial.CropDA = Convert.ToDecimal(txtCropsDAinPercentage.Text.Trim());
            }

            if (chkMaxCapCase.Checked)
            {
                if (!string.IsNullOrEmpty(txtValuationAfterMaxCap.Text) && !string.IsNullOrEmpty(txtCropsDAinAmount.Text))
                {
                    oCompensationFinancial.CropTotalValuation = Convert.ToDecimal(txtValuationAfterMaxCap.Text.Trim()) + Convert.ToDecimal(txtCropsDAinAmount.Text.Trim());
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(txtCropsValuation.Text) && !string.IsNullOrEmpty(txtCropsDAinAmount.Text))
                {
                    oCompensationFinancial.CropTotalValuation = Convert.ToDecimal(txtCropsValuation.Text.Trim()) + Convert.ToDecimal(txtCropsDAinAmount.Text.Trim());
                }
            }
            strMax = txtCropsComments.Text.Trim();
            if (strMax.Trim().Length >= 1000)
            {
                strMax = txtLandComments.Text.Trim().Substring(0, 999);
            }
            oCompensationFinancial.CropComments = strMax;

            #endregion

            //OTHERS
            #region Others
            if (!string.IsNullOrEmpty(txtCulturePropertyValue.Text))
            {
                oCompensationFinancial.CulturePropValuation = Convert.ToDecimal(txtCulturePropertyValue.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtOtherDamagedCrops.Text))
            {
                oCompensationFinancial.DamagedCropValuation = Convert.ToDecimal(txtOtherDamagedCrops.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtCulturePropertyValue.Text) && !string.IsNullOrEmpty(txtOtherDamagedCrops.Text))
            {
                oCompensationFinancial.TotalOtherValuation = Convert.ToDecimal(txtCulturePropertyValue.Text.Trim()) + Convert.ToDecimal(txtOtherDamagedCrops.Text.Trim());
            }
            #endregion

            //SUMMERY
            #region Summery Section
            if (!string.IsNullOrEmpty(txtNegotiatedAmount.Text))
            {
                oCompensationFinancial.NegotiatedAmount = Convert.ToDecimal(txtNegotiatedAmount.Text.Trim());
            }

            if (!string.IsNullOrEmpty(txtInKindLand.Text))
            {
                oCompensationFinancial.LandInKindCompensation = Convert.ToDecimal(txtInKindLand.Text.Trim());
            }

            if (ddlResidentialStructure.SelectedItem.ToString() == "0")
            {
                oCompensationFinancial.ResInKindCompensation = "-1";
            }
            else
            {
                oCompensationFinancial.ResInKindCompensation = ddlResidentialStructure.SelectedItem.ToString();
            }
            if (txtFacilitationallowances.Text.Trim() != "")
            {
                oCompensationFinancial.FacilitationAllowance = Convert.ToDecimal(txtFacilitationallowances.Text.Trim());
            }
            //if (!string.IsNullOrEmpty(txtRSDepreciatedValue.Text))
            //    oCompensationFinancial.ResDepreciatedValue = Convert.ToDecimal(txtRSDepreciatedValue.Text.Trim());
            #endregion
            string message = oCompensationFinancialBLL.AddCompensationFinancial(oCompensationFinancial);

            if (message == "null" || message == null || message == "")
            {
                CompensationFinancialBO objCompensationFinancialBO = new CompensationFinancialBO();
                if (dpDeliveryDate.Text != null)
                {
                    objCompensationFinancialBO.DeliveryDate = Convert.ToDateTime(dpDeliveryDate.Text);
                }

                if (Convert.ToInt32(ddlDeliveredBy.SelectedValue.ToString()) > 0)
                {
                    objCompensationFinancialBO.DeliveredBy = Convert.ToInt32(ddlDeliveredBy.SelectedValue.ToString());
                }
                objCompensationFinancialBO.HHID      = SessionHHID;
                objCompensationFinancialBO.CreatedBy = Convert.ToInt32(Session["USER_ID"].ToString());

                if (rdoActionRejected.Checked)
                {
                    objCompensationFinancialBO.PAPAction = "N";
                }
                else
                {
                    objCompensationFinancialBO.PAPAction = "Y";
                }
                string sDeliveryComments = txtPackageDeliveryInfoComments.Text.Trim();
                if (sDeliveryComments.Trim().Length >= 1000)
                {
                    sDeliveryComments = sDeliveryComments.Trim().Substring(0, 999);
                }
                objCompensationFinancialBO.DeliveryComments = sDeliveryComments;

                oCompensationFinancialBLL.AddPackageDeliveryInfo(objCompensationFinancialBO);
            }

            return(message);
        }