private Panel AddBodyPanelCol6(AssociationExpenses associationExpense) { // column 6 var col6 = new Panel { CssClass = "col-md-2 col-sm-2 col-xs-6" }; if (associationExpense.ExpenseTypes.Id == (int)ExpenseType.PerIndex) { string percentage = AssociationExpensesManager.GetPercentageAsString(associationExpense); Button btnRedistibuteRemainingExpense = new Button { CssClass = "btnRedistibuteRemainingExpense", Visible = (percentage == "100" || percentage == string.Empty) ? true : false, Text = (!associationExpense.RedistributeType.HasValue) ? "Redistribuie" : "Redistibuit " + associationExpense.AssociationExpensesRedistributionTypes.Value + ", MODIFICĂ", CommandArgument = associationExpense.Id.ToString() }; btnRedistibuteRemainingExpense.Click += btnRedistibuteRemainingExpense_Click; col6.Controls.Add(btnRedistibuteRemainingExpense); } return(col6); }
private static Panel AddBodyPanelCol3(AssociationExpenses associationExpense, TextBox tb1, out TextBox tb3) { // column 3 var col3 = new Panel { CssClass = "col-md-1 col-sm-4 col-xs-6" }; tb3 = new TextBox { Enabled = false, CssClass = "invoiceItemTextbox" }; if (associationExpense.Id_ExpenseType == (int)ExpenseType.PerIndex) { if (!associationExpense.RedistributeType.HasValue) { var percentage = AssociationExpensesManager.GetPercentageAsString(associationExpense); if (percentage == "100") { var redistributeResult = RedistributionManager.GetRedistributeValuePerIndex(associationExpense); tb3.Text = redistributeResult.HasValue ? redistributeResult.Value.ToString() : string.Empty; } if (tb3.Text == "0,0000000") { tb3.Text = string.Empty; } if (!string.IsNullOrEmpty(tb3.Text)) { var col3Literal = new Literal { Text = "<b>" + tb1.Text + " - " + associationExpense.ApartmentExpenses.Sum(ee => ee.Value) + "</b>" }; col3.Controls.Add(col3Literal); } col3.Controls.Add(tb3); } else { tb3.Text = ""; col3.Controls.Add(tb3); } } //else if (apartmentExpense.Id_ExpenseType == (int)ExpenseType.PerCotaIndiviza) //{ // //if (!string.IsNullOrEmpty(tb1.Text)) // //{ // // var col3Literal = new Literal { Text = "0" }; // // col3.Controls.Add(col3Literal); // //} //} //else if (apartmentExpense.Id_ExpenseType == (int)ExpenseType.PerTenants && estateapartmentExpenseExpense.TenantExpenses.Count > 0) //{ // //var col3Literal = new Literal { Text = "0" }; // //var col3Literal = new Literal { Text = Estate.Tenants.Sum(s => s.Dependents) + " persoane, <b>" + ApartmentExpensesManager.CalculatePertenantPrice(apartmentExpense) + "</b> alocat fiecăruia " }; // //col3.Controls.Add(col3Literal); //} return(col3); }