protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { //GEtting the filter from the page string filter = string.Empty; int totalCount = 1; //Fetching the corresponding list //in this test will take a list of News AssetManagementAssetListRequest request = new AssetManagementAssetListRequest(); var d = jobInfo1.GetJobInfo(); request.branchId = d.BranchId.HasValue ? d.BranchId.Value.ToString() : "0"; request.departmentId = d.DepartmentId.HasValue ? d.DepartmentId.Value.ToString() : "0"; request.positionId = d.PositionId.HasValue ? d.PositionId.Value.ToString() : "0"; request.categoryId = categoryIdFilter.GetCategoryId(); request.employeeId = employeeFilter.GetEmployee().employeeId.ToString(); request.supplierId = supplierIdFilter.GetSupplierId(); request.Filter = ""; ListResponse <AssetManagementAsset> resp = _assetManagementService.ChildGetAll <AssetManagementAsset>(request); if (!resp.Success) { Common.errorMessage(resp); return; } this.Store1.DataSource = resp.Items; e.Total = resp.count; this.Store1.DataBind(); }
protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e) { //GEtting the filter from the page string filter = string.Empty; int totalCount = 1; //Fetching the corresponding list //in this test will take a list of News AssetManagementPurchaseOrdersListRequest request = getRequest(); request.Filter = ""; ListResponse <AssetManagementPurchaseOrder> resp = _assetManagementService.ChildGetAll <AssetManagementPurchaseOrder>(request); if (!resp.Success) { Common.errorMessage(resp); return; } this.Store1.DataSource = resp.Items; e.Total = resp.count; this.Store1.DataBind(); }
protected void OnboardingStore_RefreshData(object sender, StoreReadDataEventArgs e) { //GEtting the filter from the page string filter = string.Empty; int totalCount = 1; //Fetching the corresponding list //in this test will take a list of News AssetManagementOnBoardingListRequest request = new AssetManagementOnBoardingListRequest(); // request.Filter = ""; request.positionId = string.IsNullOrEmpty(CurrentPositionId.Text) ? "0" : CurrentPositionId.Text; request.categoryId = categoryIdFilter.GetCategoryId(); request.Size = e.Limit.ToString(); request.StartAt = e.Start.ToString(); ListResponse <AssetManagementOnBoarding> resp = _assetManagementService.ChildGetAll <AssetManagementOnBoarding>(request); if (!resp.Success) { Common.errorMessage(resp); return; } e.Total = resp.count; this.OnboardingStore.DataSource = resp.Items; this.OnboardingStore.DataBind(); }
private void FillCategories() { ListRequest req = new ListRequest(); ListResponse <AssetManagementCategory> resp = _assetManagementService.ChildGetAll <AssetManagementCategory>(req); if (!resp.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(resp); return; } categoryIdStore.DataSource = resp.Items; categoryIdStore.DataBind(); }
private void FillAssets() { AssetManagementAssetListRequest request1 = new AssetManagementAssetListRequest(); request1.branchId = "0"; request1.departmentId = "0"; request1.positionId = "0"; request1.categoryId = "0"; request1.employeeId = "0"; request1.supplierId = "0"; request1.PurchaseOrderId = "0"; request1.Filter = ""; ListResponse <AssetManagementAsset> resp = _assetManagementService.ChildGetAll <AssetManagementAsset>(request1); if (!resp.Success) { X.MessageBox.ButtonText.Ok = Resources.Common.Ok; Common.errorMessage(resp); return; } assetIdStore.DataSource = resp.Items; assetIdStore.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest && !IsPostBack) { SetExtLanguage(); if (string.IsNullOrEmpty(Request.QueryString["_catId"]) || string.IsNullOrEmpty(Request.QueryString["_assetId"])) { X.Msg.Alert("Error", "Error"); } currentAsset.Text = Request.QueryString["_assetId"]; currentCat.Text = Request.QueryString["_catId"]; AssetManagementCategoryPropertyListRequest propReq = new AssetManagementCategoryPropertyListRequest(); propReq.categoryId = Request.QueryString["_catId"].ToString(); AssetPropertyValueListRequest valReq = new AssetPropertyValueListRequest(); valReq.assetId = Request.QueryString["_assetId"].ToString(); valReq.categoryId = Request.QueryString["_catId"].ToString(); ListResponse <AssetManagementCategoryProperty> propResp = _assetManagementService.ChildGetAll <AssetManagementCategoryProperty>(propReq); if (!propResp.Success) { Common.errorMessage(propResp); } ListResponse <AssetPropertyValue> valResp = _assetManagementService.ChildGetAll <AssetPropertyValue>(valReq); if (!valResp.Success) { Common.errorMessage(valResp); } try { propResp.Items.ForEach(x => { if (x.mask.HasValue) { AssetPropertyValue corrVal = valResp.Items.Where(d => d.propertyId == x.propertyId).ToList().Count > 0 ? valResp.Items.Where(d => d.propertyId == x.propertyId).ToList()[0] : null; switch (x.mask) { case 1: propertiesForm.Items.Add(new TextField() { Text = corrVal != null && !string.IsNullOrEmpty(corrVal.value) ? corrVal.value : "", FieldLabel = x.caption, Name = x.propertyId }); break; //text case 2: propertiesForm.Items.Add(new NumberField() { Value = corrVal != null && !string.IsNullOrEmpty(corrVal.value) ? corrVal.GetValueDouble() : 0, FieldLabel = x.caption, Name = x.propertyId }); break; //number case 3: propertiesForm.Items.Add(new DateField() { SelectedDate = corrVal != null && !string.IsNullOrEmpty(corrVal.value) ? corrVal.GetValueDateTime() : DateTime.Now, Name = x.propertyId, FieldLabel = x.caption }); break; //datetime case 5: propertiesForm.Items.Add(new Checkbox() { Checked = corrVal != null && !string.IsNullOrEmpty(corrVal.value) ? corrVal.GetValueBool() : false, FieldLabel = x.caption, Name = x.propertyId, InputValue = "true" }); break; //checkbox } } }); } catch (Exception exp) { X.Msg.Alert("Error", exp.Message); } } }