/// <summary> /// To fetch projectsegment by ID and assign to textbox /// </summary> private void GetProjectSegmentByID() { ProjectBLL oProjectBLL = new ProjectBLL(); SegmentBO oProjectSegment = oProjectBLL.GetProjectSegmentByID(ViewStateProjectSegmentId); if (oProjectSegment != null) { txtSegmentName.Text = oProjectSegment.SegmentName; txtRouteLength.Text = oProjectSegment.RouteLength; ddlTypeLine.SelectedValue = oProjectSegment.LineTypeID.ToString(); lblRightofWayMeasurement.Text = oProjectSegment.RightOfWay; lblWayLeaveMeasurement.Text = oProjectSegment.WayLeave; txtEstBudget.Text = UtilBO.CurrencyFormat(oProjectSegment.EstBudget); txtImplementationPeriod.Text = oProjectSegment.ImplementationPeriod.ToString(); dpConstructionStartDate.Text = Convert.ToString(oProjectSegment.ConstrStartDate.ToString(UtilBO.DateFormat)); dpConstructionEndDate.Text = Convert.ToString(oProjectSegment.ConstrEndDate.ToString(UtilBO.DateFormat)); txtfunder.Text = oProjectSegment.Funder; ddlBank.ClearSelection(); if (ddlBank.Items.FindByValue(oProjectSegment.Bankid.ToString()) != null) { ddlBank.Items.FindByValue(oProjectSegment.Bankid.ToString()).Selected = true; } txtValueofhouse.Text = UtilBO.CurrencyFormat(oProjectSegment.Valueofhouse); } DisplayEstBudget(); }
/// <summary> /// Method to fetch currency format from database /// </summary> public void getBudgetEstimationfromProject() { ProjectBLL objProjectBLL = new ProjectBLL(); ProjectBO objProject = objProjectBLL.GetProjectByProjectID(Convert.ToInt32(Session["PROJECT_ID"])); TBSTextBox.Text = UtilBO.CurrencyFormat(objProject.TotalEstBudget); BudgetEstimationIDTextBox.Text = "0"; }
/// <summary> /// Set link attributes to Branch link /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdFence_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal litDimensions = (Literal)e.Row.FindControl("litDimensions"); decimal fenceLength = (decimal)DataBinder.Eval(e.Row.DataItem, "DIMEN_LENGTH"); decimal fenceHeight = (decimal)DataBinder.Eval(e.Row.DataItem, "DIMEN_WIDTH"); litDimensions.Text = (fenceLength * fenceHeight).ToString(); Literal litDepreciatedValue = (Literal)e.Row.FindControl("litDepreciatedValue"); // Literal litAmountPaid = (Literal)e.Row.FindControl("litAmountPaid"); decimal DepreciatedValue = (decimal)DataBinder.Eval(e.Row.DataItem, "DEPRECIATEDVALUE"); //decimal AmountPaid = (decimal)DataBinder.Eval(e.Row.DataItem, "AMOUNTPAID"); litDepreciatedValue.Text = UtilBO.CurrencyFormat(DepreciatedValue); // litAmountPaid.Text = UtilBO.CurrencyFormat(AmountPaid); Literal PAPOtherFixID = (Literal)e.Row.FindControl("litUserID"); System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto"); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto"); int ProjectID = 0; int HHID = 0; int userID = 0; string ProjectCode = string.Empty; string PermanentStructId = PAPOtherFixID.Text.ToString(); if (Session["PROJECT_ID"] != null) { ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); } if (Session["HH_ID"] != null) { HHID = Convert.ToInt32(Session["HH_ID"]); } if (Session["USER_ID"] != null) { userID = Convert.ToInt32(Session["USER_ID"]); } if (Session["PROJECT_CODE"] != null) { ProjectCode = Session["PROJECT_CODE"].ToString(); } string PhotoModule = "PAPOHFIX"; string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto); string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkViewPhoto.Attributes.Add("onclick", paramPhotoView); } }
/// <summary> /// to set controls in grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdDamagedCrops_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DateTime dateDamaged = Convert.ToDateTime(DataBinder.Eval(e.Row.DataItem, "DATEDAMAGED")); if (dateDamaged != DateTime.MinValue) { ((Literal)e.Row.FindControl("litDateDamaged")).Text = dateDamaged.ToString(UtilBO.DateFormat); } Literal litCropRate = (Literal)e.Row.FindControl("litCropRate"); Literal litAmountPaid = (Literal)e.Row.FindControl("litAmountPaid"); decimal CropRate = (decimal)DataBinder.Eval(e.Row.DataItem, "CROPRATE"); decimal AmountPaid = (decimal)DataBinder.Eval(e.Row.DataItem, "AMOUNTPAID"); litCropRate.Text = UtilBO.CurrencyFormat(CropRate); litAmountPaid.Text = UtilBO.CurrencyFormat(AmountPaid); Literal DamagedCropID = (Literal)e.Row.FindControl("damagedCropId"); System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto"); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto"); int ProjectID = 0; int HHID = 0; int userID = 0; string ProjectCode = string.Empty; string PermanentStructId = DamagedCropID.Text.ToString(); if (Session["PROJECT_ID"] != null) { ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); } if (Session["HH_ID"] != null) { HHID = Convert.ToInt32(Session["HH_ID"]); } if (Session["USER_ID"] != null) { userID = Convert.ToInt32(Session["USER_ID"]); } if (Session["PROJECT_CODE"] != null) { ProjectCode = Session["PROJECT_CODE"].ToString(); } string PhotoModule = "DAMAGEDCROPS"; string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto); string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkViewPhoto.Attributes.Add("onclick", paramPhotoView); } }
/// <summary> /// to fetch details and assign to textbox /// </summary> private void GetData() { DamagedCropsBLL DamagedCropsBLLobj = new DamagedCropsBLL(); int damageCropId = 0; if (ViewState["DAMAGED_CROPID"] != null) { damageCropId = Convert.ToInt32(ViewState["DAMAGED_CROPID"]); } DamagedCropsBO BOobj = new DamagedCropsBO(); BOobj = DamagedCropsBLLobj.GetData(damageCropId); DAMAGED_CROPIDTextBox.Text = BOobj.DAMAGED_CROPID.ToString(); txtbxDamagedCropFormRefNo.Text = BOobj.DMGCRPFORMREFNO; ddlCropName.ClearSelection(); if (ddlCropName.Items.FindByValue(BOobj.CROPID.ToString()) != null) { ddlCropName.Items.FindByValue(BOobj.CROPID.ToString()).Selected = true; } ddlCropType.ClearSelection(); if (ddlCropType.Items.FindByValue(BOobj.CROPTYPEID.ToString()) != null) { ddlCropType.Items.FindByValue(BOobj.CROPTYPEID.ToString()).Selected = true; } ddlCropDescription.ClearSelection(); if (ddlCropDescription.Items.FindByValue(BOobj.CROPDESCRIPTIONID.ToString()) != null) { ddlCropDescription.Items.FindByValue(BOobj.CROPDESCRIPTIONID.ToString()).Selected = true; } DateDamaged.Text = BOobj.DATEDAMAGED.ToString(UtilBO.DateFormat); ddlDamagedBy.ClearSelection(); if (ddlDamagedBy.Items.FindByValue(BOobj.CROPDAMAGEDBYID.ToString()) != null) { ddlDamagedBy.Items.FindByValue(BOobj.CROPDAMAGEDBYID.ToString()).Selected = true; } DamagedByTextBox.Text = BOobj.CROPDAMAGEDBYOTHER; updDamagedBy.Update(); txtbxQuantity.Text = UtilBO.CurrencyFormat(BOobj.QUANTITY); txtbxCropRate.Text = UtilBO.CurrencyFormat(BOobj.CROPRATE); txtbxAmountPaid.Text = UtilBO.CurrencyFormat(BOobj.AMOUNTPAID); CommentsTextBox.Text = BOobj.COMMENTS; }
/// <summary> /// to set controls in grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdCultureProperties_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { System.Web.UI.HtmlControls.HtmlAnchor lnkMeeting = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkMeeting"); int CULTURALPROPID = (int)DataBinder.Eval(e.Row.DataItem, "CULTURALPROPID"); lnkMeeting.Attributes.Add("onclick", "OpenMeeting(" + CULTURALPROPID + ");"); Literal litValuationAmount = (Literal)e.Row.FindControl("litValuationAmount"); decimal ValuationAmount = (decimal)DataBinder.Eval(e.Row.DataItem, "CULT_VALUATIONAMOUNT"); litValuationAmount.Text = UtilBO.CurrencyFormat(ValuationAmount); //Literal PAPFenceID = (Literal)e.Row.FindControl("litUserID"); System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto"); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto"); int ProjectID = 0; int HHID = 0; int userID = 0; string ProjectCode = string.Empty; string PermanentStructId = CULTURALPROPID.ToString(); if (Session["PROJECT_ID"] != null) { ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); } if (Session["HH_ID"] != null) { HHID = Convert.ToInt32(Session["HH_ID"]); } if (Session["USER_ID"] != null) { userID = Convert.ToInt32(Session["USER_ID"]); } if (Session["PROJECT_CODE"] != null) { ProjectCode = Session["PROJECT_CODE"].ToString(); } string PhotoModule = "PAPCP"; string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto); string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkViewPhoto.Attributes.Add("onclick", paramPhotoView); } }
/// <summary> /// Set edit mode for edit comand /// Delete data from the database for delete comand /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdBudgetEstimation_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditRow") { ViewState["BudgetEstimationID"] = e.CommandArgument; BudgetEstimationBO objBudgetEstimation = new BudgetEstimationBO(); BudgetEstimationBLL objBudgetEstimationBLL = new BudgetEstimationBLL(); objBudgetEstimation = objBudgetEstimationBLL.GetBudgetEstimationByID(Convert.ToInt32(ViewState["BudgetEstimationID"])); if (objBudgetEstimation != null) { ValueTextBox.Text = UtilBO.CurrencyFormat(Convert.ToDecimal(objBudgetEstimation.ValueAmount)); HiddenFieldTotalValue.Value = (float.Parse(HiddenFieldTotalValue.Value) - float.Parse(objBudgetEstimation.ValueAmount)).ToString(); ValuePerTextBox.Text = objBudgetEstimation.ValueAmountper; BudgetEstimationIDTextBox.Text = objBudgetEstimation.BudgetEstimationID.ToString(); CategoryDropDownList.ClearSelection(); if (CategoryDropDownList.Items.FindByValue(objBudgetEstimation.CategoryID.ToString()) != null) { CategoryDropDownList.Items.FindByValue(objBudgetEstimation.CategoryID.ToString()).Selected = true; } getSubCatByCatID(); SubCategoryDropDownList.ClearSelection(); if (SubCategoryDropDownList.Items.FindByValue(objBudgetEstimation.SubCategoryID.ToString()) != null) { SubCategoryDropDownList.Items.FindByValue(objBudgetEstimation.SubCategoryID.ToString()).Selected = true; } AcountNumberTextBox.Text = objBudgetEstimation.AccountNo; } SetUpdateMode(true); } else if (e.CommandName == "DeleteRow") { string message = string.Empty; string budgetEstimationID = e.CommandArgument.ToString(); BudgetEstimationBLL objBudgetEstimationBLL = new BudgetEstimationBLL(); message = objBudgetEstimationBLL.DeleteBudgetEstimation(Convert.ToInt32(budgetEstimationID)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data deleted successfully"; } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } ClearDetails(); SetUpdateMode(false); BindEstCategories(); getToatlBudgetValue(); } }
/// <summary> /// Call respective method to do calculation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void txtWayleaveRateperAcres_TextChanged(object sender, EventArgs e) { WayLeaveUnitConversion(ddlMeasure.SelectedItem.Value); CalculateWayLeaveValue(); TotalUnitConversion(ddlMeasure.SelectedItem.Value); txtWayleaveRateperAcres.Text = UtilBO.CurrencyFormat(Convert.ToDecimal(txtWayleaveRateperAcres.Text.Trim())).ToString(); txtRatePerAcres.Text = txtWayleaveRateperAcres.Text; RightOfWayUnitConversion(ddlMeasure.SelectedItem.Value); CalculateRightOfWayValue(); TotalUnitConversion(ddlMeasure.SelectedItem.Value); upnAcreageVal.Update(); }
/// <summary> /// Set link attributes to link /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdPermanentBuilding_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal litDepreciatedValue = (Literal)e.Row.FindControl("litDepreciatedValue"); Literal litReplacementValue = (Literal)e.Row.FindControl("litReplacementValue"); decimal depreciatedValue = (decimal)DataBinder.Eval(e.Row.DataItem, "DEPRECIATEDVALUE"); decimal replacementValue = (decimal)DataBinder.Eval(e.Row.DataItem, "REPLACEMENTVALUE"); litDepreciatedValue.Text = UtilBO.CurrencyFormat(depreciatedValue); litReplacementValue.Text = UtilBO.CurrencyFormat(replacementValue); Literal PermanentStrucID = (Literal)e.Row.FindControl("PermanentStrucID"); System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto"); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto"); int ProjectID = 0; int HHID = 0; int userID = 0; string ProjectCode = string.Empty; string PermanentStructId = PermanentStrucID.Text.ToString(); if (Session["PROJECT_ID"] != null) { ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); } if (Session["HH_ID"] != null) { HHID = Convert.ToInt32(Session["HH_ID"]); } if (Session["USER_ID"] != null) { userID = Convert.ToInt32(Session["USER_ID"]); } if (Session["PROJECT_CODE"] != null) { ProjectCode = Session["PROJECT_CODE"].ToString(); } string PhotoModule = "PAPPB"; string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto); string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkViewPhoto.Attributes.Add("onclick", paramPhotoView); } }
protected void grdCrops_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal litDimensions = (Literal)e.Row.FindControl("litDimensions"); decimal Quantity = (decimal)DataBinder.Eval(e.Row.DataItem, "QUANTITY"); decimal CropRate = (decimal)DataBinder.Eval(e.Row.DataItem, "CROPRATE"); litDimensions.Text = UtilBO.CurrencyFormat(Quantity * CropRate); Literal litCroprate = (Literal)e.Row.FindControl("litCroprate"); litCroprate.Text = UtilBO.CurrencyFormat(CropRate); Literal PAPCropID = (Literal)e.Row.FindControl("PapCropId"); System.Web.UI.HtmlControls.HtmlAnchor lnkUPloadPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkUPloadPhoto"); System.Web.UI.HtmlControls.HtmlAnchor lnkViewPhoto = (System.Web.UI.HtmlControls.HtmlAnchor)e.Row.FindControl("lnkViewPhoto"); int ProjectID = 0; int HHID = 0; int userID = 0; string ProjectCode = string.Empty; string PermanentStructId = PAPCropID.Text.ToString(); if (Session["PROJECT_ID"] != null) { ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); } if (Session["HH_ID"] != null) { HHID = Convert.ToInt32(Session["HH_ID"]); } if (Session["USER_ID"] != null) { userID = Convert.ToInt32(Session["USER_ID"]); } if (Session["PROJECT_CODE"] != null) { ProjectCode = Session["PROJECT_CODE"].ToString(); } string PhotoModule = "PAPCROP"; string paramPhoto = string.Format("OpenUploadPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkUPloadPhoto.Attributes.Add("onclick", paramPhoto); string paramPhotoView = string.Format("OpenViewPhoto({0},{1},{2},'{3}','{4}',{5});", ProjectID, HHID, userID, ProjectCode, PhotoModule, PermanentStructId); lnkViewPhoto.Attributes.Add("onclick", paramPhotoView); } }
/// <summary> /// To calculate and display amount in grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdBudgetEstimation_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Literal litAmountDisplay = (Literal)e.Row.FindControl("litAmountDisplay"); string amountValue = DataBinder.Eval(e.Row.DataItem, "ValueAmount").ToString(); decimal amount; if (decimal.TryParse(amountValue, out amount)) { litAmountDisplay.Text = UtilBO.CurrencyFormat(amount); } } }
private void GetData() { CropsBLL BLLobj = new CropsBLL(); int CropId = 0; if (ViewState["PAP_CROPID"] != null) { CropId = Convert.ToInt32(ViewState["PAP_CROPID"]); } CropsBO BOobj = new CropsBO(); BOobj = BLLobj.GetData(CropId); txtbxPAP_CROPID.Text = BOobj.PAP_CROPID.ToString(); ddlCropName.ClearSelection(); if (ddlCropName.Items.FindByValue(BOobj.CROPID.ToString()) != null) { ddlCropName.Items.FindByValue(BOobj.CROPID.ToString()).Selected = true; } ddlCropType.ClearSelection(); if (ddlCropType.Items.FindByValue(BOobj.CROPTYPEID.ToString()) != null) { ddlCropType.Items.FindByValue(BOobj.CROPTYPEID.ToString()).Selected = true; } ddlCropDescription.ClearSelection(); if (ddlCropDescription.Items.FindByValue(BOobj.CROPDESCRIPTIONID.ToString()) != null) { ddlCropDescription.Items.FindByValue(BOobj.CROPDESCRIPTIONID.ToString()).Selected = true; } lblUnitMeasure.Text = GetUnitName(ddlCropName.SelectedValue + "|" + ddlCropDescription.SelectedValue)[0]; txtbxQuantity.Text = UtilBO.CurrencyFormat(BOobj.QUANTITY); txtbxCropRate.Text = UtilBO.CurrencyFormat(BOobj.CROPRATE); txtbxCropvaluation.Text = UtilBO.CurrencyFormat(BOobj.QUANTITY * BOobj.CROPRATE); CommentsTextBox.Text = BOobj.COMMENTS; }
/// <summary> /// To edit and delete /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdExpense_RowCommand(object sender, GridViewCommandEventArgs e) { string message = string.Empty; try { if (e.CommandName == "EditRow") { ViewState["PROJECTEXPENSEID"] = e.CommandArgument; ExpenseBLL objExpenseBLL = new ExpenseBLL(); ExpenseBO objExpense = objExpenseBLL.GetExpenseByID(Convert.ToInt32(ViewState["PROJECTEXPENSEID"])); txtExpenseAmt.Text = UtilBO.CurrencyFormat(objExpense.EXPENSEAMOUNT);//objExpense.EXPENSEAMOUNT.ToString(); txtExpensetype.Text = objExpense.EXPENSETYPE.ToString(); txtAccountcode.Text = objExpense.ACCOUNTCODE; if (objExpense.DATEOFEXPENSE != null) { dpDateofexpense.Text = objExpense.DATEOFEXPENSE.ToString(UtilBO.DateFormat); } btnSaveExpence.Text = "Update"; btnClearExpence.Text = "Cancel"; } else if (e.CommandName == "DeleteRow") { ExpenseBLL objExpenseBLL = new ExpenseBLL(); message = objExpenseBLL.DeleteExpense(Convert.ToInt32(e.CommandArgument)); if (string.IsNullOrEmpty(message) || message == "" || message == "null") { message = "Data deleted successfully"; } Clearfields(); grdExpense.AllowPaging = true; BindGrid(); } if (message != "") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); } } catch (Exception ex) { throw ex; } }
/// <summary> /// to Edit and Delete Data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdCDAPBudget_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditRow") { ViewState["CDAP_BUDGID"] = e.CommandArgument; objCDAPBudgetBLL = new CDAPBudgetBLL(); objCDAPBudgetBO = new CDAPBudgetBO(); objCDAPBudgetBO = objCDAPBudgetBLL.GetCDAPBudgetItem(Convert.ToInt32(ViewState["CDAP_BUDGID"])); BindItem(); ddlItem.ClearSelection(); if (ddlItem.Items.FindByValue(objCDAPBudgetBO.Cdap_categoryid.ToString()) != null) { ddlItem.Items.FindByValue(objCDAPBudgetBO.Cdap_categoryid.ToString()).Selected = true; } int catid = Convert.ToInt32(ddlItem.SelectedValue); BindSubItem(catid); ddlItemDesc.ClearSelection(); if (ddlItemDesc.Items.FindByValue(objCDAPBudgetBO.Cdap_subcategoryid.ToString()) != null) { ddlItemDesc.Items.FindByValue(objCDAPBudgetBO.Cdap_subcategoryid.ToString()).Selected = true; } BindUnit(); ddlUnit.ClearSelection(); if (ddlUnit.Items.FindByValue(objCDAPBudgetBO.Unit.ToString()) != null) { ddlUnit.Items.FindByValue(objCDAPBudgetBO.Unit.ToString()).Selected = true; } txtQuantity.Text = Convert.ToString(objCDAPBudgetBO.Quantity); txtRateperUnit.Text = UtilBO.CurrencyFormat(objCDAPBudgetBO.Rateperunit); txtAmount.Text = UtilBO.CurrencyFormat(objCDAPBudgetBO.Quantity * objCDAPBudgetBO.Rateperunit); SetUpdateMode(true); } else if (e.CommandName == "DeleteRow") { ViewState["CDAP_BUDGID"] = e.CommandArgument; objCDAPBudgetBLL = new CDAPBudgetBLL(); objCDAPBudgetBLL.DeleteCDAPBudget(Convert.ToInt32(ViewState["CDAP_BUDGID"])); ClearDetails(); BindGrid(); btnApproval.Visible = false; } }
protected void grdLivelihoodItems_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int itemID = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Itemid")); TextBox txtCash = (TextBox)e.Row.FindControl("txtCash"); TextBox txtInKind = (TextBox)e.Row.FindControl("txtInKind"); //txtCash.Text = String.Format("{0:N0}", txtCash.Text); txtCash.Attributes.Add("onchange", "CalculateTotalCash(this);"); foreach (PAP_LivelihoodBO objLivelihood in LivelihoodItems) { if (objLivelihood.LivelihoodItemID == itemID) { if (objLivelihood.Cash > 0) { //txtCash.Text = objLivelihood.Cash.ToString(); txtCash.Text = UtilBO.CurrencyFormat(objLivelihood.Cash); TotalCashAmount += objLivelihood.Cash; } txtInKind.Text = objLivelihood.InKind; break; } } } else { if (e.Row.RowType == DataControlRowType.Footer) { if (e.Row.FindControl("txtTotalCash") is TextBox) { TextBox txtTotalCash = e.Row.FindControl("txtTotalCash") as TextBox; txtTotalCash.Text = UtilBO.CurrencyFormat(TotalCashAmount); //txtTotalCash.Text = TotalCashAmount.ToString(); } } } }
/// <summary> /// Get PAP Valuation Summery Negotiated Amount /// </summary> /// <param name="TotalValuation"></param> /// <param name="NegotiatedAmount"></param> private void GetPAPValuationSummery_NegotiatedAmount(decimal TotalValuation, decimal NegotiatedAmount) { PaymentBLL oPaymentBLL = new PaymentBLL(); PaymentBO oPaymentBO = new PaymentBO(); oPaymentBO = oPaymentBLL.getPapValuation(SessionHHID); if (oPaymentBO != null && oPaymentBO.NegotiatedAmountApproved.ToUpper() == "Y") { trNegotiatedAmount.Visible = true; hdnNegotiatedAmount.Value = "1"; trNegotiatedAmount.BgColor = "#E4e4e4"; txtTotalAmount.Text = UtilBO.CurrencyFormat(NegotiatedAmount); } else { trNegotiatedAmount.Visible = false; hdnNegotiatedAmount.Value = "0"; //trNegotiatedAmount.Visible = true; trNegotiatedAmount.BgColor = "#F0F8FF"; txtTotalAmount.Text = UtilBO.CurrencyFormat(TotalValuation); } }
/// <summary> /// Method to calculate total budget value /// </summary> public void getToatlBudgetValue() { Label TotalX = null; decimal subTotal = 0; decimal total = 0; foreach (RepeaterItem rptItem in rptBudgetEstCategory.Items) { GridView grdSubCat = (GridView)rptItem.FindControl("grdBudgetEstimation"); subTotal = 0; foreach (GridViewRow grdRow in grdSubCat.Rows) { TotalX = ((Label)grdSubCat.FooterRow.FindControl("TotalAmount_cal")); decimal litValueAmount = Convert.ToDecimal(((Literal)grdRow.FindControl("litValueAmount")).Text); subTotal += litValueAmount; total = total + litValueAmount; TotalX.Text = UtilBO.CurrencyFormat(subTotal); } } HiddenFieldTotalValue.Value = total.ToString(); lblGrandTotal.Text = UtilBO.CurrencyFormat(total); }
/// <summary> /// Total Unit Conversion /// </summary> /// <param name="unitOfMeasure"></param> protected void TotalUnitConversion(string unitOfMeasure) { double ttl = 0; double rightOfWayAcres = 0; double wayleaveAcres = 0; double rightOfWayHA = 0; double wayleaveHA = 0; double rightOfWaySQM = 0; double wayleaveSQM = 0; double rightOfWayLandValue = 0; double wayleaveLandValue = 0; if (lblAcres.Text.Trim() != "") { rightOfWayAcres = Convert.ToDouble(lblAcres.Text.Trim()); } if (lblWayleavesAcres.Text.Trim() != "") { wayleaveAcres = Convert.ToDouble(lblWayleavesAcres.Text.Trim()); } if (lblHA.Text.Trim() != "") { rightOfWayHA = Convert.ToDouble(lblHA.Text.Trim()); } if (lblWayleavesHA.Text.Trim() != "") { wayleaveHA = Convert.ToDouble(lblWayleavesHA.Text.Trim()); } if (lblSqmtrs.Text.Trim() != "") { rightOfWaySQM = Convert.ToDouble(lblSqmtrs.Text.Trim()); } if (lblWayleaveSqmtrs.Text.Trim() != "") { wayleaveSQM = Convert.ToDouble(lblWayleaveSqmtrs.Text.Trim()); } if (lblRowLandVal.Text.Trim() != "") { rightOfWayLandValue = Convert.ToDouble(lblRowLandVal.Text.Trim()); } if (lblWayleavelandVal.Text.Trim() != "") { wayleaveLandValue = Convert.ToDouble(lblWayleavelandVal.Text.Trim()); } if (lblTotal.Text.Trim() != "") { ttl = Convert.ToDouble(lblTotal.Text.Trim()); } if (unitOfMeasure == "HA") { //lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA),2).ToString(); //lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 2).ToString(); //lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 2).ToString(); lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA), 4).ToString(); lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 11).ToString(); lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 4).ToString(); } else if (unitOfMeasure == "Acre") { //lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA), 2).ToString(); //lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 2).ToString(); //lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 2).ToString(); lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA), 4).ToString(); lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 11).ToString(); lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 4).ToString(); } else if (unitOfMeasure == "Sq Metre") { //lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA), 2).ToString(); //lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 2).ToString(); //lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 2).ToString(); lblTotHA.Text = Math.Round((rightOfWayHA + wayleaveHA), 4).ToString(); lblTotAcres.Text = Math.Round((rightOfWayAcres + wayleaveAcres), 11).ToString(); lblTotSqmtrs.Text = Math.Round((rightOfWaySQM + wayleaveSQM), 4).ToString(); } double result = rightOfWayLandValue + wayleaveLandValue; lblTotlandVal.Text = UtilBO.CurrencyFormat(Convert.ToDecimal(result));//(rightOfWayLandValue + wayleaveLandValue).ToString(); //txtAcreageAcres.Text = lblTotAcres.Text; //string str1 = txtAcreageAcres.Text.Trim(); //if (string.IsNullOrEmpty(str1) == false) //{ // double t = Convert.ToDouble(txtAcreageAcres.Text.Trim()); // double Ha = Math.Round((t / acrehaconvert), 2); // txtAcreageHA.Text = Ha.ToString(); //} //txtAcreageHA.Text = lblTotHA.Text; }
/// <summary> /// Calculate WayLeave Value and Update it to respective fields /// </summary> protected void CalculateWayLeaveValue() { decimal wayleave = 0; decimal wayleaverateperAcres = 0; decimal dimunition = 0; decimal wayleavesharevalue = 0; string message1 = string.Empty; string AlertMessage = string.Empty; if (lblWayleavesAcres.Text.Trim() != "") { wayleave = Convert.ToDecimal(lblWayleavesAcres.Text.Trim()); } //if (txtWayleave.Text.Trim() != "") //{ // wayleave = Convert.ToDecimal(txtWayleave.Text.Trim()); //} //else //{ // lblWayleavesAcres.Text = wayleave.ToString(); // lblWayleavesHA.Text = "0"; // lblWayleaveSqmtrs.Text = "0"; // //message1 += "Please Input the wayleave value"; //} if (txtWayleaveRateperAcres.Text.Trim() != "") { wayleaverateperAcres = Convert.ToDecimal(txtWayleaveRateperAcres.Text.Trim()); } //else //{ // message1 += "Please Input the wayleave rate per acres value\\n"; //} if (ddlDimunition.SelectedIndex != 0) { dimunition = Convert.ToDecimal(ddlDimunition.SelectedValue) / 100; } //else //{ // message1 += "Please select the Dimunition value\\n"; //} if (ddlWayleaveShareLandVal.SelectedIndex != 0) { wayleavesharevalue = Convert.ToDecimal(ddlWayleaveShareLandVal.SelectedValue) / 100; } //else //{ // message1 += "Please select the wayleave share value\\n"; //} //if (message1 != "") //{ // AlertMessage = "alert('" + message1 + "');"; // ScriptManager.RegisterStartupScript(this, this.GetType(), "Added", AlertMessage, true); //} //decimal wayleavevalue = Math.Ceiling(wayleave * wayleaverateperAcres * dimunition * wayleavesharevalue);//changes done by ramu as per Request of UETCL team decimal wayleavevalue = (wayleave * wayleaverateperAcres * dimunition * wayleavesharevalue); lblWayleavelandVal.Text = UtilBO.CurrencyFormat(wayleavevalue); decimal rightOfWay = 0; if (txtRightWay.Text.Trim() != "") { rightOfWay = Convert.ToDecimal(txtRightWay.Text.Trim()); } decimal totlandval = 0; totlandval = wayleave + rightOfWay; //lblTotal.Text = totlandval.ToString(); string str1 = txtRightWay.Text.Trim(); double t = 0, t1 = 0; if (string.IsNullOrEmpty(str1) == false) { t = Convert.ToDouble(txtRightWay.Text.Trim()); } string str2 = txtWayleave.Text.Trim(); if (string.IsNullOrEmpty(str2) == false) { t1 = Convert.ToDouble(txtWayleave.Text.Trim()); } lblTotal.Text = (t + t1).ToString(); }
/// <summary> /// Get Affected Acreage Valuation Data /// </summary> private void GetAffectedAcreageValuation() { objSurveyBLL = new SurveyBLL(); objAcreageValuation = objSurveyBLL.GetAffectedAcreageValuation(Convert.ToInt32(Session["HH_ID"])); if (objAcreageValuation != null) { txtLandOwner.Text = objAcreageValuation.Landowner; txtLandBlock.Text = objAcreageValuation.Landblock; txtLandPlot.Text = objAcreageValuation.Landplot; //BindProprietor(); ddlCurrentOperation.ClearSelection(); if (ddlCurrentOperation.Items.FindByValue(objAcreageValuation.Proprietorid.ToString()) != null) { ddlCurrentOperation.Items.FindByValue(objAcreageValuation.Proprietorid.ToString()).Selected = true; } txtAcreageAcres.Text = objAcreageValuation.Wholeacreageacres; txtRightWay.Text = Convert.ToString(objAcreageValuation.Rowacres); lblAcres.Text = Convert.ToString(objAcreageValuation.Rowacres); if (ddlRowLandvalshare.Items.FindByValue(objAcreageValuation.Rowlandvalueshare.ToString()) != null) { ddlRowLandvalshare.Items.FindByValue(objAcreageValuation.Rowlandvalueshare.ToString()).Selected = true; } txtRatePerAcres.Text = UtilBO.CurrencyFormat(objAcreageValuation.Rowrateperacre); lblRowLandVal.Text = UtilBO.CurrencyFormat(objAcreageValuation.Rowlandvalue);//Convert.ToString(objAcreageValuation.Rowlandvalue); txtWayleave.Text = Convert.ToString(objAcreageValuation.Wlacres); lblWayleavesAcres.Text = Convert.ToString(objAcreageValuation.Wlacres); if (ddlDimunition.Items.FindByValue(objAcreageValuation.Dimunitionlevel.ToString()) != null) { ddlDimunition.Items.FindByValue(objAcreageValuation.Dimunitionlevel.ToString()).Selected = true; } if (ddlWayleaveShareLandVal.Items.FindByValue(objAcreageValuation.Wllandvalueshare.ToString()) != null) { ddlWayleaveShareLandVal.Items.FindByValue(objAcreageValuation.Wllandvalueshare.ToString()).Selected = true; } txtWayleaveRateperAcres.Text = UtilBO.CurrencyFormat(objAcreageValuation.Wlrateperacre); lblWayleavelandVal.Text = UtilBO.CurrencyFormat(objAcreageValuation.Wllandvalue);// Convert.ToString(objAcreageValuation.Wllandvalue); if (txtRightWay.Text.Trim() != "" && txtWayleave.Text.Trim() != "") { lblTotal.Text = Math.Round((Convert.ToDecimal(txtRightWay.Text.Trim()) + Convert.ToDecimal(txtWayleave.Text.Trim())), 2).ToString("N2"); } string str1 = txtAcreageAcres.Text.Trim(); if (string.IsNullOrEmpty(str1) == false) { double t = Convert.ToDouble(txtAcreageAcres.Text.Trim()); double Ha = Math.Round((t / acrehaconvert), 4); txtAcreageHA.Text = Ha.ToString(); } upnAcreageHA.Update(); RightOfWayUnitConversion(ddlMeasure.SelectedItem.Value); WayLeaveUnitConversion(ddlMeasure.SelectedItem.Value); TotalUnitConversion(ddlMeasure.SelectedItem.Value); if (txtLandOwner.Text.Trim() == "") { SetUpdateMode(false); } else { SetUpdateMode(true); } } }
/// <summary> /// Get Data by ID /// </summary> private void getLiveRestBudgetById() { LivelihoodRestBudgetBO oLiveRestBudgetBO = new LivelihoodRestBudgetBO(); LivelihoodRestBudgetBLL oLiveRestBudgetBLL = new LivelihoodRestBudgetBLL(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudgetBO = oLiveRestBudgetBLL.GetLiveRestBudgetByID(ViewStateLivRestBudgetID); ddlCategory.SelectedValue = oLiveRestBudgetBO.Liv_Bud_CategID.ToString(); LoadRestoreItems(); ddlItem.ClearSelection(); if (ddlItem.Items.FindByValue(oLiveRestBudgetBO.Liv_Bud_ItemID.ToString()) != null) { ddlItem.Items.FindByValue(oLiveRestBudgetBO.Liv_Bud_ItemID.ToString()).Selected = true; } // ddlItem.SelectedValue = oLiveRestBudgetBO.Liv_Bud_ItemID.ToString(); //Item Change Event #region LivelihoodBudgetItemsList lstLiveBudgItems = new LivelihoodBudgetItemsList(); LivelihoodBudgetItemsBLL oLiveBudgItemsBLL = new LivelihoodBudgetItemsBLL(); LivelihoodBudgetItemsBO oLiveBudgItemsBO = new LivelihoodBudgetItemsBO(); oLiveBudgItemsBO.Liv_Bud_CategID = Convert.ToInt32(ddlCategory.SelectedValue.ToString()); if (ddlItem.SelectedIndex > 0) { oLiveBudgItemsBO.Liv_Bud_ItemID = Convert.ToInt32(ddlItem.SelectedValue.ToString()); lstLiveBudgItems = oLiveBudgItemsBLL.GetLivBudgetItems(oLiveBudgItemsBO); if (lstLiveBudgItems.Count > 0) { if (lstLiveBudgItems[0].Liv_Bud_ItemDesc != null) { txtItemDescription.Text = lstLiveBudgItems[0].Liv_Bud_ItemDesc.ToString(); } else { txtItemDescription.Text = string.Empty; } } } #endregion #region CheckBox Section if (oLiveRestBudgetBO.ImplCost == "Yes") { chklst.Items[0].Selected = true; } else { chklst.Items[0].Selected = false; } if (oLiveRestBudgetBO.OperCost == "Yes") { chklst.Items[1].Selected = true; } else { chklst.Items[1].Selected = false; } if (oLiveRestBudgetBO.ExternalMonitory == "Yes") { chklst.Items[2].Selected = true; } else { chklst.Items[2].Selected = false; } #endregion txtNoOfBeneficial.Text = oLiveRestBudgetBO.NoOfBeneficial.ToString(); txtItemQuantity.Text = oLiveRestBudgetBO.ItemQuantity.ToString(); txtCostPerUnit.Text = UtilBO.CurrencyFormat(oLiveRestBudgetBO.CostPerUnit); txtTotal.Text = UtilBO.CurrencyFormat(oLiveRestBudgetBO.TotalAmount); txtComments.Text = oLiveRestBudgetBO.Comments; ddlDistrict.ClearSelection(); if (ddlDistrict.Items.FindByText(oLiveRestBudgetBO.District) != null) { ddlDistrict.Items.FindByText(oLiveRestBudgetBO.District).Selected = true; } BindCounties(); ddlCounty.ClearSelection(); if (ddlCounty.Items.FindByText(oLiveRestBudgetBO.County) != null) { ddlCounty.Items.FindByText(oLiveRestBudgetBO.County).Selected = true; } //ddlCounty.SelectedItem.Text = oLiveRestBudgetBO.County; BindSubCounties(); ddlSubCounty.ClearSelection(); if (ddlSubCounty.Items.FindByText(oLiveRestBudgetBO.SubCounty) != null) { ddlSubCounty.Items.FindByText(oLiveRestBudgetBO.SubCounty).Selected = true; } // ddlSubCounty.SelectedItem.Text = oLiveRestBudgetBO.SubCounty; BindParish(); ddlParish.ClearSelection(); if (ddlParish.Items.FindByText(oLiveRestBudgetBO.Parish) != null) { ddlParish.Items.FindByText(oLiveRestBudgetBO.Parish).Selected = true; } //ddlParish.SelectedItem.Text = oLiveRestBudgetBO.Parish; BindVillages(); lstbVillages.ClearSelection(); LiveRestBudVillagesBLL oLiveRestBudVillagesBLL = new LiveRestBudVillagesBLL(); LiveRestBudVillagesList oLiveRestBudVillagesList = new LiveRestBudVillagesList(); if (ViewStateLivRestBudgetID > 0) { oLiveRestBudVillagesList = oLiveRestBudVillagesBLL.GetLiveRestBudVillagesById(ViewStateLivRestBudgetID); foreach (LiveRestBudVillagesBO objLiveRestBudVillagesBO in oLiveRestBudVillagesList) { if (lstbVillages.Items.FindByText(objLiveRestBudVillagesBO.Village) != null) { lstbVillages.Items.FindByText(objLiveRestBudVillagesBO.Village).Selected = true; } // lstbVillages.Items.Add(objLiveRestBudVillagesBO.Village); } } // LoadVillages(); } }
/// <summary> /// Used to save details to database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { ProjectBO objProject = new ProjectBO(); objProject.PercentageofPAP = Convert.ToDecimal(txtpercentage.Text.Trim()); objProject.ProjectCode = txtProjectCode.Text.Trim(); objProject.ProjectName = txtProjectName.Text.Trim(); string sObj = txtObjective.Text.Trim(); if (sObj.Trim().Length > 1000) { sObj = sObj.Substring(0, 1000); } objProject.Objective = sObj.Trim(); if (dpProjectStartDate.Text.Trim() != "") { objProject.ProjectStartDate = Convert.ToDateTime(dpProjectStartDate.Text.ToString()); } if (dpProjectEndDate.Text.Trim() != "") { objProject.ProjectEndDate = Convert.ToDateTime(dpProjectEndDate.Text.ToString()); } objProject.BudgetCurrency = Convert.ToInt32(ddlCurrencyTypeTotalEstBudget.SelectedValue); if (txtTotalEstBudget.Text.Trim().Length > 0) { objProject.TotalEstBudget = Convert.ToDecimal(txtTotalEstBudget.Text.Trim()); } if (txtLabouCost.Text.Trim().Length > 0) { objProject.Labourcost = Convert.ToDecimal(txtLabouCost.Text); } if (txtBulMatCost.Text.Trim().Length > 0) { objProject.BUILDINGMATCOST = Convert.ToDecimal(txtBulMatCost.Text); } if (txtDollervalue.Text.Trim().Length > 0) { objProject.Dollervalue = Convert.ToDecimal(txtDollervalue.Text); } if (ddlProjectStatus.SelectedIndex > 0) { objProject.ProjectStatus = ddlProjectStatus.SelectedItem.Value; } else { ddlProjectStatus.ClearSelection(); ddlProjectStatus.SelectedIndex = 1; objProject.ProjectStatus = ddlProjectStatus.SelectedItem.Value; } if (Session["PROJECT_ID"] != null) { objProject.ProjectID = Convert.ToInt32(Session["PROJECT_ID"]); objProject.UpdatedBy = (int)Session["USER_ID"]; } else { objProject.CreatedBy = (int)Session["USER_ID"]; } ProjectBLL objProjectBLL = new ProjectBLL(); if (Session["PROJECT_ID"] != null) { string msg = objProjectBLL.UpdateProject(objProject); if (msg == "") { msg = "Data updated successfully."; } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Updated", "alert('" + msg + "');", true); ViewState["BudgetCurrency"] = ddlCurrencyTypeTotalEstBudget.SelectedValue; if (txtTotalEstBudget.Text.Trim().Length > 0) { txtTotalEstBudget.Text = UtilBO.CurrencyFormat(Convert.ToDecimal(txtTotalEstBudget.Text)); } DisplayEstBudget(); } else { string[] result = objProjectBLL.AddProject(objProject); string message = ""; if (string.IsNullOrEmpty(result[1]) || result[1] == "" || result[1] == "null") { Session["PROJECT_ID"] = result[0]; Session["PROJECT_CODE"] = objProject.ProjectCode; Session["FROZEN"] = "N"; message = "alert('Data saved successfully');location.href='ProjectRoute.aspx';"; } else { message = result[1]; message = "alert('" + message + "');"; } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", message, true); } } }
/// <summary> /// Calculate Right Of Way Value and Update it to respective fields /// </summary> protected void CalculateRightOfWayValue() { decimal rateperacres = 0; decimal rightOfWay = 0; decimal sharevalue = 0; string message = string.Empty; string AlertMessage = string.Empty; if (txtRatePerAcres.Text.Trim() != "") { rateperacres = Convert.ToDecimal(txtRatePerAcres.Text.Trim()); } //else //{ // message += "Please Input the rate per acres value\\n"; //} if (lblAcres.Text.Trim() != "") { rightOfWay = Convert.ToDecimal(lblAcres.Text.Trim()); } ////if (txtRightWay.Text.Trim() != "") ////{ //// rightOfWay = Convert.ToDecimal(txtRightWay.Text.Trim()); ////} ////else ////{ //// lblAcres.Text = rightOfWay.ToString(); //// lblHA.Text = "0"; //// lblSqmtrs.Text = "0"; //// //message += "Please Input the right of way value\\n"; ////} if (ddlRowLandvalshare.SelectedIndex != 0) { sharevalue = Convert.ToDecimal(ddlRowLandvalshare.SelectedValue) / 100; } //else //{ // message += "Please Select the Share value\\n"; //} //if (message != "") //{ // AlertMessage = "alert('" + message + "');"; // //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true); // ScriptManager.RegisterStartupScript(this, this.GetType(), "Added", AlertMessage, true); //} //decimal rowlandvalue = Math.Ceiling(rateperacres * rightOfWay * sharevalue);//changes done by ramu as per Request of UETCL team decimal rowlandvalue = (rateperacres * rightOfWay * sharevalue); lblRowLandVal.Text = UtilBO.CurrencyFormat(rowlandvalue); //rowlandvalue.ToString(); decimal wayleave = 0; if (txtWayleave.Text.Trim() != "") { wayleave = Convert.ToDecimal(txtWayleave.Text.Trim()); } decimal totlandval = 0; totlandval = wayleave + rightOfWay; string str1 = txtRightWay.Text.Trim(); double t = 0, t1 = 0; if (string.IsNullOrEmpty(str1) == false) { t = Convert.ToDouble(txtRightWay.Text.Trim()); } string str2 = txtWayleave.Text.Trim(); if (string.IsNullOrEmpty(str2) == false) { t1 = Convert.ToDouble(txtWayleave.Text.Trim()); } lblTotal.Text = (t + t1).ToString(); }
/// <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(); } }
/// <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); } } } }
/// <summary> /// Method to fetch project details and assign to textbox /// </summary> protected void GetProjectDetails() { ProjectBLL objProjectBLL = new ProjectBLL(); ProjectBO objProject = objProjectBLL.GetProjectByProjectID(Convert.ToInt32(Session["PROJECT_ID"])); if (!string.IsNullOrEmpty(objProject.ProjectCode)) { Session["PROJECT_CODE"] = objProject.ProjectCode.ToString(); } txtpercentage.Text = Convert.ToString(objProject.PercentageofPAP); txtProjectCode.Text = objProject.ProjectCode; Master.PageHeader = objProject.ProjectCode + " - Project Details"; txtProjectName.Text = objProject.ProjectName; txtObjective.Text = objProject.Objective; if (objProject.ProjectStartDate != DateTime.MinValue) { dpProjectStartDate.Text = Convert.ToString(objProject.ProjectStartDate.ToString(UtilBO.DateFormat)); } if (objProject.ProjectEndDate != DateTime.MinValue) { dpProjectEndDate.Text = Convert.ToString(objProject.ProjectEndDate.ToString(UtilBO.DateFormat)); } txtTotalEstBudget.Text = UtilBO.CurrencyFormat(objProject.TotalEstBudget); txtLabouCost.Text = UtilBO.CurrencyFormat(objProject.Labourcost); txtBulMatCost.Text = UtilBO.CurrencyFormat(objProject.BUILDINGMATCOST); txtDollervalue.Text = Convert.ToString(objProject.Dollervalue); //String.Format("{0:C0}", objProject.TotalEstBudget).Replace("$", ""); LoadCurrencyTotalEstimate(); ddlCurrencyTypeTotalEstBudget.ClearSelection(); if (ddlCurrencyTypeTotalEstBudget.Items.FindByValue(objProject.BudgetCurrency.ToString()) != null) { ddlCurrencyTypeTotalEstBudget.Items.FindByValue(objProject.BudgetCurrency.ToString()).Selected = true; } ViewState["BudgetCurrency"] = objProject.BudgetCurrency; //LoadCurrencyEstimate(); //ddlCurrencyTypeEstBudget.ClearSelection(); //if (ddlCurrencyTypeEstBudget.Items.FindByValue(objProject.BudgetCurrency.ToString()) != null) //{ // ddlCurrencyTypeEstBudget.Items.FindByValue(objProject.BudgetCurrency.ToString()).Selected = true; //} //ddlCurrencyTypeEstBudget.Enabled = false; DisplayEstBudget(); ddlProjectStatus.ClearSelection(); if (ddlProjectStatus.Items.FindByValue(objProject.ProjectStatus.ToUpper()) != null) { ddlProjectStatus.Items.FindByValue(objProject.ProjectStatus.ToUpper()).Selected = true; } //Loading Segments if (Session["PROJECT_ID"] != null) { int ProjectId = Convert.ToInt32(Session["PROJECT_ID"]); LoadProjectSegmentGV(ProjectId); } }