public IList <MDEmployeeSkillEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <MDEmployeeSkillEntity> mDEmployeeSkillEntityList = new List <MDEmployeeSkillEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = MDEmployeeSkillEntity.FLD_NAME_EmployeeSkillID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; mDEmployeeSkillEntityList = FCCMDEmployeeSkill.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (mDEmployeeSkillEntityList != null && mDEmployeeSkillEntityList.Count > 0) { totalRowCount = mDEmployeeSkillEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeSkillEntityList ?? new List <MDEmployeeSkillEntity>()); }
private void SaveMDEmployeeSkillEntity() { if (IsValid) { try { MDEmployeeSkillEntity mDEmployeeSkillEntity = BuildMDEmployeeSkillEntity(); Int64 result = -1; if (mDEmployeeSkillEntity.IsNew) { result = FCCMDEmployeeSkill.GetFacadeCreate().Add(mDEmployeeSkillEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeSkillEntity.FLD_NAME_EmployeeSkillID, mDEmployeeSkillEntity.EmployeeSkillID.ToString(), SQLMatchType.Equal); result = FCCMDEmployeeSkill.GetFacadeCreate().Update(mDEmployeeSkillEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _EmployeeSkillID = 0; _MDEmployeeSkillEntity = new MDEmployeeSkillEntity(); PrepareInitialView(); BindMDEmployeeSkillList(); if (mDEmployeeSkillEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Employee Skill Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Employee Skill Information has been updated successfully.", false); } } else { if (mDEmployeeSkillEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Skill Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Skill Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvMDEmployeeSkill_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 EmployeeSkillID; Int64.TryParse(e.CommandArgument.ToString(), out EmployeeSkillID); if (EmployeeSkillID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _EmployeeSkillID = EmployeeSkillID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeSkillEntity.FLD_NAME_EmployeeSkillID, EmployeeSkillID.ToString(), SQLMatchType.Equal); MDEmployeeSkillEntity mDEmployeeSkillEntity = new MDEmployeeSkillEntity(); result = FCCMDEmployeeSkill.GetFacadeCreate().Delete(mDEmployeeSkillEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _EmployeeSkillID = 0; _MDEmployeeSkillEntity = new MDEmployeeSkillEntity(); PrepareInitialView(); BindMDEmployeeSkillList(); MiscUtil.ShowMessage(lblMessage, "Employee Skill has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Skill.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <MDEmployeeSkillEntity> GetData() { IList <MDEmployeeSkillEntity> mDEmployeeSkillEntityList = new List <MDEmployeeSkillEntity>(); try { mDEmployeeSkillEntityList = FCCMDEmployeeSkill.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (mDEmployeeSkillEntityList != null && mDEmployeeSkillEntityList.Count > 0) { totalRowCount = mDEmployeeSkillEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(mDEmployeeSkillEntityList ?? new List <MDEmployeeSkillEntity>()); }