public IList <KBUserTreeUploadInfoEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression) { IList <KBUserTreeUploadInfoEntity> kBUserTreeUploadInfoEntityList = new List <KBUserTreeUploadInfoEntity>(); try { if (pageSize == -1) { pageSize = 1000000000; } if (String.IsNullOrEmpty(sortExpression)) { sortExpression = KBUserTreeUploadInfoEntity.FLD_NAME_UserTreeUploadInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING; } startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1; kBUserTreeUploadInfoEntityList = FCCKBUserTreeUploadInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression); if (kBUserTreeUploadInfoEntityList != null && kBUserTreeUploadInfoEntityList.Count > 0) { totalRowCount = kBUserTreeUploadInfoEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(kBUserTreeUploadInfoEntityList ?? new List <KBUserTreeUploadInfoEntity>()); }
private void SaveKBUserTreeUploadInfoEntity() { if (IsValid) { try { KBUserTreeUploadInfoEntity kBUserTreeUploadInfoEntity = BuildKBUserTreeUploadInfoEntity(); Int64 result = -1; if (kBUserTreeUploadInfoEntity.IsNew) { result = FCCKBUserTreeUploadInfo.GetFacadeCreate().Add(kBUserTreeUploadInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeUploadInfoEntity.FLD_NAME_UserTreeUploadInfoID, kBUserTreeUploadInfoEntity.UserTreeUploadInfoID.ToString(), SQLMatchType.Equal); result = FCCKBUserTreeUploadInfo.GetFacadeCreate().Update(kBUserTreeUploadInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _UserTreeUploadInfoID = 0; _KBUserTreeUploadInfoEntity = new KBUserTreeUploadInfoEntity(); PrepareInitialView(); BindKBUserTreeUploadInfoList(); if (kBUserTreeUploadInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "K BUser Tree Upload Info Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "K BUser Tree Upload Info Information has been updated successfully.", false); } } else { if (kBUserTreeUploadInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add K BUser Tree Upload Info Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update K BUser Tree Upload Info Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvKBUserTreeUploadInfo_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 UserTreeUploadInfoID; Int64.TryParse(e.CommandArgument.ToString(), out UserTreeUploadInfoID); if (UserTreeUploadInfoID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _UserTreeUploadInfoID = UserTreeUploadInfoID; PrepareEditView(); } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(KBUserTreeUploadInfoEntity.FLD_NAME_UserTreeUploadInfoID, UserTreeUploadInfoID.ToString(), SQLMatchType.Equal); KBUserTreeUploadInfoEntity kBUserTreeUploadInfoEntity = new KBUserTreeUploadInfoEntity(); result = FCCKBUserTreeUploadInfo.GetFacadeCreate().Delete(kBUserTreeUploadInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _UserTreeUploadInfoID = 0; _KBUserTreeUploadInfoEntity = new KBUserTreeUploadInfoEntity(); PrepareInitialView(); BindKBUserTreeUploadInfoList(); MiscUtil.ShowMessage(lblMessage, "K BUser Tree Upload Info has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete K BUser Tree Upload Info.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
public IList <KBUserTreeUploadInfoEntity> GetData() { IList <KBUserTreeUploadInfoEntity> kBUserTreeUploadInfoEntityList = new List <KBUserTreeUploadInfoEntity>(); try { kBUserTreeUploadInfoEntityList = FCCKBUserTreeUploadInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load); if (kBUserTreeUploadInfoEntityList != null && kBUserTreeUploadInfoEntityList.Count > 0) { totalRowCount = kBUserTreeUploadInfoEntityList[0].TotalRowCount; } } catch (Exception ex) { } return(kBUserTreeUploadInfoEntityList ?? new List <KBUserTreeUploadInfoEntity>()); }
protected void afuFiles_UploadedComplete(object sender, AsyncFileUploadEventArgs e) { KBUserTreeUploadInfoEntity ent = new KBUserTreeUploadInfoEntity(); ent.UserTreeID = this.OverviewUserTreeID; ent.OriginalFileName = Path.GetFileName(e.FileName); ent.CurrentFileName = Guid.NewGuid().ToString() + Path.GetExtension(e.FileName); ent.FileType = ""; ent.Extension = Path.GetExtension(e.FileName); ent.Path = FileUploadConstants.KBUserTree.KBDocument + ent.CurrentFileName; ent.Remarks = String.Empty; FCCKBUserTreeUploadInfo.GetFacadeCreate().Add(ent, DatabaseOperationType.Add, TransactionRequired.No); // file upload afuFiles.SaveAs(Server.MapPath(ent.Path)); //LoadFileListGried BindKBUserTreeUploadInfoList(); }