public async Task <IActionResult> Edit(string id, [Bind("transferInId,transferOrderId,transferInNumber,transferInDate,description,branchIdFrom,warehouseIdFrom,branchIdTo,warehouseIdTo,HasChild,createdAt")] TransferIn transferIn) { if (id != transferIn.transferInId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(transferIn); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransferInExists(transferIn.transferInId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["transferOrderId"] = new SelectList(_context.TransferOrder, "transferOrderId", "transferOrderNumber", transferIn.transferOrderId); ViewData["branchIdFrom"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdFrom"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); ViewData["branchIdTo"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdTo"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); return(View(transferIn)); }
private void LoadRecord() { Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferinid"], Session.SessionID)); TransferIn clsTransferIn = new TransferIn(); TransferInDetails clsDetails = clsTransferIn.Details(iID); clsTransferIn.CommitAndDispose(); lblTransferInID.Text = clsDetails.TransferInID.ToString(); lblTransferInNo.Text = clsDetails.TransferInNo; lblTransferInDate.Text = clsDetails.TransferInDate.ToString("yyyy-MM-dd HH:mm:ss"); txtRequiredDeliveryDate.Text = clsDetails.RequiredDeliveryDate.ToString("yyyy-MM-dd"); cboSupplier.SelectedIndex = cboSupplier.Items.IndexOf(cboSupplier.Items.FindByValue(clsDetails.SupplierID.ToString())); txtSupplierContact.Text = clsDetails.SupplierContact; txtSupplierTelephoneNo.Text = clsDetails.SupplierTelephoneNo; lblTerms.Text = clsDetails.SupplierTerms.ToString("##0"); switch (clsDetails.SupplierModeOfTerms) { case 0: lblModeOfterms.Text = "Days"; break; case 1: lblModeOfterms.Text = "Months"; break; case 2: lblModeOfterms.Text = "Years"; break; } txtSupplierAddress.Text = clsDetails.SupplierAddress; cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(clsDetails.BranchID.ToString())); txtBranchAddress.Text = clsDetails.BranchAddress; txtRemarks.Text = clsDetails.Remarks; }
public HttpResponseMessage GetTransferOut([FromBody] int LocationId) { List <TransferOut> TransferOuts = TransferIn.GetDetailsFromTransferOut(LocationId).Where(x => x.Status == 0).ToList(); TransferOuts.ForEach(x => x.Products.RemoveAll(y => y.Status != 0)); return(Request.CreateResponse(HttpStatusCode.OK, TransferOuts)); }
public async Task <IActionResult> Create([Bind("transferInId,transferOrderId,transferInNumber,transferInDate,description,branchIdFrom,warehouseIdFrom,branchIdTo,warehouseIdTo,HasChild,createdAt")] TransferIn transferIn) { if (ModelState.IsValid) { //check transfer order TransferIn check = await _context.TransferIn.SingleOrDefaultAsync(x => x.transferOrderId.Equals(transferIn.transferOrderId)); if (check != null) { ViewData["StatusMessage"] = "Error. Transfer order already received. " + check.transferInNumber; ViewData["transferOrderId"] = new SelectList(_context.TransferOrder, "transferOrderId", "transferOrderNumber"); ViewData["branchIdFrom"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdFrom"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); ViewData["branchIdTo"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdTo"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); return(View(transferIn)); } TransferOrder to = await _context.TransferOrder.Where(x => x.transferOrderId.Equals(transferIn.transferOrderId)).FirstOrDefaultAsync(); transferIn.warehouseIdFrom = to.warehouseIdFrom; transferIn.warehouseIdTo = to.warehouseIdTo; transferIn.warehouseFrom = await _context.Warehouse.Include(x => x.branch).SingleOrDefaultAsync(x => x.warehouseId.Equals(transferIn.warehouseIdFrom)); transferIn.branchFrom = transferIn.warehouseFrom.branch; transferIn.warehouseTo = await _context.Warehouse.Include(x => x.branch).SingleOrDefaultAsync(x => x.warehouseId.Equals(transferIn.warehouseIdTo)); transferIn.branchTo = transferIn.warehouseTo.branch; to.isReceived = true; to.transferOrderStatus = TransferOrderStatus.Completed; _context.Add(transferIn); await _context.SaveChangesAsync(); //auto create transfer in line, full shipment List <TransferOrderLine> lines = new List <TransferOrderLine>(); lines = _context.TransferOrderLine.Include(x => x.product).Where(x => x.transferOrderId.Equals(transferIn.transferOrderId)).ToList(); foreach (var item in lines) { TransferInLine line = new TransferInLine(); line.transferIn = transferIn; line.product = item.product; line.qty = item.qty; line.qtyInventory = line.qty * 1; _context.TransferInLine.Add(line); await _context.SaveChangesAsync(); } return(RedirectToAction(nameof(Details), new { id = transferIn.transferInId })); } ViewData["transferOrderId"] = new SelectList(_context.TransferOrder, "transferOrderId", "transferOrderNumber", transferIn.transferOrderId); return(View(transferIn)); }
public void Handle(ICommandContext context, TransferIn command) { var sourceAccount = context.Get <BankAccount>(command.TransferInfo.SourceAccountId); var targetAccount = context.Get <BankAccount>(command.TransferInfo.TargetAccountId); targetAccount.TransferIn(sourceAccount, command.ProcessId, command.TransferInfo); }
public HttpResponseMessage Delete([FromUri] int Id, [FromBody] int modifiedBy) { TransferIn tr = new TransferIn(); tr.ID = Id; tr.ModifiedBy = modifiedBy; return(Request.CreateResponse(HttpStatusCode.OK, tr.Delete())); }
private void SetDataSource(ReportDocument Report) { long iID = 0; try { if (Request.QueryString["task"].ToString().ToLower() == "reportfromposted" && Request.QueryString["transferinid"].ToString() != null) { iID = Convert.ToInt64(Request.QueryString["transferinid"].ToString()); } else { iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferinid"].ToString(), Session.SessionID)); } } catch { iID = Convert.ToInt64(Common.Decrypt(lblReferrer.Text.Substring(lblReferrer.Text.IndexOf("transferinid") + 13), Session.SessionID)); } ReportDataset rptds = new ReportDataset(); TransferIn clsTransferIn = new TransferIn(); MySqlDataReader myreader = clsTransferIn.List(iID, "TransferInID", SortOption.Ascending); while (myreader.Read()) { DataRow drNew = rptds.TransferIn.NewRow(); foreach (DataColumn dc in rptds.TransferIn.Columns) { drNew[dc] = "" + myreader[dc.ColumnName]; } rptds.TransferIn.Rows.Add(drNew); } myreader.Close(); TransferInItem clsTransferInItem = new TransferInItem(clsTransferIn.Connection, clsTransferIn.Transaction); MySqlDataReader myreaderitems = clsTransferInItem.List(iID, "TransferInItemID", SortOption.Ascending); while (myreaderitems.Read()) { DataRow drNew = rptds.TransferInItems.NewRow(); foreach (DataColumn dc in rptds.TransferInItems.Columns) { drNew[dc] = "" + myreaderitems[dc.ColumnName]; } rptds.TransferInItems.Rows.Add(drNew); } myreaderitems.Close(); clsTransferIn.CommitAndDispose(); Report.SetDataSource(rptds); SetParameters(Report); }
// GET: TransferIn/Create public IActionResult Create() { ViewData["transferOrderId"] = new SelectList(_context.TransferOrder.Where(x => x.transferOrderStatus == TransferOrderStatus.Open && x.isIssued == true).ToList(), "transferOrderId", "transferOrderNumber"); ViewData["branchIdFrom"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdFrom"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); ViewData["branchIdTo"] = new SelectList(_context.Branch, "branchId", "branchName"); ViewData["warehouseIdTo"] = new SelectList(_context.Warehouse, "warehouseId", "warehouseName"); TransferIn obj = new TransferIn(); return(View(obj)); }
public async Task <IActionResult> PrintTransferIn(string id) { TransferIn obj = await _context.TransferIn .Include(x => x.transferOrder) .Include(x => x.warehouseFrom) .Include(x => x.warehouseTo) .Include(x => x.transferInLine).ThenInclude(x => x.product) .SingleOrDefaultAsync(x => x.transferInId.Equals(id)); return(View(obj)); }
private void CancelTransferIn() { long TransferInID = Convert.ToInt64(lblTransferInID.Text); string Remarks = txtRemarks.Text; TransferIn clsTransferIn = new TransferIn(); clsTransferIn.Cancel(TransferInID, DateTime.Now, Remarks, Convert.ToInt64(Session["UID"].ToString())); clsTransferIn.CommitAndDispose(); Response.Redirect("Default.aspx?task=" + Common.Encrypt("list", Session.SessionID)); }
private void LoadRecord() { Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferinid"], Session.SessionID)); TransferIn clsTransferIn = new TransferIn(); TransferInDetails clsDetails = clsTransferIn.Details(iID); clsTransferIn.CommitAndDispose(); lblTransferInID.Text = clsDetails.TransferInID.ToString(); lblTransferInNo.Text = clsDetails.TransferInNo; lblTransferInDate.Text = clsDetails.TransferInDate.ToString("yyyy-MM-dd HH:mm:ss"); lblRequiredDeliveryDate.Text = clsDetails.RequiredDeliveryDate.ToString("yyyy-MM-dd"); lblSupplierID.Text = clsDetails.SupplierID.ToString(); lblSupplierCode.Text = clsDetails.SupplierCode.ToString(); string stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(clsDetails.SupplierID.ToString(), Session.SessionID); lblSupplierCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/PurchasesAndPayables/_Vendor/Default.aspx" + stParam; lblSupplierContact.Text = clsDetails.SupplierContact; lblSupplierTelephoneNo.Text = clsDetails.SupplierTelephoneNo; lblTerms.Text = clsDetails.SupplierTerms.ToString("##0"); switch (clsDetails.SupplierModeOfTerms) { case 0: lblModeOfterms.Text = "Days"; break; case 1: lblModeOfterms.Text = "Months"; break; case 2: lblModeOfterms.Text = "Years"; break; } lblSupplierAddress.Text = clsDetails.SupplierAddress; lblBranchID.Text = clsDetails.BranchID.ToString(); lblBranchCode.Text = clsDetails.BranchCode; lblBranchAddress.Text = clsDetails.BranchAddress; lblTransferInRemarks.Text = clsDetails.Remarks; txtTransferInDiscountApplied.Text = clsDetails.DiscountApplied.ToString("###0.#0"); cboTransferInDiscountType.SelectedIndex = cboTransferInDiscountType.Items.IndexOf(cboTransferInDiscountType.Items.FindByValue(clsDetails.DiscountType.ToString("d"))); lblTransferInDiscount.Text = clsDetails.Discount.ToString("#,##0.#0"); lblTransferInVatableAmount.Text = clsDetails.VatableAmount.ToString("#,##0.#0"); txtTransferInFreight.Text = clsDetails.Freight.ToString("#,##0.#0"); txtTransferInDeposit.Text = clsDetails.Deposit.ToString("#,##0.#0"); lblTransferInSubTotal.Text = Convert.ToDecimal(clsDetails.SubTotal - clsDetails.VAT + clsDetails.Freight - clsDetails.Deposit).ToString("#,##0.#0"); lblTransferInVAT.Text = clsDetails.VAT.ToString("#,##0.#0"); lblTransferInTotal.Text = clsDetails.SubTotal.ToString("#,##0.#0"); }
private Int64 SaveRecord() { TransferIn clsTransferIn = new TransferIn(); clsTransferIn.GetConnection(); lblTransferInNo.Text = Constants.TRANSFER_IN_CODE + CompanyDetails.BECompanyCode + DateTime.Now.Year.ToString() + clsTransferIn.LastTransactionNo(); TransferInDetails clsDetails = new TransferInDetails(); clsDetails.TransferInNo = lblTransferInNo.Text; clsDetails.TransferInDate = Convert.ToDateTime(lblTransferInDate.Text); clsDetails.SupplierID = Convert.ToInt64(cboSupplier.SelectedItem.Value); clsDetails.SupplierCode = cboSupplier.SelectedItem.Text; clsDetails.SupplierContact = txtSupplierContact.Text; clsDetails.SupplierAddress = txtSupplierAddress.Text; clsDetails.SupplierTelephoneNo = txtSupplierTelephoneNo.Text; clsDetails.SupplierTerms = Convert.ToInt32(lblTerms.Text); switch (lblModeOfterms.Text) { case "Days": clsDetails.SupplierModeOfTerms = 0; break; case "Months": clsDetails.SupplierModeOfTerms = 1; break; case "Years": clsDetails.SupplierModeOfTerms = 2; break; } clsDetails.RequiredDeliveryDate = Convert.ToDateTime(txtRequiredDeliveryDate.Text); clsDetails.BranchID = Convert.ToInt16(cboBranch.SelectedItem.Value); clsDetails.TransferrerID = Convert.ToInt64(Session["UID"].ToString()); clsDetails.TransferrerName = Session["Name"].ToString(); clsDetails.Status = TransferInStatus.Open; clsDetails.Remarks = txtRemarks.Text; Int64 id = clsTransferIn.Insert(clsDetails); clsTransferIn.CommitAndDispose(); return(id); }
private void SaveRecord() { TransferInDetails clsDetails = new TransferInDetails(); clsDetails.TransferInID = Convert.ToInt64(lblTransferInID.Text); clsDetails.TransferInNo = lblTransferInNo.Text; clsDetails.TransferInDate = Convert.ToDateTime(lblTransferInDate.Text); clsDetails.SupplierID = Convert.ToInt64(cboSupplier.SelectedItem.Value); clsDetails.SupplierCode = cboSupplier.SelectedItem.Text; clsDetails.SupplierContact = txtSupplierContact.Text; clsDetails.SupplierAddress = txtSupplierAddress.Text; clsDetails.SupplierTelephoneNo = txtSupplierTelephoneNo.Text; switch (lblModeOfterms.Text) { case "Days": clsDetails.SupplierModeOfTerms = 0; break; case "Months": clsDetails.SupplierModeOfTerms = 1; break; case "Years": clsDetails.SupplierModeOfTerms = 2; break; } clsDetails.RequiredDeliveryDate = Convert.ToDateTime(txtRequiredDeliveryDate.Text); clsDetails.BranchID = Convert.ToInt16(cboBranch.SelectedItem.Value); clsDetails.TransferrerID = Convert.ToInt64(Session["UID"].ToString()); clsDetails.TransferrerName = Session["Name"].ToString(); clsDetails.Status = TransferInStatus.Open; clsDetails.Remarks = txtRemarks.Text; TransferIn clsTransferIn = new TransferIn(); clsTransferIn.Update(clsDetails); clsTransferIn.CommitAndDispose(); }
public void Update(TransferInItemDetails Details) { try { string SQL = "UPDATE tblTransferInItems SET " + "TransferInID = @TransferInID, "+ "ProductID = @ProductID, "+ "ProductCode = @ProductCode, "+ "BarCode = @BarCode, "+ "Description = @Description, "+ "ProductUnitID = @ProductUnitID, "+ "ProductUnitCode = @ProductUnitCode, "+ "Quantity = @Quantity, "+ "OriginalQuantity = @Quantity, " + "UnitCost = @UnitCost, "+ "Discount = @Discount, "+ "DiscountApplied = @DiscountApplied, "+ "DiscountType = @DiscountType, "+ "Amount = @Amount, "+ "VAT = @VAT, "+ "VatableAmount = @VatableAmount, "+ "EVAT = @EVAT, "+ "EVatableAmount = @EVatableAmount, "+ "LocalTax = @LocalTax, "+ "isVATInclusive = @isVATInclusive, "+ "VariationMatrixID = @VariationMatrixID, "+ "MatrixDescription = @MatrixDescription, "+ "ProductGroup = @ProductGroup, "+ "ProductSubGroup = @ProductSubGroup, "+ "TransferInItemStatus = @TransferInItemStatus, "+ "IsVatable = @IsVatable, "+ "Remarks = @Remarks, "+ "ChartOfAccountIDTransferIn = (SELECT ChartOfAccountIDTransferIn FROM tblProducts WHERE ProductID = @ProductID), " + "ChartOfAccountIDTaxTransferIn = (SELECT ChartOfAccountIDTaxTransferIn FROM tblProducts WHERE ProductID = @ProductID), " + "ChartOfAccountIDInventory = (SELECT ChartOfAccountIDInventory FROM tblProducts WHERE ProductID = @ProductID), " + "SellingPrice = @SellingPrice, "+ "SellingVAT = @SellingVAT, "+ "SellingEVAT = @SellingEVAT, "+ "SellingLocalTax = @SellingLocalTax, "+ "OldSellingPrice = @OldSellingPrice "+ "WHERE TransferInItemID = @TransferInItemID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInID = new MySqlParameter("@TransferInID", MySqlDbType.Int64); prmTransferInID.Value = Details.TransferInID; cmd.Parameters.Add(prmTransferInID); MySqlParameter prmProductID = new MySqlParameter("@ProductID", MySqlDbType.Int64); prmProductID.Value = Details.ProductID; cmd.Parameters.Add(prmProductID); MySqlParameter prmProductCode = new MySqlParameter("@ProductCode", MySqlDbType.String); prmProductCode.Value = Details.ProductCode; cmd.Parameters.Add(prmProductCode); MySqlParameter prmBarCode = new MySqlParameter("@BarCode", MySqlDbType.String); prmBarCode.Value = Details.BarCode; cmd.Parameters.Add(prmBarCode); MySqlParameter prmDescription = new MySqlParameter("@Description", MySqlDbType.String); prmDescription.Value = Details.Description; cmd.Parameters.Add(prmDescription); MySqlParameter prmProductUnitID = new MySqlParameter("@ProductUnitID", MySqlDbType.Int16); prmProductUnitID.Value = Details.ProductUnitID; cmd.Parameters.Add(prmProductUnitID); MySqlParameter prmProductUnitCode = new MySqlParameter("@ProductUnitCode", MySqlDbType.String); prmProductUnitCode.Value = Details.ProductUnitCode; cmd.Parameters.Add(prmProductUnitCode); MySqlParameter prmQuantity = new MySqlParameter("@Quantity", MySqlDbType.Decimal); prmQuantity.Value = Details.Quantity; cmd.Parameters.Add(prmQuantity); MySqlParameter prmUnitCost = new MySqlParameter("@UnitCost", MySqlDbType.Decimal); prmUnitCost.Value = Details.UnitCost; cmd.Parameters.Add(prmUnitCost); MySqlParameter prmDiscount = new MySqlParameter("@Discount", MySqlDbType.Decimal); prmDiscount.Value = Details.Discount; cmd.Parameters.Add(prmDiscount); MySqlParameter prmDiscountApplied = new MySqlParameter("@DiscountApplied", MySqlDbType.Decimal); prmDiscountApplied.Value = Details.DiscountApplied; cmd.Parameters.Add(prmDiscountApplied); MySqlParameter prmDiscountType = new MySqlParameter("@DiscountType", MySqlDbType.Int16); prmDiscountType.Value = (int)Details.DiscountType; cmd.Parameters.Add(prmDiscountType); MySqlParameter prmAmount = new MySqlParameter("@Amount", MySqlDbType.Decimal); prmAmount.Value = Details.Amount; cmd.Parameters.Add(prmAmount); MySqlParameter prmVAT = new MySqlParameter("@VAT", MySqlDbType.Decimal); prmVAT.Value = Details.VAT; cmd.Parameters.Add(prmVAT); MySqlParameter prmVatableAmount = new MySqlParameter("@VatableAmount", MySqlDbType.Decimal); prmVatableAmount.Value = Details.VatableAmount; cmd.Parameters.Add(prmVatableAmount); MySqlParameter prmEVAT = new MySqlParameter("@EVAT", MySqlDbType.Decimal); prmEVAT.Value = Details.EVAT; cmd.Parameters.Add(prmEVAT); MySqlParameter prmEVatableAmount = new MySqlParameter("@EVatableAmount", MySqlDbType.Decimal); prmEVatableAmount.Value = Details.EVatableAmount; cmd.Parameters.Add(prmEVatableAmount); MySqlParameter prmLocalTax = new MySqlParameter("@LocalTax", MySqlDbType.Decimal); prmLocalTax.Value = Details.LocalTax; cmd.Parameters.Add(prmLocalTax); MySqlParameter prmisVATInclusive = new MySqlParameter("@isVATInclusive", MySqlDbType.Int16); prmisVATInclusive.Value = Convert.ToInt16(Details.isVATInclusive); cmd.Parameters.Add(prmisVATInclusive); MySqlParameter prmVariationMatrixID = new MySqlParameter("@VariationMatrixID", MySqlDbType.Int64); prmVariationMatrixID.Value = Details.VariationMatrixID; cmd.Parameters.Add(prmVariationMatrixID); MySqlParameter prmMatrixDescription = new MySqlParameter("@MatrixDescription", MySqlDbType.String); prmMatrixDescription.Value = Details.MatrixDescription; cmd.Parameters.Add(prmMatrixDescription); MySqlParameter prmProductGroup = new MySqlParameter("@ProductGroup", MySqlDbType.String); prmProductGroup.Value = Details.ProductGroup; cmd.Parameters.Add(prmProductGroup); cmd.Parameters.AddWithValue("@ProductSubGroup", Details.ProductSubGroup); cmd.Parameters.AddWithValue("@TransferInItemStatus", Details.TransferInItemStatus.ToString("d")); cmd.Parameters.AddWithValue("@IsVatable", Convert.ToInt16(Details.IsVatable)); cmd.Parameters.AddWithValue("@Remarks", Details.Remarks); cmd.Parameters.AddWithValue("@SellingPrice", Details.SellingPrice); cmd.Parameters.AddWithValue("@SellingVAT", Details.SellingVAT); cmd.Parameters.AddWithValue("@SellingEVAT", Details.SellingEVAT); cmd.Parameters.AddWithValue("@SellingLocalTax", Details.SellingLocalTax); cmd.Parameters.AddWithValue("@OldSellingPrice", Details.OldSellingPrice); cmd.Parameters.AddWithValue("@TransferInItemID", Details.TransferInItemID); base.ExecuteNonQuery(cmd); TransferIn clsTransferIn = new TransferIn(base.Connection, base.Transaction); clsTransferIn.SynchronizeAmount(Details.TransferInID); } catch (Exception ex) { throw base.ThrowException(ex); } }
private List <TransferInResultDTO> CreateTransferIn(CreateApprovedTransferInSV bpObj) { System.Collections.Generic.List <TransferInResultDTO> result = new System.Collections.Generic.List <TransferInResultDTO>(); //object result2; try { if (bpObj.TransferInLineDTOList == null || bpObj.TransferInLineDTOList.Count == 0) { //result.Add(new TransferInResultDTO //{ // IsSuccess = false, // ErrorInfo = "传入参数不可为空", // Timestamp = System.DateTime.Now //}); //result2 = result; TransferInResultDTO backDTO = new TransferInResultDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "传入参数不可为空"; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo); result.Add(backDTO); } else { string errormessage = this.ValidateParamNullOrEmpty(bpObj); if (!string.IsNullOrEmpty(errormessage)) { //result.Add(new TransferInResultDTO //{ // IsSuccess = false, // ErrorInfo = errormessage + "请检查传入参数", // Timestamp = System.DateTime.Now //}); //result2 = result; TransferInResultDTO backDTO = new TransferInResultDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = errormessage + "请检查传入参数"; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo); } else { System.Collections.Generic.List <CommonArchiveDataDTOData> transinidlist; //using (UBFTransactionScope trans = new UBFTransactionScope(TransactionOption.Required)) { try { UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy proxy = new UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy(); proxy.TransferInDTOList = (this.GetTransferInDTOList(bpObj)); transinidlist = proxy.Do(); if (transinidlist == null || transinidlist.Count <= 0) { //result.Add(new TransferInResultDTO //{ // IsSuccess = false, // ErrorInfo = "生单失败:没有生成调入单", // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; TransferInResultDTO backDTO = new TransferInResultDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生单失败:没有生成调入单"; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo); return(result); } TransferInBatchApproveSRVProxy approveproxy = new TransferInBatchApproveSRVProxy(); approveproxy.DocList = (transinidlist); approveproxy.ApprovedBy = (Context.LoginUser); approveproxy.ApprovedOn = (System.DateTime.Now); approveproxy.Do(); //trans.Commit(); } catch (System.Exception e) { //trans.Rollback(); //result.Add(new TransferInResultDTO //{ // IsSuccess = false, // ErrorInfo = "生单失败:" + e.Message, // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; TransferInResultDTO backDTO = new TransferInResultDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生单失败:" + e.Message; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace); return(result); } } foreach (CommonArchiveDataDTOData transin in transinidlist) { TransferIn t = TransferIn.Finder.FindByID(transin.ID); if (t != null) { result.Add(new TransferInResultDTO { IsSuccess = true, ErrorInfo = "生单成功", Timestamp = System.DateTime.Now, ERPDocNo = transin.Code, TransDocNo = t.DescFlexField.PrivateDescSeg4 }); } } //result2 = result; } } } catch (System.Exception e) { //result.Add(new TransferInResultDTO //{ // IsSuccess = false, // ErrorInfo = e.Message, // Timestamp = System.DateTime.Now //}); //result2 = result; TransferInResultDTO backDTO = new TransferInResultDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = e.Message; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace); } //return result2; return(result); }
private void LoadList() { TransferIn clsTransferIn = new TransferIn(); DataClass clsDataClass = new DataClass(); Common Common = new Common(); string SortField = "TransferInID"; if (Request.QueryString["sortfield"] != null) { SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID); } SortOption sortoption = SortOption.Ascending; if (Request.QueryString["sortoption"] != null) { sortoption = (SortOption)Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true); } DateTime dteOrderStartDate = DateTime.MinValue; try { if (txtOrderStartDate.Text != string.Empty) { dteOrderStartDate = Convert.ToDateTime(txtOrderStartDate.Text + " " + txtOrderStartTime.Text); } } catch { } DateTime dteOrderEndDate = DateTime.MinValue; try { if (txtOrderEndDate.Text != string.Empty) { dteOrderEndDate = Convert.ToDateTime(txtOrderEndDate.Text + " " + txtOrderEndTime.Text); } } catch { } DateTime dtePostingStartDate = DateTime.MinValue; try { if (txtPostingStartDate.Text != string.Empty) { dtePostingStartDate = Convert.ToDateTime(txtPostingStartDate.Text + " " + txtPostingStartTime.Text); } } catch { } DateTime dtePostingEndDate = DateTime.MinValue; try { if (txtPostingEndDate.Text != string.Empty) { dtePostingEndDate = Convert.ToDateTime(txtPostingEndDate.Text + " " + txtPostingEndTime.Text); } } catch { } string SearchKey = txtSearch.Text; TransferInStatus status = (TransferInStatus)Enum.Parse(typeof(TransferInStatus), cboStatus.SelectedItem.Value); PageData.DataSource = clsTransferIn.SearchAsDataTable(status, dteOrderStartDate, dteOrderEndDate, dtePostingStartDate, dtePostingEndDate, SearchKey, SortField, sortoption).DefaultView; clsTransferIn.CommitAndDispose(); int iPageSize = Convert.ToInt16(Session["PageSize"]); PageData.AllowPaging = true; PageData.PageSize = iPageSize; try { PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1; lstItem.DataSource = PageData; lstItem.DataBind(); } catch { PageData.CurrentPageIndex = 1; lstItem.DataSource = PageData; lstItem.DataBind(); } cboCurrentPage.Items.Clear(); for (int i = 0; i < PageData.PageCount; i++) { int iValue = i + 1; cboCurrentPage.Items.Add(new ListItem(iValue.ToString(), iValue.ToString())); if (PageData.CurrentPageIndex == i) { cboCurrentPage.Items[i].Selected = true; } else { cboCurrentPage.Items[i].Selected = false; } } lblDataCount.Text = " of " + " " + PageData.PageCount; }
public HttpResponseMessage Get([FromUri] int Id, [FromBody] int LocationId) { return(Request.CreateResponse(HttpStatusCode.OK, TransferIn.GetDetails(Id, LocationId))); }
public HttpResponseMessage Get([FromBody] int LocationId, [FromUri] DateTime?from, [FromUri] DateTime?to) { return(Request.CreateResponse(HttpStatusCode.OK, TransferIn.GetDetails(LocationId, from, to))); }
public void Handle(ICommandContext context, TransferIn command) { context.Get <BankAccount>(command.TransferInfo.TargetAccountId).TransferIn(command.ProcessId, command.TransferInfo); }
public void Notify(params object[] args) { if (args != null && args.Length != 0 && args[0] is EntityEvent) { BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey; if (!(key == null)) { TransferIn transferin = key.GetEntity() as TransferIn; if (PubHelper.SaleOrg2DMS.Contains(Context.LoginOrg.Code)) { bool flag = PubHelper.IsUsedDMSAPI(); if (flag) { if (transferin.DocType.Code == "MoveWH") { if (transferin.Status == TransInStatus.Approved && transferin.OriginalData.Status == TransInStatus.Approving) { SI11ImplService service = new SI11ImplService(); // service.Url = PubHelper.GetAddress(service.Url); System.Collections.Generic.List <vehicleMoveInfoDto> list = new System.Collections.Generic.List <vehicleMoveInfoDto>(); foreach (TransInLine line in transferin.TransInLines) { foreach (TransInSubLine subline in line.TransInSubLines) { vehicleMoveInfoDto dto = new vehicleMoveInfoDto(); dto.flowCode = ((subline.TransInLine.DescFlexSegments.PubDescSeg12.Length >= 8) ? subline.TransInLine.DescFlexSegments.PubDescSeg12.Substring(subline.TransInLine.DescFlexSegments.PubDescSeg12.Length - 8, 8) : subline.TransInLine.DescFlexSegments.PubDescSeg12); if (subline.TransInLine.TransInWhKey != null) { dto.toWarehose = subline.TransInLine.TransInWh.Code; } if (subline.TransOutWhKey != null) { dto.fromWarehose = subline.TransOutWh.Code; } list.Add(dto); } } try { vehicleMoveInfoDto dto2 = service.Do(list.ToArray()); if (dto2 != null && dto2.flag == 0) { throw new BusinessException(dto2.errMsg); } } catch (System.Exception e) { throw new BusinessException("调用DMS接口错误:" + e.Message); } } else if (transferin.Status == TransInStatus.Opening && transferin.OriginalData.Status == TransInStatus.Approved) { SI11ImplService service = new SI11ImplService(); // service.Url = PubHelper.GetAddress(service.Url); System.Collections.Generic.List <vehicleMoveInfoDto> list = new System.Collections.Generic.List <vehicleMoveInfoDto>(); foreach (TransInLine line in transferin.TransInLines) { foreach (TransInSubLine subline in line.TransInSubLines) { vehicleMoveInfoDto dto = new vehicleMoveInfoDto(); dto.flowCode = ((subline.TransInLine.DescFlexSegments.PubDescSeg12.Length >= 8) ? subline.TransInLine.DescFlexSegments.PubDescSeg12.Substring(subline.TransInLine.DescFlexSegments.PubDescSeg12.Length - 8, 8) : subline.TransInLine.DescFlexSegments.PubDescSeg12); if (subline.TransInLine.TransInWhKey != null) { dto.fromWarehose = subline.TransInLine.TransInWh.Code; } if (subline.TransOutWhKey != null) { dto.toWarehose = subline.TransOutWh.Code; } list.Add(dto); } } try { vehicleMoveInfoDto dto2 = service.Do(list.ToArray()); if (dto2 != null && dto2.flag == 0) { throw new BusinessException(dto2.errMsg); } } catch (System.Exception e) { throw new BusinessException("调用DMS接口错误:" + e.Message); } } } } } } } }
public long Insert(TransferInItemDetails Details) { try { string SQL = "INSERT INTO tblTransferInItems (" + "TransferInID, " + "ProductID, " + "ProductCode, " + "BarCode, " + "Description, " + "ProductUnitID, " + "ProductUnitCode, " + "Quantity, " + "OriginalQuantity, " + "UnitCost, " + "Discount, " + "DiscountApplied, " + "DiscountType, " + "Amount, " + "VAT, " + "VatableAmount, " + "EVAT, " + "EVatableAmount, " + "LocalTax, " + "isVATInclusive, " + "VariationMatrixID, " + "MatrixDescription, " + "ProductGroup, " + "ProductSubGroup, " + "TransferInItemStatus, " + "IsVatable, " + "Remarks, " + "ChartOfAccountIDTransferIn, " + "ChartOfAccountIDTaxTransferIn, " + "ChartOfAccountIDInventory," + "SellingPrice," + "SellingVAT," + "SellingEVAT," + "SellingLocalTax," + "OldSellingPrice" + ") VALUES (" + "@TransferInID, " + "@ProductID, " + "@ProductCode, " + "@BarCode, " + "@Description, " + "@ProductUnitID, " + "@ProductUnitCode, " + "@Quantity, " + "@Quantity, " + "@UnitCost, " + "@Discount, " + "@DiscountApplied, " + "@DiscountType, " + "@Amount, " + "@VAT, " + "@VatableAmount, " + "@EVAT, " + "@EVatableAmount, " + "@LocalTax, " + "@isVATInclusive, " + "@VariationMatrixID, " + "@MatrixDescription, " + "@ProductGroup, " + "@ProductSubGroup, " + "@TransferInItemStatus, " + "@IsVatable, " + "@Remarks, " + "(SELECT ChartOfAccountIDTransferIn FROM tblProducts WHERE ProductID = @ProductID), " + "(SELECT ChartOfAccountIDTaxTransferIn FROM tblProducts WHERE ProductID = @ProductID), " + "(SELECT ChartOfAccountIDInventory FROM tblProducts WHERE ProductID = @ProductID)," + "@SellingPrice," + "@SellingVAT," + "@SellingEVAT," + "@SellingLocalTax," + "@OldSellingPrice" + ");"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; MySqlParameter prmTransferInID = new MySqlParameter("@TransferInID", MySqlDbType.Int64); prmTransferInID.Value = Details.TransferInID; cmd.Parameters.Add(prmTransferInID); MySqlParameter prmProductID = new MySqlParameter("@ProductID", MySqlDbType.Int64); prmProductID.Value = Details.ProductID; cmd.Parameters.Add(prmProductID); MySqlParameter prmProductCode = new MySqlParameter("@ProductCode", MySqlDbType.String); prmProductCode.Value = Details.ProductCode; cmd.Parameters.Add(prmProductCode); MySqlParameter prmBarCode = new MySqlParameter("@BarCode", MySqlDbType.String); prmBarCode.Value = Details.BarCode; cmd.Parameters.Add(prmBarCode); MySqlParameter prmDescription = new MySqlParameter("@Description", MySqlDbType.String); prmDescription.Value = Details.Description; cmd.Parameters.Add(prmDescription); MySqlParameter prmProductUnitID = new MySqlParameter("@ProductUnitID", MySqlDbType.Int16); prmProductUnitID.Value = Details.ProductUnitID; cmd.Parameters.Add(prmProductUnitID); MySqlParameter prmProductUnitCode = new MySqlParameter("@ProductUnitCode", MySqlDbType.String); prmProductUnitCode.Value = Details.ProductUnitCode; cmd.Parameters.Add(prmProductUnitCode); MySqlParameter prmQuantity = new MySqlParameter("@Quantity", MySqlDbType.Decimal); prmQuantity.Value = Details.Quantity; cmd.Parameters.Add(prmQuantity); MySqlParameter prmUnitCost = new MySqlParameter("@UnitCost", MySqlDbType.Decimal); prmUnitCost.Value = Details.UnitCost; cmd.Parameters.Add(prmUnitCost); MySqlParameter prmDiscount = new MySqlParameter("@Discount", MySqlDbType.Decimal); prmDiscount.Value = Details.Discount; cmd.Parameters.Add(prmDiscount); MySqlParameter prmDiscountApplied = new MySqlParameter("@DiscountApplied", MySqlDbType.Decimal); prmDiscountApplied.Value = Details.DiscountApplied; cmd.Parameters.Add(prmDiscountApplied); MySqlParameter prmDiscountType = new MySqlParameter("@DiscountType", MySqlDbType.Int16); prmDiscountType.Value = (int)Details.DiscountType; cmd.Parameters.Add(prmDiscountType); MySqlParameter prmAmount = new MySqlParameter("@Amount", MySqlDbType.Decimal); prmAmount.Value = Details.Amount; cmd.Parameters.Add(prmAmount); MySqlParameter prmVAT = new MySqlParameter("@VAT", MySqlDbType.Decimal); prmVAT.Value = Details.VAT; cmd.Parameters.Add(prmVAT); MySqlParameter prmVatableAmount = new MySqlParameter("@VatableAmount", MySqlDbType.Decimal); prmVatableAmount.Value = Details.VatableAmount; cmd.Parameters.Add(prmVatableAmount); MySqlParameter prmEVAT = new MySqlParameter("@EVAT", MySqlDbType.Decimal); prmEVAT.Value = Details.EVAT; cmd.Parameters.Add(prmEVAT); MySqlParameter prmEVatableAmount = new MySqlParameter("@EVatableAmount", MySqlDbType.Decimal); prmEVatableAmount.Value = Details.EVatableAmount; cmd.Parameters.Add(prmEVatableAmount); MySqlParameter prmLocalTax = new MySqlParameter("@LocalTax", MySqlDbType.Decimal); prmLocalTax.Value = Details.LocalTax; cmd.Parameters.Add(prmLocalTax); MySqlParameter prmisVATInclusive = new MySqlParameter("@isVATInclusive", MySqlDbType.Int16); prmisVATInclusive.Value = Convert.ToInt16(Details.isVATInclusive); cmd.Parameters.Add(prmisVATInclusive); MySqlParameter prmVariationMatrixID = new MySqlParameter("@VariationMatrixID", MySqlDbType.Int64); prmVariationMatrixID.Value = Details.VariationMatrixID; cmd.Parameters.Add(prmVariationMatrixID); MySqlParameter prmMatrixDescription = new MySqlParameter("@MatrixDescription", MySqlDbType.String); prmMatrixDescription.Value = Details.MatrixDescription; cmd.Parameters.Add(prmMatrixDescription); MySqlParameter prmProductGroup = new MySqlParameter("@ProductGroup", MySqlDbType.String); prmProductGroup.Value = Details.ProductGroup; cmd.Parameters.Add(prmProductGroup); MySqlParameter prmProductSubGroup = new MySqlParameter("@ProductSubGroup", MySqlDbType.String); prmProductSubGroup.Value = Details.ProductSubGroup; cmd.Parameters.Add(prmProductSubGroup); MySqlParameter prmTransferInItemStatus = new MySqlParameter("@TransferInItemStatus", MySqlDbType.Int16); prmTransferInItemStatus.Value = Details.TransferInItemStatus.ToString("d"); cmd.Parameters.Add(prmTransferInItemStatus); MySqlParameter prmIsVatable = new MySqlParameter("@IsVatable", MySqlDbType.Int16); prmIsVatable.Value = Convert.ToInt16(Details.IsVatable); cmd.Parameters.Add(prmIsVatable); MySqlParameter prmRemarks = new MySqlParameter("@Remarks", MySqlDbType.String); prmRemarks.Value = Details.Remarks; cmd.Parameters.Add(prmRemarks); cmd.Parameters.AddWithValue("@SellingPrice", Details.SellingPrice); cmd.Parameters.AddWithValue("@SellingVAT", Details.SellingVAT); cmd.Parameters.AddWithValue("@SellingEVAT", Details.SellingEVAT); cmd.Parameters.AddWithValue("@SellingLocalTax", Details.SellingLocalTax); cmd.Parameters.AddWithValue("@OldSellingPrice", Details.OldSellingPrice); base.ExecuteNonQuery(cmd); SQL = "SELECT LAST_INSERT_ID();"; cmd.Parameters.Clear(); cmd.CommandText = SQL; string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName); base.MySqlDataAdapterFill(cmd, dt); Int64 iID = 0; foreach (System.Data.DataRow dr in dt.Rows) { iID = Int64.Parse(dr[0].ToString()); } TransferIn clsTransferIn = new TransferIn(base.Connection, base.Transaction); clsTransferIn.SynchronizeAmount(Details.TransferInID); return(iID); } catch (Exception ex) { throw base.ThrowException(ex); } }
private System.Collections.Generic.List <ShipBackDTO> CreateDispatch(DispatchOutWhCarSV bpObj) { System.Collections.Generic.List <ShipBackDTO> result = new System.Collections.Generic.List <ShipBackDTO>(); //object result2; try { if (bpObj.CarShipLineDTOs == null || bpObj.CarShipLineDTOs.Count == 0) { string msg = "传入参数不可为空"; result.Add(new ShipBackDTO { IsSuccess = false, ErrorInfo = msg, Timestamp = System.DateTime.Now }); //result2 = result; HBHCommon.LoggerError(msg); } else { System.Collections.Generic.List <CarShipLineDTO> shiplist = new System.Collections.Generic.List <CarShipLineDTO>(); System.Collections.Generic.List <CarShipLineDTO> transferinlist = new System.Collections.Generic.List <CarShipLineDTO>(); string errormessage = this.ValidateParamNullOrEmpty(bpObj, ref shiplist, ref transferinlist); if (!string.IsNullOrEmpty(errormessage)) { string msg = "请检查传入参数"; result.Add(new ShipBackDTO { IsSuccess = false, ErrorInfo = errormessage + "请检查传入参数", Timestamp = System.DateTime.Now }); //result2 = result; HBHCommon.LoggerError(msg); } else { System.Collections.Generic.List <DocKeyDTOData> shipidlist = new System.Collections.Generic.List <DocKeyDTOData>(); System.Collections.Generic.List <CommonArchiveDataDTOData> transinidlist = new System.Collections.Generic.List <CommonArchiveDataDTOData>(); if (shiplist != null && shiplist.Count > 0) { try { CreateShipSVProxy proxy = new CreateShipSVProxy(); proxy.ShipDTOs = (this.GetShipDTOList(shiplist)); shipidlist = proxy.Do(); // 整车生成开立的出货单; } catch (System.Exception e) { //result.Add(new ShipBackDTO //{ // IsSuccess = false, // ErrorInfo = "生成出货单失败:" + e.Message, // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; ShipBackDTO backDTO = new ShipBackDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生成出货单失败:" + e.Message; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace); result.Add(backDTO); return(result); } if (shipidlist == null || shipidlist.Count <= 0) { //result.Add(new ShipBackDTO //{ // IsSuccess = false, // ErrorInfo = "生单失败:没有生成出货单", // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; ShipBackDTO backDTO = new ShipBackDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生单失败:没有生成出货单"; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo); result.Add(backDTO); return(result); } } if (transferinlist != null && transferinlist.Count > 0) { //using (UBFTransactionScope trans = new UBFTransactionScope(TransactionOption.Required)) { try { UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy proxy2 = new UFIDA.U9.ISV.TransferInISV.Proxy.CommonCreateTransferInSVProxy(); proxy2.TransferInDTOList = (this.GetTransferInDTOList(transferinlist)); transinidlist = proxy2.Do(); if (transinidlist == null || transinidlist.Count <= 0) { //result.Add(new ShipBackDTO //{ // IsSuccess = false, // ErrorInfo = "生单失败:没有生成调入单", // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; ShipBackDTO backDTO = new ShipBackDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生单失败:没有生成调入单"; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo); result.Add(backDTO); return(result); } TransferInBatchApproveSRVProxy approveproxy = new TransferInBatchApproveSRVProxy(); approveproxy.DocList = (transinidlist); approveproxy.ApprovedBy = (Context.LoginUser); approveproxy.ApprovedOn = (System.DateTime.Now); approveproxy.Do(); //trans.Commit(); } catch (System.Exception e) { //trans.Rollback(); //result.Add(new ShipBackDTO //{ // IsSuccess = false, // ErrorInfo = "生成调入单失败:" + e.Message, // Timestamp = System.DateTime.Now //}); //result2 = result; //return result2; ShipBackDTO backDTO = new ShipBackDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = "生成调入单失败:" + e.Message; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace); result.Add(backDTO); return(result); } } } foreach (DocKeyDTOData shipid in shipidlist) { Ship ship = Ship.Finder.FindByID(shipid.DocID); if (ship != null) { result.Add(new ShipBackDTO { IsSuccess = true, ErrorInfo = "生单出货单成功", Timestamp = System.DateTime.Now, ERPDocNo = shipid.DocNO, DMSDocNo = ship.DescFlexField.PubDescSeg7 }); } } foreach (CommonArchiveDataDTOData transin in transinidlist) { TransferIn t = TransferIn.Finder.FindByID(transin.ID); if (t != null) { result.Add(new ShipBackDTO { IsSuccess = true, ErrorInfo = "生单调入单成功", Timestamp = System.DateTime.Now, ERPDocNo = transin.Code, DMSDocNo = t.TransInLines[0].DescFlexSegments.PubDescSeg5 }); } } //result2 = result; } } } catch (System.Exception e) { //result.Add(new ShipBackDTO //{ // IsSuccess = false, // ErrorInfo = e.Message, // Timestamp = System.DateTime.Now //}); //result2 = result; ShipBackDTO backDTO = new ShipBackDTO(); backDTO.IsSuccess = false; backDTO.ErrorInfo = e.Message; backDTO.Timestamp = System.DateTime.Now; HBHCommon.LoggerError(backDTO.ErrorInfo + "/r/n" + e.StackTrace); result.Add(backDTO); } //return result2; return(result); }