public IList <HREmployeePhoneBillAdjustmentEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <HREmployeePhoneBillAdjustmentEntity> hREmployeePhoneBillAdjustmentEntityList = new List <HREmployeePhoneBillAdjustmentEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = HREmployeePhoneBillAdjustmentEntity.FLD_NAME_PhoneBillAdjustmentID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; hREmployeePhoneBillAdjustmentEntityList = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (hREmployeePhoneBillAdjustmentEntityList != null && hREmployeePhoneBillAdjustmentEntityList.Count > 0) { totalRowCount = hREmployeePhoneBillAdjustmentEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(hREmployeePhoneBillAdjustmentEntityList ?? new List <HREmployeePhoneBillAdjustmentEntity>()); }
private void DeleteAllCurrentData() { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeMonthlyTimeSheetSummaryEntity.FLD_NAME_SalarySessionID, (Int64.Parse(ddlSalarySessionID.SelectedValue)).ToString(), SQLMatchType.Equal); HREmployeePhoneBillAdjustmentEntity hREmployeePhoneBillAdjustmentEntity = new HREmployeePhoneBillAdjustmentEntity(); result = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().Delete(hREmployeePhoneBillAdjustmentEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _PhoneBillAdjustmentID = 0; _HREmployeePhoneBillAdjustmentEntity = new HREmployeePhoneBillAdjustmentEntity(); PrepareInitialView(); MiscUtil.ShowMessage(lblMessage, "Phone Bill Adjustment has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Phone Bill Adjustment.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } }
public IList <HREmployeePhoneBillAdjustmentEntity> GetData() { IList <HREmployeePhoneBillAdjustmentEntity> hREmployeePhoneBillAdjustmentEntityList = new List <HREmployeePhoneBillAdjustmentEntity>(); try { hREmployeePhoneBillAdjustmentEntityList = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (hREmployeePhoneBillAdjustmentEntityList != null && hREmployeePhoneBillAdjustmentEntityList.Count > 0) { totalRowCount = hREmployeePhoneBillAdjustmentEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(hREmployeePhoneBillAdjustmentEntityList ?? new List <HREmployeePhoneBillAdjustmentEntity>()); }
protected void lvHREmployeeAllowanceCustom_Detailed_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; HREmployee_DetailedEntity ent = new HREmployee_DetailedEntity(); TextBox txtEmployeeName = (TextBox)e.Item.FindControl("txtEmployeeName"); TextBox txtDesignation = (TextBox)e.Item.FindControl("txtDesignation"); TextBox txtEmployeeJobTypeID = (TextBox)e.Item.FindControl("txtEmployeeJobTypeID"); TextBox txtSalaryLevel = (TextBox)e.Item.FindControl("txtSalaryLevel"); TextBox txtPhoneBillAmount = (TextBox)e.Item.FindControl("txtPhoneBillAmount"); TextBox txtPhoneBillNote = (TextBox)e.Item.FindControl("txtPhoneBillNote"); Label employeeIDlv = (Label)e.Item.FindControl("employeeIDlv"); String remarks = String.Empty; Int64 employeeID = (Int64.Parse(employeeIDlv.Text)); btnSubmit.Text = "Save"; #region CurrentEmployeeMonthlyTimeSheetSummaryInfo String fe4 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_EmployeeID, employeeID.ToString(), SQLMatchType.Equal); String fe5 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_SalarySessionID, (Int64.Parse(ddlSalarySessionID.SelectedValue)).ToString(), SQLMatchType.Equal); String fe6 = SqlExpressionBuilder.PrepareFilterExpression(fe4, SQLJoinType.AND, fe5); IList <HREmployeePhoneBillAdjustmentEntity> hREmployeePhoneBillAdjustmentEntitylist = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().GetIL(null, null, String.Empty, fe6, DatabaseOperationType.LoadWithFilterExpression); if (hREmployeePhoneBillAdjustmentEntitylist != null && hREmployeePhoneBillAdjustmentEntitylist.Count > 0) { txtPhoneBillAmount.Text = hREmployeePhoneBillAdjustmentEntitylist[0].PhoneBillAmount.ToString().Trim(); txtPhoneBillNote.Text = hREmployeePhoneBillAdjustmentEntitylist[0].PhoneBillNote.ToString().Trim(); btnSubmit.Text = "Update"; } #endregion } }
private void UpdateHREmployeePhoneBillAdjustment() { try { IList <ListViewDataItem> list = lvHREmployeeAllowanceCustom_Detailed.Items; if (list != null && list.Count > 0) { Int32 tempDataItemIndex = 0; foreach (ListViewDataItem lvdi in list) { DataKey currentDataKey = lvHREmployeeAllowanceCustom_Detailed.DataKeys[tempDataItemIndex++]; Int64 _employeeID = (Int64)currentDataKey["EmployeeID"]; Boolean isSaveFlag = true; String fe1 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_EmployeeID, _employeeID.ToString(), SQLMatchType.Equal); String fe2 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_SalarySessionID, ddlSalarySessionID.SelectedValue.ToString(), SQLMatchType.Equal); String fe = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2); IList <HREmployeePhoneBillAdjustmentEntity> lstHREmployeePhoneBillAdjustment = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression); if (lstHREmployeePhoneBillAdjustment != null && lstHREmployeePhoneBillAdjustment.Count > 0) { isSaveFlag = false; } //String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeMonthlyTimeSheetSummaryEntity.em) HREmployee_DetailedEntity employeeEntity = GetHREmployeeInfo(_employeeID); TextBox txtEmployeeName = (TextBox)lvdi.FindControl("txtEmployeeName"); TextBox txtDesignation = (TextBox)lvdi.FindControl("txtDesignation"); TextBox txtEmployeeJobTypeID = (TextBox)lvdi.FindControl("txtEmployeeJobTypeID"); TextBox txtSalaryLevel = (TextBox)lvdi.FindControl("txtSalaryLevel"); TextBox txtPhoneBillAmount = (TextBox)lvdi.FindControl("txtPhoneBillAmount"); TextBox txtPhoneBillNote = (TextBox)lvdi.FindControl("txtPhoneBillNote"); TextBox txtPhoneAllowance = (TextBox)lvdi.FindControl("txtPhoneAllowance"); String remarks = String.Empty; Decimal a = 0; a = Decimal.Parse(txtPhoneBillAmount.Text) - Decimal.Parse(txtPhoneAllowance.Text); if (a <= 0) { a = 0; } txtPhoneBillNote.Text = "Actual Bill - Phone Ceiling: " + txtPhoneBillAmount.Text + "-" + txtPhoneAllowance.Text + " = " + a + " TK Deducted."; HREmployeePhoneBillAdjustmentEntity hREmployeePhoneBillAdjustmentEntity = new HREmployeePhoneBillAdjustmentEntity(); hREmployeePhoneBillAdjustmentEntity.EmployeeID = employeeEntity.EmployeeID; hREmployeePhoneBillAdjustmentEntity.SalarySessionID = Int64.Parse(ddlSalarySessionID.SelectedValue); hREmployeePhoneBillAdjustmentEntity.PhoneBillAmount = Decimal.Parse(txtPhoneBillAmount.Text); hREmployeePhoneBillAdjustmentEntity.PhoneBillNote = txtPhoneBillNote.Text; hREmployeePhoneBillAdjustmentEntity.IsRemoved = false; if (isSaveFlag) { FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().Add(hREmployeePhoneBillAdjustmentEntity, DatabaseOperationType.Add, TransactionRequired.No); MiscUtil.ShowMessage(lblMessage, "Employee phone adjustment Information has been saved successfully.", false); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_PhoneBillAdjustmentID, lstHREmployeePhoneBillAdjustment[0].PhoneBillAdjustmentID.ToString(), SQLMatchType.Equal); FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().Update(hREmployeePhoneBillAdjustmentEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); MiscUtil.ShowMessage(lblMessage, "Employee phone adjustment Information has been updated successfully.", false); } BindList(); //PrepareInitialView(); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, "Failed to Employee Monthly Time Sheet Summary Information.", true); } }
private void BuildHREmployeePhoneBillAdjustment() { try { IList <ListViewDataItem> list = lvHREmployeeAllowanceCustom_Detailed.Items; if (list != null && list.Count > 0) { foreach (ListViewDataItem lvdi in list) { TextBox txtEmployeeName = (TextBox)lvdi.FindControl("txtEmployeeName"); TextBox txtDesignation = (TextBox)lvdi.FindControl("txtDesignation"); TextBox txtEmployeeJobTypeID = (TextBox)lvdi.FindControl("txtEmployeeJobTypeID"); TextBox txtSalaryLevel = (TextBox)lvdi.FindControl("txtSalaryLevel"); TextBox txtPhoneBillAmount = (TextBox)lvdi.FindControl("txtPhoneBillAmount"); TextBox txtPhoneBillNote = (TextBox)lvdi.FindControl("txtPhoneBillNote"); Label employeeIDlv = (Label)lvdi.FindControl("employeeIDlv"); String remarks = String.Empty; Int64 employeeID = (Int64.Parse(employeeIDlv.Text)); txtPhoneBillNote.Text = String.Empty; txtPhoneBillAmount.Text = String.Empty; btnSubmit.Text = "Save"; #region CurrentEmployeeMonthlyTimeSheetSummaryInfo String fe4 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_EmployeeID, employeeID.ToString(), SQLMatchType.Equal); String fe5 = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePhoneBillAdjustmentEntity.FLD_NAME_SalarySessionID, (Int64.Parse(ddlSalarySessionID.SelectedValue)).ToString(), SQLMatchType.Equal); String fe6 = SqlExpressionBuilder.PrepareFilterExpression(fe4, SQLJoinType.AND, fe5); IList <HREmployeePhoneBillAdjustmentEntity> hREmployeePhoneBillAdjustmentEntitylist = FCCHREmployeePhoneBillAdjustment.GetFacadeCreate().GetIL(null, null, String.Empty, fe6, DatabaseOperationType.LoadWithFilterExpression); if (hREmployeePhoneBillAdjustmentEntitylist != null && hREmployeePhoneBillAdjustmentEntitylist.Count > 0) { txtPhoneBillAmount.Text = hREmployeePhoneBillAdjustmentEntitylist[0].PhoneBillAmount.ToString().Trim(); txtPhoneBillNote.Text = hREmployeePhoneBillAdjustmentEntitylist[0].PhoneBillNote.ToString().Trim(); btnSubmit.Text = "Update"; } #endregion } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, "Failed to Employee Monthly Time Sheet Summary Information.", true); } }