本文整理汇总了C#中Telerik.Web.Mvc.GridCommand类的典型用法代码示例。如果您正苦于以下问题:C# GridCommand类的具体用法?C# GridCommand怎么用?C# GridCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridCommand类属于Telerik.Web.Mvc命名空间,在下文中一共展示了GridCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BulkEditSave
public ActionResult BulkEditSave(GridCommand command,
[Bind(Prefix = "updated")]IEnumerable<PluginModel> updatedPlugins)
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
return AccessDeniedView();
//bool changed = false;
if (updatedPlugins != null)
{
foreach (var pluginModel in updatedPlugins)
{
//update
var pluginDescriptor = _pluginFinder.GetPluginDescriptorBySystemName(pluginModel.SystemName, false);
if (pluginDescriptor != null)
{
//we allow editing of 'friendly name' and 'display order'
pluginDescriptor.FriendlyName = pluginModel.FriendlyName;
pluginDescriptor.DisplayOrder = pluginModel.DisplayOrder;
PluginFileParser.SavePluginDescriptionFile(pluginDescriptor);
//changed = true;
}
}
}
//if (changed)
//restart application
//_webHelper.RestartAppDomain("~/Admin/Plugin/List");
return BulkEditSelect(command);
}
示例2: _AjaxList
public ActionResult _AjaxList(GridCommand command, WorkingCalendarSearchModel searchModel)
{
var objList = this.genericMgr.FindAllWithNativeSql<object[]>("exec USP_Busi_GetWorkingCalendarView ?,?,?,?",
new object[]
{
searchModel.SearchRegion, "",
searchModel.StartWorkingDate, searchModel.EndWorkingDate
});
var list = new List<WorkingCalendarView>();
foreach (var obj in objList)
{
var w = obj as object[];
if (w == null) continue;
list.Add(new WorkingCalendarView
{
Date = (DateTime)w[0],
DateFrom = (DateTime)w[1],
DateTo = (DateTime)w[2]
});
}
return PartialView(new GridModel(list));
}
示例3: Configure
public ActionResult Configure(GridCommand command)
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
return Content("Access denied");
var tmp = new List<FixedTaxRateModel>();
foreach (var taxCategory in _taxCategoryService.GetAllTaxCategories())
tmp.Add(new FixedTaxRateModel()
{
TaxCategoryId = taxCategory.Id,
TaxCategoryName = taxCategory.Name,
Rate = GetTaxRate(taxCategory.Id)
});
var tmp2 = tmp.ForCommand(command);
var gridModel = new GridModel<FixedTaxRateModel>
{
Data = tmp2,
Total = tmp2.Count()
};
return new JsonResult
{
Data = gridModel
};
}
示例4: List
public ActionResult List(GridCommand command)
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManageCustomers))
return AccessDeniedView();
var customers = _customerService.GetOnlineCustomers(DateTime.UtcNow.AddMinutes(-_customerSettings.OnlineCustomerMinutes),
null, command.Page - 1, command.PageSize);
var model = new GridModel<OnlineCustomerModel>
{
Data = customers.Select(x =>
{
return new OnlineCustomerModel()
{
Id = x.Id,
CustomerInfo = x.IsRegistered() ? x.Email : _localizationService.GetResource("Admin.Customers.Guest"),
LastIpAddress = x.LastIpAddress,
Location = _geoCountryLookup.LookupCountryName(x.LastIpAddress),
LastActivityDate = _dateTimeHelper.ConvertToUserTime(x.LastActivityDateUtc, DateTimeKind.Utc),
LastVisitedPage = x.GetAttribute<string>(SystemCustomerAttributeNames.LastVisitedPage)
};
}),
Total = customers.TotalCount
};
return new JsonResult
{
Data = model
};
}
示例5: RoutingMasterList
public ActionResult RoutingMasterList(GridCommand command, RoutingMasterSearchModel searchModel)
{
SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
return View();
}
示例6: AffiliatedCustomerList
public ActionResult AffiliatedCustomerList(int affiliateId, GridCommand command)
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
return AccessDeniedView();
var affiliate = _affiliateService.GetAffiliateById(affiliateId);
if (affiliate == null)
throw new ArgumentException("No affiliate found with the specified id");
var customers = _customerService.GetAllCustomers(
affiliateId: affiliate.Id,
pageIndex: command.Page - 1,
pageSize: command.PageSize);
var model = new GridModel<AffiliateModel.AffiliatedCustomerModel>
{
Data = customers.Select(customer =>
{
var customerModel = new AffiliateModel.AffiliatedCustomerModel();
customerModel.Id = customer.Id;
customerModel.Name = customer.Email;
return customerModel;
}),
Total = customers.TotalCount
};
return new JsonResult
{
Data = model
};
}
示例7: Configure
public ActionResult Configure(GridCommand command)
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings))
return Content("Access denied");
var tmp = new List<FixedShippingRateModel>();
foreach (var shippingMethod in _shippingService.GetAllShippingMethods())
tmp.Add(new FixedShippingRateModel()
{
ShippingMethodId = shippingMethod.Id,
ShippingMethodName = shippingMethod.Name,
Rate = GetShippingRate(shippingMethod.Id)
});
var tmp2 = tmp.ForCommand(command);
var gridModel = new GridModel<FixedShippingRateModel>
{
Data = tmp2,
Total = tmp2.Count()
};
return new JsonResult
{
Data = gridModel
};
}
示例8: _SearchResult
public ActionResult _SearchResult(GridCommand command, string item, string supplier, DateTime? dateFrom, DateTime? dateTo)
{
string sqlStr = PrepareSearchStatement(command, item, supplier, dateFrom, dateTo);
IList<object[]> objectList = this.queryMgr.FindAllWithNativeSql<object[]>(sqlStr);
var inspectDetailList = (from inp in objectList
select new InspectDetail
{
IpNo = (string)inp[0],
ManufactureParty = (string)inp[1],
ManufacturePartyName = (string)inp[2],
Item = (string)inp[3],
ItemDescription = (string)inp[4],
ReferenceItemCode = (string)inp[5],
UnitCount = (decimal)inp[6],
Uom = (string)inp[7],
RejectQty = (decimal)inp[8],
InspectQty = (decimal)inp[9]
}).ToList();
int count = Convert.ToInt32(base.systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.MaxRowSizeOnPage));
if (inspectDetailList.Count > count)
{
SaveWarningMessage(string.Format(Resources.EXT.ControllerLan.Con_DataExceedRowTheSpecifiedRows, count));
}
return View(inspectDetailList.Take(count));
}
示例9: _ReturnHierarchyAjax
public ActionResult _ReturnHierarchyAjax(GridCommand command, string item, string supplier, DateTime? dateFrom, DateTime? dateTo)
{
string sqlStr = PrepareReturnSearchStatement(command, item, supplier, dateFrom, dateTo);
IList<object[]> objectList = this.queryMgr.FindAllWithNativeSql<object[]>(sqlStr);
var receiveReturnList = (from rr in objectList
select new ReceiveReturnModel
{
Supplier = (string)rr[0],
Item = (string)rr[1],
ReceivedQty = rr[2] == null ? 0 : (decimal)rr[2],
RejectedQty = rr[3] == null ? 0 : (decimal)rr[3],
ItemDescription = (string)rr[4],
ReferenceItemCode = (string)rr[5],
Uom = (string)rr[6],
SupplierName = (string)rr[7]
}).ToList();
int count = Convert.ToInt32(base.systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.MaxRowSizeOnPage));
if (receiveReturnList.Count > count)
{
SaveWarningMessage(string.Format(Resources.EXT.ControllerLan.Con_DataExceedRowTheSpecifiedRows, count));
}
return PartialView(new GridModel(receiveReturnList));
}
示例10: _AjaxList
public ActionResult _AjaxList(GridCommand command, SearchModel searchModel)
{
SearchStatementModel searchStatementModel = PrepareSearchStatement(command, searchModel);
GridModel<PostDO> gridlist = GetAjaxPageData<PostDO>(searchStatementModel, command);
return PartialView(gridlist);
}
示例11: PrepareSearchStatement
private SearchStatementModel PrepareSearchStatement(GridCommand command, SearchModel searchModel)
{
string whereStatement = "";
IList<object> param = new List<object>();
HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "t", ref whereStatement, param);
HqlStatementHelper.AddEqStatement("ReceiptNo", searchModel.ReceiptNo, "t", ref whereStatement, param);
HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "t", ref whereStatement, param);
if (searchModel.StartDate != null & searchModel.EndDate != null)
{
HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartDate, searchModel.EndDate, "t", ref whereStatement, param);
}
else if (searchModel.StartDate != null & searchModel.EndDate == null)
{
HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartDate, "t", ref whereStatement, param);
}
else if (searchModel.StartDate == null & searchModel.EndDate != null)
{
HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndDate, "t", ref whereStatement, param);
}
string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
if (command.SortDescriptors.Count == 0)
{
sortingStatement = " order by t.CreateDate desc";
}
SearchStatementModel searchStatementModel = new SearchStatementModel();
searchStatementModel.SelectCountStatement = selectCountStatement;
searchStatementModel.SelectStatement = selectStatement;
searchStatementModel.WhereStatement = whereStatement;
searchStatementModel.SortingStatement = sortingStatement;
searchStatementModel.Parameters = param.ToArray<object>();
return searchStatementModel;
}
示例12: PrepareSearchStatement
private SearchNativeSqlStatementModel PrepareSearchStatement(GridCommand command, CabProductionViewSearchModel searchModel)
{
string statement = selectStatement;
if (!string.IsNullOrWhiteSpace(searchModel.Flow))
{
statement += string.Format(" and m.Flow = '{0}'", searchModel.Flow);
}
if (searchModel.Type != null)
{
statement += string.Format(" and m.Type = {0}", searchModel.Type);
}
if (searchModel.IsOut)
{
statement += " and exists(select 1 from ORD_OrderMstr_2 m2 where m2.OrderNo = m.ExtOrderNo)";
}
string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
if (string.IsNullOrEmpty(sortingStatement))
{
sortingStatement = " order by ExtSeq asc";
}
SearchNativeSqlStatementModel searchStatementModel = new SearchNativeSqlStatementModel();
searchStatementModel.SelectSql = statement;
searchStatementModel.SortingStatement = sortingStatement;
return searchStatementModel;
}
示例13: TaxRateUpdate
public ActionResult TaxRateUpdate(FixedTaxRateModel model, GridCommand command)
{
int taxCategoryId = model.TaxCategoryId;
decimal rate = model.Rate;
_settingService.SetSetting(string.Format("Tax.TaxProvider.FixedRate.TaxCategoryId{0}", taxCategoryId), rate);
var tmp = new List<FixedTaxRateModel>();
foreach (var taxCategory in _taxCategoryService.GetAllTaxCategories())
tmp.Add(new FixedTaxRateModel()
{
TaxCategoryId = taxCategory.Id,
TaxCategoryName = taxCategory.Name,
Rate = GetTaxRate(taxCategory.Id)
});
var tmp2 = tmp.ForCommand(command);
var gridModel = new GridModel<FixedTaxRateModel>
{
Data = tmp2,
Total = tmp2.Count()
};
return new JsonResult
{
Data = gridModel
};
}
示例14: _SearchResult
public ActionResult _SearchResult(GridCommand command, string item, string supplier, DateTime? dateFrom, DateTime? dateTo)
{
string sqlStr = PrepareSearchStatement(command, item, supplier, dateFrom, dateTo);
IList<object[]> objectList = base.genericMgr.FindAllWithNativeSql<object[]>(sqlStr);
var inspectDetailList = (from inp in objectList
select new InspectDetail
{
IpNo = (string)inp[0],
ManufactureParty = (string)inp[1],
ManufacturePartyName = (string)inp[2],
Item = (string)inp[3],
ItemDescription = (string)inp[4],
ReferenceItemCode = (string)inp[5],
UnitCount = (decimal)inp[6],
Uom = (string)inp[7],
RejectQty = (decimal)inp[8],
InspectQty = (decimal)inp[9]
}).ToList();
int count = Convert.ToInt32(base.systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.MaxRowSizeOnPage));
if (inspectDetailList.Count > count)
{
SaveWarningMessage(string.Format("数据超过{0}行,只显示前{0}行", count));
}
//return PartialView(inspectDetailList.Take(count));
GridModel<InspectDetail> gridModel = new GridModel<InspectDetail>();
gridModel.Total = count;
gridModel.Data = inspectDetailList.Take(count);
return PartialView(gridModel);
}
示例15: Categories
public ActionResult Categories(GridCommand command)
{
var model = new GridModel<TaxCategoryModel>();
if (_permissionService.Authorize(StandardPermissionProvider.ManageTaxSettings))
{
var categoriesModel = _taxCategoryService.GetAllTaxCategories()
.Select(x => x.ToModel())
.ForCommand(command)
.ToList();
model.Data = categoriesModel;
model.Total = categoriesModel.Count;
}
else
{
model.Data = Enumerable.Empty<TaxCategoryModel>();
NotifyAccessDenied();
}
return new JsonResult
{
Data = model
};
}