protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); storeSPCode.DataSource = SPCodeWrapper.FindAllByOrderByAndFilterAndChannelID(recordSortor.OrderByColumnName, recordSortor.IsDesc, ChannelID, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSPCode.DataBind(); }
protected void storeSystemEmailSettings_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); storeSystemEmailSettings.DataSource = SystemEmailSettingsWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemEmailSettings.DataBind(); }
protected void storeSystemApplication_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, 10); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); storeSystemApplication.DataSource = SystemApplicationWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemApplication.DataBind(); }
public static RecordSortor GetRecordSortorFromStoreRefreshDataEventArgs(StoreRefreshDataEventArgs e) { RecordSortor recordSortor = new RecordSortor(); recordSortor.OrderByColumnName = ""; if (e.Sort != null) { recordSortor.OrderByColumnName = e.Sort; } recordSortor.IsDesc = (e.Dir == Ext.Net.SortDirection.DESC); return(recordSortor); }
protected void ExportToExcel(object sender, EventArgs e) { RecordSortor recordSortor = new RecordSortor(); recordSortor.OrderByColumnName = ""; ReportSearchCondition reportSearchCondition = GetReportSearchCondition(recordSortor); List <SPRecordWrapper> dataSource = SPRecordWrapper.QueryRecord(reportSearchCondition.Channel, reportSearchCondition.Code, reportSearchCondition.Client, SPRecordWrapper.DayReportType_AllUp, reportSearchCondition.StartDate, reportSearchCondition.EndDate, reportSearchCondition.QueryFilters, reportSearchCondition.RecordSortor.OrderByColumnName, reportSearchCondition.RecordSortor.IsDesc); byte[] reportFile = ReportViewHelper.ExportListToExcel(this.rptvExport, dataSource, "DataSet1", "自定义数据导出报表"); this.Response.Clear(); this.Response.ContentType = "application/vnd.ms-excel"; this.Response.AddHeader("Content-Disposition", "attachment; filename=submittedData.xls"); this.Response.BinaryWrite(reportFile); this.Response.End(); }
protected void storeSystemUser_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); List <QueryFilter> queryFilters = new List <QueryFilter>(); queryFilters.Add(new QueryFilter(SystemUserWrapper.PROPERTY_NAME_USERLOGINID, SystemUserWrapper.DEV_USER_ID, FilterFunction.NotEqualTo)); if (!string.IsNullOrEmpty(this.txtSearchName.Text.Trim())) { queryFilters.Add(new QueryFilter(SystemUserWrapper.PROPERTY_NAME_USERLOGINID, this.txtSearchName.Text.Trim(), FilterFunction.Contains)); } storeSystemUser.DataSource = SystemUserWrapper.FindAllByOrderByAndFilter(queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemUser.DataBind(); }
protected void storeSystemPost_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); int selectOrgID = 0; if (!string.IsNullOrEmpty(e.Parameters["SelectOrgID"])) { selectOrgID = Convert.ToInt32(e.Parameters["SelectOrgID"]); } if (selectOrgID == 0) { storeSystemPost.DataSource = new List <SystemPostWrapper>(); e.Total = 0; storeSystemPost.DataBind(); return; } SystemOrganizationWrapper organization = SystemOrganizationWrapper.FindById(selectOrgID); if (organization == null) { storeSystemPost.DataSource = new List <SystemPostWrapper>(); e.Total = 0; storeSystemPost.DataBind(); return; } storeSystemPost.DataSource = SystemPostWrapper.FindAllByOrderByAndFilterAndOrganizationID(recordSortor.OrderByColumnName, recordSortor.IsDesc, organization, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemPost.DataBind(); }
protected void storeSystemDictionary_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); List <SystemDictionaryWrapper> datas = null; if (DictionaryGroup != null) { datas = SystemDictionaryWrapper.FindAllByOrderByAndFilterAndSystemDictionaryGroupID(recordSortor.OrderByColumnName, recordSortor.IsDesc, DictionaryGroup, pageQueryParams); } else { datas = SystemDictionaryWrapper.FindAllByOrderByAndFilter(new List <QueryFilter>(), recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); } storeSystemDictionary.DataSource = datas; e.Total = pageQueryParams.RecordCount; storeSystemDictionary.DataBind(); }
protected void storeSystemPrivilege_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); int selectResourceID = 0; if (e.Parameters["SelectResourceID"] != null) { selectResourceID = Convert.ToInt32(e.Parameters["SelectResourceID"]); } if (selectResourceID == 0) { storeSystemPrivilege.DataSource = new List <SystemPrivilegeWrapper>(); e.Total = 0; storeSystemPrivilege.DataBind(); return; } SystemResourcesWrapper resourcesWrapper = SystemResourcesWrapper.FindById(selectResourceID); if (resourcesWrapper == null) { storeSystemPrivilege.DataSource = new List <SystemPrivilegeWrapper>(); e.Total = 0; storeSystemPrivilege.DataBind(); return; } storeSystemPrivilege.DataSource = SystemPrivilegeWrapper.FindAllByOrderByAndFilterAndResourcesID(recordSortor.OrderByColumnName, recordSortor.IsDesc, resourcesWrapper, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemPrivilege.DataBind(); }
private ReportSearchCondition GetReportSearchCondition(RecordSortor eSortor) { ReportSearchCondition reportSearchCondition = new ReportSearchCondition(); reportSearchCondition.RecordSortor = eSortor; reportSearchCondition.Channel = null; if (this.cmbChannel.SelectedItem != null) { reportSearchCondition.Channel = SPChannelWrapper.FindById(Convert.ToInt32(this.cmbChannel.SelectedItem.Value)); } reportSearchCondition.Client = null; if (this.cmbClient.SelectedItem != null) { reportSearchCondition.Client = SPSClientWrapper.FindById(Convert.ToInt32(this.cmbClient.SelectedItem.Value)); } reportSearchCondition.Code = null; if (this.cmbCode.SelectedItem != null) { reportSearchCondition.Code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value)); } reportSearchCondition.StartDate = null; if (this.dfStart.SelectedValue != null) { reportSearchCondition.StartDate = this.dfStart.SelectedDate; } reportSearchCondition.EndDate = null; if (this.dfEnd.SelectedValue != null) { reportSearchCondition.EndDate = this.dfEnd.SelectedDate; } reportSearchCondition.QueryFilters = new List <QueryFilter>(); if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim())) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE, this.txtPhoneNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim())) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID, this.txtLinkID.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim())) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER, this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtMo.Text.Trim())) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(), FilterFunction.StartsWith)); } if (this.cmbIntercepter.SelectedItem != null && this.cmbIntercepter.SelectedItem.Value != null) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT, (this.cmbIntercepter.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo)); } if (this.cmbStatus.SelectedItem != null && this.cmbStatus.SelectedItem.Value != null) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK, (this.cmbStatus.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo)); } if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSYCNSUCCESSED, (this.cmbSycnStatus.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo)); } if (this.cmbProvince.SelectedItem != null && this.cmbProvince.SelectedItem.Value != null) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_PROVINCE, this.cmbProvince.SelectedItem.Value.ToString(), FilterFunction.EqualTo)); } if (this.cmbOperateType.SelectedItem != null && this.cmbOperateType.SelectedItem.Value != null) { reportSearchCondition.QueryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbOperateType.SelectedItem.Value.ToString(), FilterFunction.EqualTo)); } return(reportSearchCondition); }
protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e) { //storeData.DataSource = new List<SPRecordWrapper>(); //storeData.DataBind(); PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this. PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); SPChannelWrapper channel = null; SPSClientWrapper client = this.Client; SPCodeWrapper code = null; if (this.cmbCode.SelectedItem != null) { code = SPCodeWrapper.FindById(Convert.ToInt32(this.cmbCode.SelectedItem.Value)); } DateTime?startDate = null; if (this.dfStart.SelectedValue != null) { startDate = this.dfStart.SelectedDate; } DateTime?endDate = null; if (this.dfEnd.SelectedValue != null) { endDate = this.dfEnd.SelectedDate; } List <QueryFilter> queryFilters = new List <QueryFilter>(); if (!string.IsNullOrEmpty(this.txtPhoneNumber.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MOBILE, this.txtPhoneNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtLinkID.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_LINKID, this.txtLinkID.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtSpNumber.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_SPNUMBER, this.txtSpNumber.Text.Trim(), FilterFunction.StartsWith)); } if (!string.IsNullOrEmpty(this.txtMo.Text.Trim())) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_MO, this.txtMo.Text.Trim(), FilterFunction.StartsWith)); } queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISINTERCEPT, (false).ToString(), FilterFunction.EqualTo)); queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSTATOK, (true).ToString(), FilterFunction.EqualTo)); //if (this.cmbSycnStatus.SelectedItem != null && this.cmbSycnStatus.SelectedItem.Value != null) //{ // queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_ISSYCNSUCCESSED, (this.cmbSycnStatus.SelectedItem.Value == "1").ToString(), FilterFunction.EqualTo)); //} if (this.cmbProvince.SelectedItem != null && this.cmbProvince.SelectedItem.Value != null) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_PROVINCE, this.cmbProvince.SelectedItem.Value.ToString(), FilterFunction.EqualTo)); } if (this.cmbOperateType.SelectedItem != null && this.cmbOperateType.SelectedItem.Value != null) { queryFilters.Add(new QueryFilter(SPRecordWrapper.PROPERTY_NAME_OPERATORTYPE, this.cmbOperateType.SelectedItem.Value.ToString(), FilterFunction.EqualTo)); } storeData.DataSource = SPRecordWrapper.QueryRecordByPage(channel, code, client, SPRecordWrapper.DayReportType_AllUp, startDate, endDate, queryFilters, recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeData.DataBind(); }