public bool OtherLend(string strOrder, string LoanName, string Creator, string orderNO) { List <EmsModel.OrderEquipDetail> listModer = new List <EmsModel.OrderEquipDetail>(); //"6,9,碳刷,18#6,9,碳刷,20" string[] sArr = strOrder.Split('#'); for (int i = 0; i < sArr.Length; i++) { string[] sArr2 = sArr[i].Split(','); EmsModel.OrderEquipDetail model = new EmsModel.OrderEquipDetail(); model.InventoryKindId = Convert.ToInt32(sArr2[0]); //model.OrderId = Convert.ToInt32(sArr2[1]); model.InstrumentEquip = sArr2[2]; model.EquipDetailName = sArr2[2]; model.EquipId = sArr2[3]; model.Type = 1; listModer.Add(model); } int num = dal.GetStatusCountL(orderNO); int typeNo = 1; //是否已经完成计划借用数 if ((listModer.Count - num) <= 0) { typeNo = 2; } return(dal.OtherLend(listModer, LoanName, Creator, orderNO, typeNo, 1)); }
/// <summary> /// 更新一条数据 /// </summary> public bool UpdateOrder(EmsModel.OrderInfo Model) { EmsModel.OrderEquipDetail MOD = new EmsModel.OrderEquipDetail(); MOD.OrderId = Model.Id; List <EmsModel.OrderEquipDetail> list = new EmsDAL.OrderEquipDetail().GetListByPage(MOD, 1, 999); return(dal.UpdateOrder(Model, list)); }
public EmsModel.JsonModel GetJsonModelEscheat2(string OrderID) { //当前页 int pageIndex = 1; //页容量 int pageSize = 999; EmsModel.OrderEquipDetail mod = new EmsModel.OrderEquipDetail(); mod.OrderId = Convert.ToInt32(OrderID); List <EmsModel.OrderEquipDetail> modList = new EmsBLL.OrderEquipDetail().GetListByPage(mod, 1, 999); //定义分页数据实体 PagedDataModel <EmsModel.OrderEquipDetail> pagedDataModel = null; //定义JSON标准格式实体中 JsonModel jsonModel = null; if (modList.Count > 0) { var list = modList; //总条数 int rowCount = modList.Count; //总页数 int pageCount = (int)Math.Ceiling(rowCount * 1.0 / pageSize); //将数据封装到PagedDataModel分页数据实体中 pagedDataModel = new PagedDataModel <EmsModel.OrderEquipDetail>() { PageCount = pageCount, PagedData = list, PageIndex = pageIndex, PageSize = pageSize, RowCount = rowCount }; //将分页数据实体封装到JSON标准实体中 jsonModel = new JsonModel() { Data = pagedDataModel, Msg = "成功", Status = "ok", BackUrl = "" }; return(jsonModel); } else { jsonModel = new JsonModel() { Status = "no", Msg = "失败" }; return(jsonModel); } }
/// <summary> /// 获取订单数据 分页 /// </summary> /// <param name="Mod">查询条件</param> /// <param name="pageIndex">当前页</param> /// <param name="pageSize">页容量,每页显示条数</param> /// <returns></returns> public EmsModel.JsonModel GetJsonModelByOrder(EmsModel.OrderEquipDetail Mod, int pageIndex, int pageSize) { List <EmsModel.OrderEquipDetail> modList = new EmsBLL.OrderEquipDetail().GetListByPage(Mod, ((pageIndex - 1) * pageSize) + 1, (pageIndex * pageSize)); //定义分页数据实体 PagedDataModel <EmsModel.OrderEquipDetail> pagedDataModel = null; //定义JSON标准格式实体中 JsonModel jsonModel = null; if (modList.Count > 0) { var list = modList; //总条数 int rowCount = new EmsBLL.OrderEquipDetail().GetListByPageCount(Mod); //总页数 int pageCount = (int)Math.Ceiling(rowCount * 1.0 / pageSize); //将数据封装到PagedDataModel分页数据实体中 pagedDataModel = new PagedDataModel <EmsModel.OrderEquipDetail>() { PageCount = pageCount, PagedData = list, PageIndex = pageIndex, PageSize = pageSize, RowCount = rowCount }; //将分页数据实体封装到JSON标准实体中 jsonModel = new JsonModel() { Data = pagedDataModel, Msg = "成功", Status = "ok", BackUrl = "" }; return(jsonModel); } else { jsonModel = new JsonModel() { Status = "no", Msg = "失败" }; return(jsonModel); } }
public bool Lend(string strOrder, string orderNO, EmsModel.OrderInfo mod) { List <EmsModel.OrderEquipDetail> listModer = new List <EmsModel.OrderEquipDetail>(); //"6,9,碳刷,18#6,9,碳刷,20" string[] sArr = strOrder.Split('#'); for (int i = 0; i < sArr.Length; i++) { string[] sArr2 = sArr[i].Split(','); EmsModel.OrderEquipDetail model = new EmsModel.OrderEquipDetail(); model.InventoryKindId = Convert.ToInt32(sArr2[0]); //model.OrderId =Convert.ToInt32( sArr2[1]); model.InstrumentEquip = sArr2[1]; model.EquipDetailName = sArr2[1]; model.EquipId = sArr2[2]; model.Type = 1; listModer.Add(model); } int typeNo = 1; return(dal.UpdateOrderLend(listModer, orderNO, typeNo, 1, mod)); }