public IList <CMProjectScheduleTemplateEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <CMProjectScheduleTemplateEntity> cMProjectScheduleTemplateEntityList = new List <CMProjectScheduleTemplateEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = CMProjectScheduleTemplateEntity.FLD_NAME_ProjectScheduleTemplateID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; cMProjectScheduleTemplateEntityList = FCCCMProjectScheduleTemplate.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (cMProjectScheduleTemplateEntityList != null && cMProjectScheduleTemplateEntityList.Count > 0) { totalRowCount = cMProjectScheduleTemplateEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMProjectScheduleTemplateEntityList ?? new List <CMProjectScheduleTemplateEntity>()); }
private void SaveCMProjectScheduleTemplateEntity() { if (IsValid) { try { CMProjectScheduleTemplateEntity cMProjectScheduleTemplateEntity = BuildCMProjectScheduleTemplateEntity(); Int64 result = -1; if (cMProjectScheduleTemplateEntity.IsNew) { result = FCCCMProjectScheduleTemplate.GetFacadeCreate().Add(cMProjectScheduleTemplateEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMProjectScheduleTemplateEntity.FLD_NAME_ProjectScheduleTemplateID, cMProjectScheduleTemplateEntity.ProjectScheduleTemplateID.ToString(), SQLMatchType.Equal); result = FCCCMProjectScheduleTemplate.GetFacadeCreate().Update(cMProjectScheduleTemplateEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _ProjectScheduleTemplateID = 0; _CMProjectScheduleTemplateEntity = new CMProjectScheduleTemplateEntity(); PrepareInitialView(); BindCMProjectScheduleTemplateList(); if (cMProjectScheduleTemplateEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Project Schedule Template Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "Project Schedule Template Information has been updated successfully.", false); } } else { if (cMProjectScheduleTemplateEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add Project Schedule Template Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update Project Schedule Template Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvCMProjectScheduleTemplate_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 ProjectScheduleTemplateID; Int64.TryParse(e.CommandArgument.ToString(), out ProjectScheduleTemplateID); if (ProjectScheduleTemplateID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _ProjectScheduleTemplateID = ProjectScheduleTemplateID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(CMProjectScheduleTemplateEntity.FLD_NAME_ProjectScheduleTemplateID, ProjectScheduleTemplateID.ToString(), SQLMatchType.Equal); CMProjectScheduleTemplateEntity cMProjectScheduleTemplateEntity = new CMProjectScheduleTemplateEntity(); result = FCCCMProjectScheduleTemplate.GetFacadeCreate().Delete(cMProjectScheduleTemplateEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _ProjectScheduleTemplateID = 0; _CMProjectScheduleTemplateEntity = new CMProjectScheduleTemplateEntity(); PrepareInitialView(); BindCMProjectScheduleTemplateList(); MiscUtil.ShowMessage(lblMessage, "Project Schedule Template has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Schedule Template.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <CMProjectScheduleTemplateEntity> GetData() { IList <CMProjectScheduleTemplateEntity> cMProjectScheduleTemplateEntityList = new List <CMProjectScheduleTemplateEntity>(); try { cMProjectScheduleTemplateEntityList = FCCCMProjectScheduleTemplate.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (cMProjectScheduleTemplateEntityList != null && cMProjectScheduleTemplateEntityList.Count > 0) { totalRowCount = cMProjectScheduleTemplateEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(cMProjectScheduleTemplateEntityList ?? new List <CMProjectScheduleTemplateEntity>()); }