private String MergeAllString() { String fe = String.Empty; if (ddlBankAccountID.Items.Count > 0) { String fe_account = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccount." + ACAccountsHelper_CustomEntity.FLD_NAME_BankAccountID, ddlBankAccountID.SelectedValue.ToString(), SQLMatchType.Equal); IList <ACAccountsHelper_CustomEntity> lst = FCCACAccountsHelper_Custom.GetFacadeCreate().GetIL(1000, 1, fe_account); if (lst != null && lst.Count > 0) { fe = SqlExpressionBuilder.PrepareFilterExpression(ACBankStatement_CustomEntity.FLD_NAME_AccountID, lst[0].AccountID.ToString(), SQLMatchType.Equal); } } if (!String.IsNullOrWhiteSpace(txtTransactionFromDate.Text.Trim())) { if (!String.IsNullOrWhiteSpace(txtTransactionToDate.Text.Trim())) { String fe1 = "TransactionDateTime between '" + MiscUtil.ParseToDateTime(txtTransactionFromDate.Text) + "' and '" + MiscUtil.ParseToDateTime(txtTransactionToDate.Text) + "'"; fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe1); } } Int64 activeFiscalYearID = MiscUtil.GetActiveFiscalYear(); //if (activeFiscalYearID > 0) //{ // String fe2 = SqlExpressionBuilder.PrepareFilterExpression("ACFiscalYear", activeFiscalYearID.ToString(), SQLMatchType.Equal); // fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe2); //} return(fe); }
private String MergeAllString() { String fe = String.Empty; if (hdEmpID.Value != "0") { fe = SqlExpressionBuilder.PrepareFilterExpression(ACBankStatement_CustomEntity.FLD_NAME_AccountID, hdEmpID.Value.ToString(), SQLMatchType.Equal); } if (!String.IsNullOrWhiteSpace(txtTransactionFromDate.Text.Trim())) { if (!String.IsNullOrWhiteSpace(txtTransactionToDate.Text.Trim())) { String fe1 = "TransactionDateTime between '" + MiscUtil.ParseToDateTime(txtTransactionFromDate.Text) + "' and '" + MiscUtil.ParseToDateTime(txtTransactionToDate.Text) + "'"; fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe1); } } Int64 activeFiscalYearID = MiscUtil.GetActiveFiscalYear(); //if (activeFiscalYearID > 0) //{ // String fe2 = SqlExpressionBuilder.PrepareFilterExpression("ACFiscalYear", activeFiscalYearID.ToString(), SQLMatchType.Equal); // fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe2); //} return(fe); }
private void BuildLabel() { String fe = MergeAllString(); IList <ACBankStatement_CustomEntity> lst = FCCACBankStatement_Custom.GetFacadeCreate().GetIL(1000000, 1, String.Empty, fe); if (lst != null && lst.Count > 0) { var resultDebit = (from s in lst where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.DEBIT select s.Amount).Sum(val => val); var resultCredit = (from s in lst where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.CREDIT select s.Amount).Sum(val => val); //lbltotalDebitAmount.Text = Math.Round(resultDebit, 2).ToString(); //lbltotalCreditAmount.Text = Math.Round(resultCredit, 2).ToString(); lbltotalBalance.Text = Math.Round((resultDebit - resultCredit), 2).ToString(); } else { lbltotalBalance.Text = "0.00"; } Int64 accountID = 0, activefiscalYearID = 0; DateTime fromDate, ToDate; if (ddlBankAccountID.Items.Count > 0) { String fe_account = SqlExpressionBuilder.PrepareFilterExpression("ACBankAccount." + ACAccountsHelper_CustomEntity.FLD_NAME_BankAccountID, ddlBankAccountID.SelectedValue.ToString(), SQLMatchType.Equal); IList <ACAccountsHelper_CustomEntity> lstAccountHelper = FCCACAccountsHelper_Custom.GetFacadeCreate().GetIL(1000, 1, fe_account); if (lstAccountHelper != null && lstAccountHelper.Count > 0) { accountID = lstAccountHelper[0].AccountID; } } activefiscalYearID = MiscUtil.GetActiveFiscalYear(); fromDate = MiscUtil.ParseToDateTime(txtTransactionFromDate.Text.ToString()); ToDate = MiscUtil.ParseToDateTime(txtTransactionToDate.Text.ToString()); IList <ACAccountOpenCloseBalance_CustomEntity> lstOpenClose = FCCACAccountOpenCloseBalance_Custom.GetFacadeCreate().GetIL(accountID, activefiscalYearID, fromDate, ToDate); if (lstOpenClose != null && lstOpenClose.Count > 0) { lblOpeningBalance.Text = Math.Round(lstOpenClose[0].OpenBalance, 2).ToString(); } else { lblOpeningBalance.Text = "0.00"; } }
private void BindACJournalList() { DateTime startDate = MiscUtil.ParseToDateTime(txtTransactionFromDate.Text.ToString()); DateTime endDate = MiscUtil.ParseToDateTime(txtTransactionToDate.Text.ToString()); Int64 activeFiscalYearID = MiscUtil.GetActiveFiscalYear(); IList <ACTrialBalance_CustomEntity> lst = FCCACTrialBalance_Custom.GetFacadeCreate().GetIL(startDate, endDate, activeFiscalYearID); lvACJournal.DataSource = lst; lvACJournal.DataBind(); }
private void BuildLabel() { String fe = MergeAllString(); IList <ACBankStatement_CustomEntity> lst = FCCACBankStatement_Custom.GetFacadeCreate().GetIL(1000000, 1, String.Empty, fe); if (lst != null && lst.Count > 0) { var resultDebit = (from s in lst where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.DEBIT select s.Amount).Sum(val => val); var resultCredit = (from s in lst where s.MDDebitCreditID == MasterDataConstants.MDDebitCredit.CREDIT select s.Amount).Sum(val => val); //lbltotalDebitAmount.Text = Math.Round(resultDebit, 2).ToString(); //lbltotalCreditAmount.Text = Math.Round(resultCredit, 2).ToString(); lbltotalBalance.Text = Math.Round((resultDebit - resultCredit), 2).ToString(); //lbltotalBalance.Text = MiscUtil.NumericCommaSeperatedFormat((resultDebit - resultCredit)); } else { lbltotalBalance.Text = "0.00"; } Int64 accountID = 0, activefiscalYearID = 0; DateTime fromDate, ToDate; if (hdEmpID.Value != "0") { accountID = Int64.Parse(hdEmpID.Value.ToString()); } activefiscalYearID = MiscUtil.GetActiveFiscalYear(); fromDate = MiscUtil.ParseToDateTime(txtTransactionFromDate.Text.ToString()); ToDate = MiscUtil.ParseToDateTime(txtTransactionToDate.Text.ToString()); IList <ACAccountOpenCloseBalance_CustomEntity> lstOpenClose = FCCACAccountOpenCloseBalance_Custom.GetFacadeCreate().GetIL(accountID, activefiscalYearID, fromDate, ToDate); if (lstOpenClose != null && lstOpenClose.Count > 0) { lblOpeningBalance.Text = Math.Round(lstOpenClose[0].OpenBalance, 2).ToString(); //lblOpeningBalance.Text = MiscUtil.NumericCommaSeperatedFormat(lstOpenClose[0].OpenBalance); } else { lblOpeningBalance.Text = "0.00"; } }
private Decimal?GetToalLeaveEarned() { Int64 fiscalYearID = MiscUtil.GetActiveFiscalYear(); Decimal?totalLeaveEarned = 0; String fe = "EmployeeID = " + OverviewEmployeeID + " and FiscalYearID = " + fiscalYearID + ""; IList <HRMemberLeaveAccountEntity> list = FCCHRMemberLeaveAccount.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression); if (list != null && list.Count > 0) { totalLeaveEarned = list.AsEnumerable().Sum(x => x.EarnedDays); } return(totalLeaveEarned); }
//Decimal previousValue = 0; //Int64 previousType = 0; //Decimal previousBalance = 0; //Decimal totalDebitAmount, totalCreditAmount; //protected void lvACJournal_ItemDataBound(object sender, ListViewItemEventArgs e) //{ // if (e.Item.ItemType == ListViewItemType.DataItem) // { // ListViewDataItem dataItem = (ListViewDataItem)e.Item; // ACBankStatement_CustomEntity ent = (ACBankStatement_CustomEntity)dataItem.DataItem; // Label lblDebitAmount = (Label)e.Item.FindControl("lblDebitAmountLV"); // Label lblCreditAmount = (Label)e.Item.FindControl("lblCreditAmountLV"); // Label lblBalanceLV = (Label)e.Item.FindControl("lblBalanceLV"); // Decimal balance,currentBalance; // Decimal.TryParse(ent.Amount.ToString(), out currentBalance); // switch (ent.MDDebitCreditID) // { // case MasterDataConstants.MDDebitCredit.DEBIT: // lblDebitAmount.Text = Math.Round(ent.Amount,2).ToString(); // previousType = MasterDataConstants.MDDebitCredit.DEBIT; // balance = previousBalance + currentBalance; // previousBalance = balance; // totalDebitAmount += currentBalance; // lblBalanceLV.Text = Math.Round(previousBalance, 2).ToString(); // break; // case MasterDataConstants.MDDebitCredit.CREDIT: // lblCreditAmount.Text = Math.Round(ent.Amount, 2).ToString(); // previousType = MasterDataConstants.MDDebitCredit.CREDIT; // balance = previousBalance - currentBalance; // previousBalance = balance; // totalCreditAmount += currentBalance; // lblBalanceLV.Text = Math.Round(previousBalance,2).ToString(); // break; // default: // break; // } // } //} #endregion List View Event #region Button Event protected void btnSearch_Click(object sender, EventArgs e) { DateTime fromDate = System.DateTime.Now, toDate = System.DateTime.Now; if (!String.IsNullOrWhiteSpace(txtTransactionFromDate.Text.Trim())) { fromDate = MiscUtil.ParseToDateTime(txtTransactionFromDate.Text.ToString()); } if (!String.IsNullOrWhiteSpace(txtTransactionToDate.Text.Trim())) { toDate = MiscUtil.ParseToDateTime(txtTransactionToDate.Text.ToString()); } Int64 fiscalyearID = MiscUtil.GetActiveFiscalYear(); String navUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.BALANCE_SHEET_REPORT, UrlConstants.OVERVIEW_BALANCE_SHEET_FROM_DATE, fromDate.ToString(), UrlConstants.OVERVIEW_BALANCE_SHEET_TO_DATE, toDate.ToString(), UrlConstants.OVERVIEW_ACTIVE_FISCAL_YEAR_ID, fiscalyearID.ToString()).ToString(); Response.Redirect(navUrl); }
protected void odsHREmployeeAllowanceCustom_DetailedDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) { Int64 fiscalYearID = MiscUtil.GetActiveFiscalYear(); //String fe = SqlExpressionBuilder.PrepareFilterExpression("HREmployee." + HREmployee_DetailedEntity.FLD_NAME_EmploymentStatusID, employmentStatusID.ToString(), SQLMatchType.Equal); String fe = "HREmployeeAllowance.AllowanceCategoryID = 1 and HREmployeeAllowance.FiscalYearID = " + fiscalYearID + ""; Boolean isExecutingSelectCount = false; if (chbxFilter.Checked) { fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployee_DetailedEntity.FLD_NAME_EmployeeCode, txtSearchText.Text.ToString(), SQLMatchType.Equal); isExecutingSelectCount = false; } if (e.ExecutingSelectCount == isExecutingSelectCount) { UpdateHREmployeePhoneBillAdjustment(); } e.InputParameters["filterExpression"] = fe; }
private void PrepareInitialView() { BuildDropDownList(); MiscUtil.PopulateACFiscalYear(ddlFiscalYearID, false); txtAsAt.Text = System.DateTime.Now.ToString(UIConstants.SHORT_DATE_FORMAT); if (ddlFiscalYearID.Items.Count > 0) { Int64 activeFiscalYearID = MiscUtil.GetActiveFiscalYear(); if (activeFiscalYearID > 0) { ddlFiscalYearID.SelectedValue = activeFiscalYearID.ToString(); } } BindList(); BuildLabel(); }