protected void btnConfirm_Click(object sender, EventArgs e) { try { IList <InProcessLocation> ipList = this.ucList.PopulateInProcessLocationList(); if (ipList.Count == 0) { ShowErrorMessage("TransportationOrder.Error.DetailEmpty"); return; } TransportationOrder order = TheTransportationOrderMgr.CreateTransportationOrder(this.tbRoute.Text.Trim(), ipList, this.CurrentUser); if (CreateEvent != null) { CreateEvent(order.OrderNo, e); } } catch (BusinessErrorException ex) { this.ShowErrorMessage(ex); } }
protected void lbtnCreate_Click(object sender, EventArgs e) { string code = ((LinkButton)sender).CommandArgument; try { Expense ex = TheExpenseMgr.LoadExpense(code); string s_remark = ex.Remark; string[] remarks = ex.Remark.Split(new char[] { ';' }); ex.Remark = ""; ex.LastModifyUser = this.CurrentUser; ex.LastModifyDate = DateTime.Now; TheExpenseMgr.UpdateExpense(ex); TransportationOrder transportationOrder = TheTransportationOrderMgr.CreateTransportationOrder(code, this.CurrentUser); foreach (string s in remarks) { if (s.Split(new char[] { ':' })[0] == "PriceMethod") { transportationOrder.PricingMethod = s.Split(new char[] { ':' })[1]; } if (s.Split(new char[] { ':' })[0] == "VehicleType") { transportationOrder.VehicleType = s.Split(new char[] { ':' })[1]; } } ex.Remark = ex.Code; ex.Remark += s_remark; TheExpenseMgr.UpdateExpense(ex); transportationOrder.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_COMPLETE; TheTransportationOrderMgr.UpdateTransportationOrder(transportationOrder); ShowSuccessMessage("Transportation.TransportationOrder.AddTransportationOrder.Successfully", transportationOrder.OrderNo); UpdateView(); } catch { ShowErrorMessage("Transportation.TransportationOrder.AddTransportationOrder.Fail"); } }