public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue <string>("orderNum", string.Empty); if (orderNum.IsEmpty()) { return(Redirect("/Move/Product/List")); } Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); if (entity.IsNull()) { return(Redirect("/Move/Product/List")); } ViewBag.Entity = entity; ViewBag.Status = EnumHelper.GetEnumDesc <EAudite>(entity.Status); ViewBag.MoveType = EnumHelper.GetOptions <EMoveType>(entity.MoveType, "请选择移库类型"); ViewBag.ProductType = EnumHelper.GetOptions <EProductType>(entity.ProductType, "请选择入库产品类型"); MoveOrderDetailEntity detail = new MoveOrderDetailEntity(); detail.OrderNum = orderNum; List <MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail); Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = listResult; return(View()); }
/// <summary> /// 新增移库单 /// </summary> /// <returns></returns> public ActionResult Create() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); MoveOrderEntity entity = WebUtil.GetFormObject <MoveOrderEntity>("Entity"); List <MoveOrderDetailEntity> list = WebUtil.GetFormObject <List <MoveOrderDetailEntity> >("List"); entity.SnNum = ConvertHelper.NewGuid(); entity.ProductType = (int)EProductType.Goods; entity.Status = (int)EAudite.Wait; entity.IsDelete = (int)EIsDelete.NotDelete; entity.CreateTime = DateTime.Now; entity.CompanyID = entity.CompanyID.IsEmpty() ? CompanyID : entity.CompanyID; entity.EquipmentNum = ""; entity.EquipmentCode = ""; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); string returnValue = bill.Create(entity, list); DataResult result = new DataResult(); if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue) { result.Code = (int)EResponseCode.Success; result.Message = "移库单创建成功"; } else { result.Code = (int)EResponseCode.Exception; result.Message = "移库单创建失败"; } return(Content(JsonHelper.SerializeObject(result))); }
private static MoveOrder GetEntityByModel(MoveOrderModel model) { if (model == null) { return(null); } MoveOrder entity = new MoveOrder(); if (model.Id == 0) { entity.CreateBy = AuthenticationHelper.UserId; entity.CreateDate = DateTime.Now; entity.CompanyId = AuthenticationHelper.CompanyId.Value; } else { entity.CreateBy = model.CreateBy; entity.CreateDate = model.CreateDate; entity.CompanyId = model.CompanyId; } entity.DateRequired = model.DateRequired; entity.Description = model.Description; entity.Id = model.Id; entity.MoveOrderDate = model.MoveOrderDate; entity.MoveOrderNo = model.MoveOrderNo; entity.SOBId = model.SOBId; entity.UpdateBy = AuthenticationHelper.UserId; entity.UpdateDate = DateTime.Now; return(entity); }
/// <summary> /// 根据条件统计移库单的数据行数 /// </summary> /// <returns></returns> public ActionResult GetCount() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); string OrderNum = WebUtil.GetFormValue <string>("OrderNum"); int MoveType = WebUtil.GetFormValue <int>("MoveType", 0); string ContractOrder = WebUtil.GetFormValue <string>("ContractOrder"); int Status = WebUtil.GetFormValue <int>("Status", 0); string BeginTime = WebUtil.GetFormValue <string>("BeginTime"); string EndTime = WebUtil.GetFormValue <string>("EndTime"); string StorageNum = WebUtil.GetFormValue <string>("StorageNum"); Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); MoveOrderEntity entity = new MoveOrderEntity(); entity.CompanyID = CompanyID; entity.OrderNum = OrderNum; entity.MoveType = MoveType; entity.ContractOrder = ContractOrder; entity.Status = Status; entity.BeginTime = BeginTime; entity.EndTime = EndTime; entity.StorageNum = StorageNum; int Count = bill.GetCount(entity); DataResult <int> dataResult = new DataResult <int>(); dataResult.Code = (int)EResponseCode.Success; dataResult.Message = "响应成功"; dataResult.Result = Count; return(Content(JsonHelper.SerializeObject(dataResult))); }
/// <summary> /// 根据移库单唯一编号删除移库单 /// </summary> /// <returns></returns> public ActionResult DeleteSingle() { string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); string SnNum = WebUtil.GetFormValue <string>("SnNum", string.Empty); MoveOrderEntity entity = new MoveOrderEntity(); entity.SnNum = SnNum; entity.CompanyID = CompanyID; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); string returnValue = bill.Delete(entity); DataResult result = new DataResult(); if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue) { result.Code = (int)EResponseCode.Success; result.Message = "移库单删除成功"; } else { result.Code = (int)EResponseCode.Exception; result.Message = "移库单删除失败"; } return(Content(JsonHelper.SerializeObject(result))); }
/// <summary> /// 设置打印数据 /// </summary> /// <returns></returns> public ActionResult Print() { string SnNum = WebUtil.GetFormValue <string>("SnNum"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); string PrintUser = WebUtil.GetFormValue <string>("PrintUser"); DateTime PrintTime = WebUtil.GetFormValue <DateTime>("PrintTime", DateTime.Now); MoveOrderEntity entity = new MoveOrderEntity(); entity.SnNum = SnNum; entity.CompanyID = CompanyID; entity.PrintUser = PrintUser; entity.PrintTime = PrintTime; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); string returnValue = bill.Print(entity); DataResult result = new DataResult(); if (EnumHelper.GetEnumDesc <EReturnStatus>(EReturnStatus.Success) == returnValue) { result.Code = (int)EResponseCode.Success; result.Message = "打印设置成功"; } else { result.Code = (int)EResponseCode.Exception; result.Message = "打印设置失败"; } return(Content(JsonHelper.SerializeObject(result))); }
public void RefreshOrderList(int a, int b) { if (SelectedShip == null) { return; } List <BaseOrder> orders = new List <BaseOrder>(SelectedShip.GetDataBlob <ShipInfoDB>().Orders); _moveOrderList.Clear(); foreach (BaseOrder order in orders) { string orderDescription = ""; switch (order.OrderType) { case orderType.MOVETO: MoveOrder moveOrder = (MoveOrder)order; orderDescription += "Move to "; orderDescription += moveOrder.Target.GetDataBlob <NameDB>().GetName(_gameVM.CurrentFaction); break; default: break; } _moveOrderList.Add(order, orderDescription); } OnPropertyChanged(nameof(MoveOrderList)); OnPropertyChanged(nameof(MoveOrdersPossible)); }
public ActionResult Edit() { string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty); if (orderNum.IsEmpty()) { return Redirect("/Move/Product/List"); } Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); if (entity.IsNull()) { return Redirect("/Move/Product/List"); } ViewBag.Entity = entity; ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status); ViewBag.MoveType = EnumHelper.GetOptions<EMoveType>(entity.MoveType, "请选择移库类型"); ViewBag.ProductType = EnumHelper.GetOptions<EProductType>(entity.ProductType, "请选择入库产品类型"); MoveOrderDetailEntity detail = new MoveOrderDetailEntity(); detail.OrderNum = orderNum; List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail); Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = listResult; return View(); }
public bool UpdateOrder() { if (currentTargetAsteroid != null) { if (MoveOrder.move(currentTargetAsteroid.transform.position, aiAttributes.AttachedShip.speed, aiAttributes.AttachedShip.rotationSpeed, 0.2f, 2f, aiAttributes.AttachedRigidBody, gameObject)) { if (Time.time >= miningTimer) { miningTimer = Time.time + aiAttributes.miningTime; // Mine more metal, if mined metal does not fit into cargo, return true if (!aiAttributes.AttachedShip.Cargo.AddMetal(currentTargetAsteroid.MineAsteroid(aiAttributes.miningDamage))) { return(true); } // Check if there is enough metal, return true if so if (aiAttributes.AttachedShip.Cargo.CurrentMetal >= aiAttributes.AttachedShip.Cargo.maxMetal * 0.9f) { return(true); } } } } else { // Return true if current asteroid is destroyed return(true); } return(false); }
void PerformedClickOnTerrain(int mouse_button, bool queue_order, ref RaycastHit hit) { if (mouse_button == 1) { if (!queue_order) { orders.Clear(); } MoveOrder move_order = new MoveOrder(stats, transform.position); orders.Add(move_order); move_order.hasStarted = true; seeker.StartPath(transform.position, hit.point, move_order.SetNewPath); } else if (mouse_button == 0) { if (!queue_order) { orders.Clear(); } AttackMoveOrder attack_move_order = new AttackMoveOrder(stats, transform.position, seeker, hit.point, gameObject); attack_move_order.SetProjectilePrefab(projectilePrefab); orders.Add(attack_move_order); } }
public MoveItemsRequest(MoveOrder singleMoveOrder, AlternateDestinationOwner alternateDestination = null) { MoveOrders = new List <MoveOrder>() { singleMoveOrder }; AlternateDestination = alternateDestination; }
public AttackOrder(UnitStatsComponent stats, Vector3 currentPosition, GameObject target, Seeker seeker, GameObject attacker) { this.self = attacker; this.stats = stats; this.currentPosition = currentPosition; this.target = target; this.seeker = seeker; moveOrder = new MoveOrder(stats, currentPosition); }
public string Update(MoveOrder entity) { var originalEntity = this.Context.MoveOrders.Find(entity.Id); this.Context.Entry(originalEntity).CurrentValues.SetValues(entity); this.Context.Entry(originalEntity).State = EntityState.Modified; this.Commit(); return(entity.Id.ToString()); }
public bool UpdateOrder() { if (aiAttributes == null) { aiAttributes = GetComponent <AiAttributes>(); } return(MoveOrder.move(aiAttributes.currentManualTarget, aiAttributes.AttachedShip.speed, aiAttributes.AttachedShip.rotationSpeed, 0.2f, 0.5f, aiAttributes.AttachedRigidBody, gameObject)); }
private void EmitMoveOrder(Agent recipient) { if (true || nbMoveOrderToAgents[recipient.id] <= maxMoveOrdersTogAgent) { Message moveOrder = new MoveOrder(this, recipient); mailBox.post(moveOrder); nbMoveOrderToAgents[recipient.id]++; } waitingForAnAgentToMove = true; }
public AttackMoveOrder(UnitStatsComponent stats, Vector3 currentPosition, Seeker seeker, Vector3 targetPosition, GameObject attacker) { this.self = attacker; // the unit issuing the attack. inherited from Order this.stats = stats; this.currentPosition = currentPosition; this.seeker = seeker; this.targetPosition = targetPosition; attackOrder = new AttackOrder(stats, currentPosition, null, seeker, attacker); moveOrder = new MoveOrder(stats, currentPosition); }
public IHttpActionResult EditMove(MoveOrder moveOrder) { var moveService = new MoveService(); var editMove = moveService.EditMove(moveOrder); var result = new { Count = editMove?"修改成功":"修改失败" }; return(Json(result)); }
public bool UpdateOrder() { if (closestEnemy != null) { return(MoveOrder.move(targetPos, aiAttributes.AttachedShip.speed, aiAttributes.AttachedShip.rotationSpeed, 0.2f, 0.5f, aiAttributes.AttachedRigidBody, gameObject)); } else { return(true); } }
public static MoveOrder Create(string fullPath) { MoveOrder order = new MoveOrder(); string relativeFolder = fullPath.Replace(Directories.CopyToBuildFolder, ""); relativeFolder = ProcessSpecialFolderNames(relativeFolder); order.OriginalFolder = fullPath; order.TargetFolder = $@"{_buildFolder}{relativeFolder}"; return(order); }
public TrailStopOnTick(StrategyHeader strategyHeader, IDataContext tradingData, ILogger logger) : base(tradingData.Get <ObservableCollection <Tick> >()) { this.strategyHeader = strategyHeader; this.tradingData = tradingData; this.logger = logger; this.stopOrder = null; this.moveOrder = null; this.stopPrice = 0; }
public void MoveOrder_IsMoved_test() { DateTime date = DateTime.Now; Order order = new Order(this.signal); double price = 149910; string description = "Текущая цена сдвинулась на 10 пунктов в сторону прибыли."; MoveOrder moveOrder = new MoveOrder(order, price, date, description); moveOrder.MoveDate = DateTime.Now; Assert.IsTrue(moveOrder.IsMoved); }
public ActionResult Delete() { string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); if (!orderNum.IsEmpty()) { Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; string returnValue = bill.Delete(entity); this.ReturnJson.AddProperty("d", returnValue); } return Content(this.ReturnJson.ToString()); }
public ActionResult Delete() { string orderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); if (!orderNum.IsEmpty()) { Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; string returnValue = bill.Delete(entity); this.ReturnJson.AddProperty("d", returnValue); } return(Content(this.ReturnJson.ToString())); }
public MoveOrderModel(MoveOrder entity) { this.CompanyId = entity.CompanyId; this.CreateBy = entity.CreateBy; this.CreateDate = entity.CreateDate; this.DateRequired = entity.DateRequired; this.Description = entity.Description; this.Id = entity.Id; this.MoveOrderDate = entity.MoveOrderDate; this.MoveOrderNo = entity.MoveOrderNo; this.SOBId = entity.SOBId; this.UpdateBy = entity.UpdateBy; this.UpdateDate = entity.UpdateDate; }
public ActionResult Create() { List <MoveOrderDetailEntity> listResult = Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] as List <MoveOrderDetailEntity>; if (listResult.IsNullOrEmpty()) { this.ReturnJson.AddProperty("d", "1006"); return(Content(this.ReturnJson.ToString())); } string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); int MoveType = WebUtil.GetFormValue <int>("MoveType", (int)EMoveType.MoveToBad); int ProductType = WebUtil.GetFormValue <int>("ProductType", (int)EProductType.Goods); string ContractOrder = WebUtil.GetFormValue <string>("ContractOrder", string.Empty); DateTime OrderTime = WebUtil.GetFormValue <DateTime>("OrderTime", DateTime.Now); string Remark = WebUtil.GetFormValue <string>("Remark", string.Empty); MoveOrderEntity badEntity = new MoveOrderEntity(); badEntity.OrderNum = OrderNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(MoveOrderEntity)) : OrderNum; badEntity.MoveType = MoveType; badEntity.ProductType = ProductType; badEntity.ContractOrder = ContractOrder; badEntity.Status = (int)EAudite.Wait; badEntity.Num = 0; badEntity.IsDelete = (int)EIsDelete.NotDelete; badEntity.CreateTime = OrderTime; badEntity.CreateUser = this.LoginUser.UserCode; badEntity.OperateType = (int)EOpType.PC; badEntity.EquipmentNum = string.Empty; badEntity.EquipmentCode = string.Empty; badEntity.Remark = Remark; badEntity.Num = listResult.Sum(a => a.Num); badEntity.Amout = listResult.Sum(a => a.Amout); badEntity.StorageNum = this.DefaultStore; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); if (OrderNum.IsEmpty()) { string returnValue = bill.Create(badEntity, listResult); this.ReturnJson.AddProperty("d", returnValue); Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = null; } else { string returnValue = bill.EditOrder(badEntity, listResult); this.ReturnJson.AddProperty("d", returnValue); } return(Content(this.ReturnJson.ToString())); }
public ActionResult DeleteBatch([ModelBinder(typeof(JsonBinder <List <string> >))] List <string> list) { if (!list.IsNullOrEmpty()) { foreach (string orderNum in list) { Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; string returnValue = bill.Delete(entity); this.ReturnJson.AddProperty("d", returnValue); } } return(Content(this.ReturnJson.ToString())); }
public ActionResult DeleteBatch([ModelBinder(typeof(JsonBinder<List<string>>))] List<string> list) { if (!list.IsNullOrEmpty()) { foreach (string orderNum in list) { Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; string returnValue = bill.Delete(entity); this.ReturnJson.AddProperty("d", returnValue); } } return Content(this.ReturnJson.ToString()); }
//Client-only version public Response GenerateNonValidResponse(Order O) { //Temp if (O is MoveOrder) { MoveOrder MO = (MoveOrder)O; return(new MoveResponse(O.TargetID, new Vector3(MO.TarX, MO.TarY, MO.TarZ), CommandType.Movement)); } else if (O is AttackOrder) { AttackOrder AO = (AttackOrder)O; return(new DamageResponse(O.TargetID, AO.HPChange, CommandType.TargetAbility)); } throw new InvalidOperationException(); }
/// <summary> /// 查询移库单打印数据源 /// </summary> /// <returns></returns> public ActionResult GetPrint() { string SnNum = WebUtil.GetFormValue <string>("SnNum"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID"); Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); DataSet ds = bill.GetPrint(SnNum); DataResult <DataSet> dataResult = new DataResult <DataSet>(); dataResult.Code = (int)EResponseCode.Success; dataResult.Message = "响应成功"; dataResult.Result = ds; return(Content(JsonHelper.SerializeObject(dataResult))); }
public ActionResult GetList() { int Status = WebUtil.GetFormValue <int>("Status", 0); string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); string BadType = WebUtil.GetFormValue <string>("BadType", string.Empty); string ProductType = WebUtil.GetFormValue <string>("ProductType", string.Empty); string beginTime = WebUtil.GetFormValue <string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue <string>("endTime", string.Empty); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; MoveOrderEntity entity = new MoveOrderEntity(); if (Status > 0) { entity.Where(a => a.Status == Status); } if (!OrderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%"); } if (!ProductType.IsEmpty()) { entity.Where("ProductType", ECondition.Eth, ProductType); } if (!BadType.IsEmpty()) { entity.Where("BadType", ECondition.Eth, BadType); } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType <DateTime>(beginTime), ConvertHelper.ToType <DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); List <MoveOrderEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult == null ? new List <MoveOrderEntity>() : listResult; string json = ConvertJson.ListToJson <MoveOrderEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult Create() { List<MoveOrderDetailEntity> listResult = Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] as List<MoveOrderDetailEntity>; if (listResult.IsNullOrEmpty()) { this.ReturnJson.AddProperty("d", "1006"); return Content(this.ReturnJson.ToString()); } string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); int MoveType = WebUtil.GetFormValue<int>("MoveType", (int)EMoveType.MoveToBad); int ProductType = WebUtil.GetFormValue<int>("ProductType", (int)EProductType.Goods); string ContractOrder = WebUtil.GetFormValue<string>("ContractOrder", string.Empty); DateTime OrderTime = WebUtil.GetFormValue<DateTime>("OrderTime", DateTime.Now); string Remark = WebUtil.GetFormValue<string>("Remark", string.Empty); MoveOrderEntity badEntity = new MoveOrderEntity(); badEntity.OrderNum = OrderNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(MoveOrderEntity)) : OrderNum; badEntity.MoveType = MoveType; badEntity.ProductType = ProductType; badEntity.ContractOrder = ContractOrder; badEntity.Status = (int)EAudite.Wait; badEntity.Num = 0; badEntity.IsDelete = (int)EIsDelete.NotDelete; badEntity.CreateTime = OrderTime; badEntity.CreateUser = this.LoginUser.UserCode; badEntity.OperateType = (int)EOpType.PC; badEntity.EquipmentNum = string.Empty; badEntity.EquipmentCode = string.Empty; badEntity.Remark = Remark; badEntity.Num = listResult.Sum(a=>a.Num); badEntity.Amout = listResult.Sum(a => a.Amout); badEntity.StorageNum = this.DefaultStore; Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); if (OrderNum.IsEmpty()) { string returnValue = bill.Create(badEntity, listResult); this.ReturnJson.AddProperty("d", returnValue); Session[CacheKey.TEMPDATA_CACHE_MOVERODUCTDETAIL] = null; } else { string returnValue = bill.EditOrder(badEntity, listResult); this.ReturnJson.AddProperty("d", returnValue); } return Content(this.ReturnJson.ToString()); }
/// <summary> /// 审核移库单 /// </summary> /// <returns></returns> public ActionResult Audite() { string SnNum = WebUtil.GetFormValue <string>("SnNum"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); int Status = WebUtil.GetFormValue <int>("Status", (int)EAudite.NotPass); string AuditUser = WebUtil.GetFormValue <string>("AuditUser", string.Empty); string Reason = WebUtil.GetFormValue <string>("Reason", string.Empty); int OperateType = WebUtil.GetFormValue <int>("OperateType", 0); string EquipmentNum = WebUtil.GetFormValue <string>("EquipmentNum"); string EquipmentCode = WebUtil.GetFormValue <string>("EquipmentCode"); string Remark = WebUtil.GetFormValue <string>("Remark"); MoveOrderEntity entity = new MoveOrderEntity(); entity.SnNum = SnNum; entity.CompanyID = CompanyID; entity.Status = Status; entity.AuditUser = AuditUser; entity.Reason = Reason; entity.OperateType = OperateType; entity.EquipmentNum = EquipmentNum; entity.EquipmentCode = EquipmentCode; entity.Remark = Remark; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); string returnValue = bill.Audite(entity); DataResult result = new DataResult(); if ("1000" == returnValue) { result.Code = (int)EResponseCode.Success; result.Message = "操作成功"; } else if ("1001" == returnValue) { result.Code = (int)EResponseCode.Exception; result.Message = "移库单不存在"; } else if ("1002" == returnValue) { result.Code = (int)EResponseCode.Exception; result.Message = "移库单已经审核"; } return(Content(JsonHelper.SerializeObject(result))); }
/// <summary> /// 查询移库单详细 /// </summary> /// <returns></returns> public ActionResult GetDetail() { string SnNum = WebUtil.GetFormValue <string>("SnNum"); string CompanyID = WebUtil.GetFormValue <string>("CompanyID", string.Empty); MoveOrderDetailEntity entity = new MoveOrderDetailEntity(); entity.OrderSnNum = SnNum; entity.CompanyID = CompanyID; Bill <MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(CompanyID); List <MoveOrderDetailEntity> list = bill.GetOrderDetail(entity); DataResult <List <MoveOrderDetailEntity> > dataResult = new DataResult <List <MoveOrderDetailEntity> >(); dataResult.Code = (int)EResponseCode.Success; dataResult.Message = "响应成功"; dataResult.Result = list; return(Content(JsonHelper.SerializeObject(dataResult))); }
public void MoveObject(MoveOrder order) { if (ucConditionTypeElementObjectActivated == null) { return; } Objects.ConditionTypeElement tempConditionTypeElement = ucConditionTypeElementObjectActivated.ConditionTypeElement.Clone(); ucConditionTypeElementObject tempUc = null; if (order == MoveOrder.Up) { if (ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId == 0) { return; } tempUc = FindUcByConditionSortID(ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId - 1); ucConditionTypeElementObjectActivated.ConditionTypeElement = tempUc.ConditionTypeElement.Clone(); tempUc.ConditionTypeElement = tempConditionTypeElement; ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId += 1; tempUc.ConditionTypeElement.SortId -= 1; } else if (order == MoveOrder.Down) { if (ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId == ucConditionTypeElementObjectControls.Count - 1) { return; } tempUc = FindUcByConditionSortID(ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId + 1); ucConditionTypeElementObjectActivated.ConditionTypeElement = tempUc.ConditionTypeElement.Clone(); tempUc.ConditionTypeElement = tempConditionTypeElement; ucConditionTypeElementObjectActivated.ConditionTypeElement.SortId -= 1; tempUc.ConditionTypeElement.SortId += 1; } if (tempUc == null) { return; } ucConditionTypeElementObjectControls.Remove(ucConditionTypeElementObjectActivated.ConditionTypeElement.ID); ucConditionTypeElementObjectControls.Add(ucConditionTypeElementObjectActivated.ConditionTypeElement.ID, ucConditionTypeElementObjectActivated); ucConditionTypeElementObjectControls.Remove(tempUc.ConditionTypeElement.ID); ucConditionTypeElementObjectControls.Add(tempUc.ConditionTypeElement.ID, tempUc); tempUc.Activate = true; pnlConditionTypeElements.ScrollControlIntoView(tempUc); }
public ActionResult Audit() { string orderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); int status = WebUtil.GetFormValue<int>("Status", 0); string reason = WebUtil.GetFormValue<string>("Reason", string.Empty); MoveOrderEntity entity = new MoveOrderEntity(); entity.Status = status; entity.OrderNum = orderNum; entity.AuditUser = this.LoginUserCode; entity.OperateType = (int)EOpType.PC; entity.EquipmentCode = string.Empty; entity.EquipmentNum = string.Empty; entity.Remark = string.Empty; entity.Reason = reason; Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); string returnValue = bill.Audite(entity); this.ReturnJson.AddProperty("d", returnValue); return Content(this.ReturnJson.ToString()); }
public ActionResult Detail() { string orderNum = WebUtil.GetQueryStringValue<string>("orderNum", string.Empty); string flag = WebUtil.GetQueryStringValue<string>("flag", string.Empty); Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); MoveOrderEntity entity = new MoveOrderEntity(); entity.OrderNum = orderNum; entity = bill.GetOrder(entity); entity = entity.IsNull() ? new MoveOrderEntity() : entity; ViewBag.BadReport = entity; ViewBag.Status = EnumHelper.GetEnumDesc<EAudite>(entity.Status); MoveOrderDetailEntity detail = new MoveOrderDetailEntity(); detail.OrderNum = orderNum; List<MoveOrderDetailEntity> listResult = bill.GetOrderDetail(detail); listResult = listResult.IsNull() ? new List<MoveOrderDetailEntity>() : listResult; ViewBag.Detail = listResult; ViewBag.Flag = flag; return View(); }
public ActionResult ToExcel() { int Status = WebUtil.GetFormValue<int>("Status", 0); string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); string BadType = WebUtil.GetFormValue<string>("BadType", string.Empty); string ProductType = WebUtil.GetFormValue<string>("ProductType", string.Empty); string beginTime = WebUtil.GetFormValue<string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue<string>("endTime", string.Empty); PageInfo pageInfo = new PageInfo() { PageIndex = 1, PageSize = int.MaxValue }; MoveOrderEntity entity = new MoveOrderEntity(); if (Status > 0) { entity.Where(a => a.Status == Status); } if (!OrderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%"); } if (!ProductType.IsEmpty()) { entity.Where("ProductType", ECondition.Eth, ProductType); } if (!BadType.IsEmpty()) { entity.Where("BadType", ECondition.Eth, BadType); } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime), ConvertHelper.ToType<DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); List<MoveOrderEntity> listResult = bill.GetList(entity, ref pageInfo); if (!listResult.IsNullOrEmpty()) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("序号 ")); dt.Columns.Add(new DataColumn("移库单编号 ")); dt.Columns.Add(new DataColumn("移库类型")); dt.Columns.Add(new DataColumn("关联单号")); dt.Columns.Add(new DataColumn("移库总数")); dt.Columns.Add(new DataColumn("移库人")); dt.Columns.Add(new DataColumn("状态")); dt.Columns.Add(new DataColumn("创建时间")); int count = 1; foreach (MoveOrderEntity t in listResult) { DataRow row = dt.NewRow(); row[0] = count; row[1] = t.OrderNum; row[2] = EnumHelper.GetEnumDesc<EMoveType>(t.MoveType); row[3] = t.ContractOrder; row[4] = t.Num; row[5] = t.CreateUserName; row[6] = EnumHelper.GetEnumDesc<EAudite>(t.Status); row[7] = t.CreateTime.ToString("yyyy-MM-dd"); dt.Rows.Add(row); count++; } string filePath = Server.MapPath("~/UploadFiles/"); if (!System.IO.Directory.Exists(filePath)) { System.IO.Directory.CreateDirectory(filePath); } string filename = string.Format("移库管理{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss")); NPOIExcel excel = new NPOIExcel("移库管理", "移库单", System.IO.Path.Combine(filePath, filename)); excel.ToExcel(dt); this.ReturnJson.AddProperty("Path", ("/UploadFiles/" + filename).Escape()); } else { this.ReturnJson.AddProperty("d", "无数据导出!"); } return Content(this.ReturnJson.ToString()); }
public ActionResult GetList() { int Status = WebUtil.GetFormValue<int>("Status", 0); string OrderNum = WebUtil.GetFormValue<string>("OrderNum", string.Empty); string BadType = WebUtil.GetFormValue<string>("BadType", string.Empty); string ProductType = WebUtil.GetFormValue<string>("ProductType", string.Empty); string beginTime = WebUtil.GetFormValue<string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue<string>("endTime", string.Empty); int pageSize = WebUtil.GetFormValue<int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue<int>("PageIndex", 1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; MoveOrderEntity entity = new MoveOrderEntity(); if (Status > 0) { entity.Where(a => a.Status == Status); } if (!OrderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%"); } if (!ProductType.IsEmpty()) { entity.Where("ProductType", ECondition.Eth, ProductType); } if (!BadType.IsEmpty()) { entity.Where("BadType", ECondition.Eth, BadType); } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType<DateTime>(beginTime), ConvertHelper.ToType<DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); Bill<MoveOrderEntity, MoveOrderDetailEntity> bill = new MoveOrder(); List<MoveOrderEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult == null ? new List<MoveOrderEntity>() : listResult; string json = ConvertJson.ListToJson<MoveOrderEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return Content(this.ReturnJson.ToString()); }
public MoveItemsRequest(MoveOrder singleMoveOrder, AlternateDestinationOwner alternateDestination = null) { MoveOrders = new List<MoveOrder>() { singleMoveOrder }; AlternateDestination = alternateDestination; }
public void setMoveOrder(MoveOrder moveOrder) { this.moveOrder = moveOrder; }