//[HttpGet] //[HandlerAjaxOnly] public ActionResult GetDataItems(string enCode) { var itemId = new ItemsApp().GetModelId(enCode); var itemdata = new ItemsDetailApp().GetList(itemId); var treeList = new List <ComboSelectModel>(); foreach (var item in new ItemsApp().GetList()) { if (item.F_EnCode.Equals(enCode)) { var dataItemList = itemdata.FindAll(t => t.F_ItemId.Equals(item.F_Id)); foreach (ItemsDetailEntity itemList in dataItemList) { ComboSelectModel comboModel = new ComboSelectModel(); comboModel.id = itemList.F_ItemCode; comboModel.text = itemList.F_ItemName; comboModel.value = itemList.F_ItemName; comboModel.parentid = itemList.F_ParentId == null ? "0" : itemList.F_ParentId; treeList.Add(comboModel); } return(Content(treeList.ComboSelectJson())); } } return(Content("")); }
public ClientsDataController(ItemsDetailApp itemsDetailApp, ItemsApp itemsApp, OrganizeApp organizeApp, RoleApp roleApp, DutyApp dutyApp, RoleAuthorizeApp roleAuthorizeApp) { this.itemsDetailApp = itemsDetailApp; this.itemsApp = itemsApp; this.organizeApp = organizeApp; this.roleApp = roleApp; this.dutyApp = dutyApp; this.roleAuthorizeApp = roleAuthorizeApp; }
private object GetDataItemList() { var itemdata = new ItemsDetailApp().GetList(); Dictionary <string, object> dictionaryItem = new Dictionary <string, object>(); var items = new ItemsApp().GetList(); foreach (var item in items) { var dataItemList = itemdata.FindAll(t => t.F_ItemId.Equals(item.F_Id)); Dictionary <string, string> dictionaryItemList = new Dictionary <string, string>(); foreach (var itemList in dataItemList) { dictionaryItemList.Add(itemList.F_ItemCode, itemList.F_ItemName); } dictionaryItem.Add(item.F_EnCode, dictionaryItemList); } return(dictionaryItem); }
private object GetDataItemList() { var itemdata = new ItemsDetailApp().GetList(); Dictionary <string, object> dictionaryItem = new Dictionary <string, object>(); List <ItemsEntity> itemEntity = new ItemsApp().GetList(); foreach (var item in itemEntity) { var dataItemList = itemdata.FindAll(t => t.ItemId == item.Id); Dictionary <string, string> dictionaryItemList = new Dictionary <string, string>(); foreach (var itemList in dataItemList) { dictionaryItemList.Add(itemList.ItemCode, itemList.ItemName); } dictionaryItem.Add(item.EnCode, dictionaryItemList); } return(dictionaryItem); }
public ActionResult GetItemTypeAndDetails() { List <object> itemAndDetails = new List <object>(); ItemsApp itemsApp = new ItemsApp(); List <ItemsEntity> itemTypes = itemsApp.GetApiList("Product_Cotton"); foreach (var itemType in itemTypes) { List <object> retDetails = new List <object>(); ItemsDetailApp itemsDetailApp = new ItemsDetailApp(); List <ItemsDetailEntity> itemDetails = itemsDetailApp.GetList(itemType.Id, ""); foreach (var itemDetail in itemDetails) { retDetails.Add(new { itemCode = itemDetail.F_ItemCode, itemName = itemDetail.F_ItemName }); } itemAndDetails.Add(new { typeName = itemType.F_FullName, typeEntitys = retDetails }); } return(Content(itemAndDetails.ToJson())); }
public ItemsTypeController(ItemsApp itemsApp) { this.itemsApp = itemsApp; }
public ActionResult Print(string keyValue) { string[] IDs = keyValue.Split(','); int[] IDArray = Array.ConvertAll <string, int>(IDs, s => int.Parse(s)); List <Apply> applyList = new List <Apply>(); foreach (var ID in IDArray) { var applyBill = applyBillApp.GetForm(ID); applyBill.prtTag = "T"; applyBill.prtDate = DateTime.Now; applyBillApp.SubmitForm(applyBill, applyBill.ID); var price = priceApp.GetFormJson(applyBill.priNO); var apply = applyList.Where(t => t.purNo == applyBill.purNo).FirstOrDefault(); if (apply != null) { var list = apply.applys; ApplyDetail app = new ApplyDetail(); app.prdName = price.prdName; app.orderNo = price.orderNo; app.spc = price.spc; app.price = price.price; app.Remark = price.rem; if (price.unit == applyBill.appUnit) { app.num = applyBill.appNum; app.viceNum = (applyBill.viceNum ?? 0); app.viceUnit = applyBill.viceUnit; } else { app.num = (applyBill.viceNum ?? 0); app.viceNum = applyBill.appNum; app.viceUnit = applyBill.appUnit; } app.unit = price.unit; app.total = Math.Round(app.price.Value * app.num.Value, 2); if (price.currency.HasValue) { var ItemId = new ItemsApp().GetItemFormByName("币别").F_Id; app.currency = new ItemsDetailApp().GetItemByItemIdAndCode(ItemId, price.currency.Value.ToString()).F_Description; } else { app.currency = "¥"; } list.Add(app); apply.TotalMoney = Math.Round(list.Sum(t => t.total).Value, 2); apply.currency = app.currency; } else { Apply app = new Apply(); app.telPhone = price.tel; app.Fax = price.fax; app.date = applyBill.date.ToDateString(); app.purAuthMan = applyBill.purAuthMan; app.hopeDD = applyBill.hopeDD.ToDateString(); app.purExaMan = applyBill.purExaMan; app.purMan = applyBill.purMan; app.purNo = applyBill.purNo; app.purSup = applyBill.purSup; app.remark = price.rem; var list = new List <ApplyDetail>(); ApplyDetail appDetail = new ApplyDetail(); appDetail.prdName = price.prdName; appDetail.orderNo = price.orderNo; appDetail.spc = price.spc; appDetail.price = price.price; if (price.unit == applyBill.appUnit) { appDetail.num = applyBill.appNum; appDetail.viceNum = (applyBill.viceNum ?? 0); appDetail.viceUnit = applyBill.viceUnit; } else { appDetail.num = (applyBill.viceNum ?? 0); appDetail.viceNum = applyBill.appNum; appDetail.viceUnit = applyBill.appUnit; } appDetail.unit = price.unit; appDetail.total = Math.Round(appDetail.price.Value * appDetail.num.Value, 2); if (price.currency.HasValue) { var ItemId = new ItemsApp().GetItemFormByName("币别").F_Id; appDetail.currency = new ItemsDetailApp().GetItemByItemIdAndCode(ItemId, price.currency.Value.ToString()).F_Description; } else { appDetail.currency = "¥"; } list.Add(appDetail); app.applys = list; app.TotalMoney = Math.Round(list.Sum(t => t.total).Value, 2); app.currency = appDetail.currency; applyList.Add(app); } } return(View(applyList)); }