private void btnPrint_Click(object sender, EventArgs e) { var dvPickListMakeup = (DataTable)gridTransactions.DataSource; var ord = new BLL.Order(); ord.LoadByPrimaryKey(OrderID); var rus = new Institution(); rus.LoadByPrimaryKey(ord.RequestedBy); if (BLL.Settings.IsCenter) { dvPickListMakeup.Columns["PhysicalStoreTypeName"].ColumnName = "WarehouseName"; dvPickListMakeup.Columns["SKUTOPICK"].ColumnName = "QtyInSKU"; dvPickListMakeup.Columns["StoreGroupName"].ColumnName = "AccountName"; dvPickListMakeup.Columns.Add("ActivityConcat"); foreach (DataRow r in dvPickListMakeup.Rows) { var activity = new Activity(); activity.LoadByPrimaryKey(Convert.ToInt32(r["StoreID"])); r["ActivityConcat"] = activity.FullActivityName; } } var pl = HCMIS.Desktop.Reports.WorkflowReportFactory.CreatePicklistReport(ord, rus.Name, dvPickListMakeup.DefaultView); pl.ShowPreviewDialog(); // refresh the display lstRefNo_FocusedNodeChanged(null, null); }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <returns>An order if found; null if order not found</returns> public Order GetOrderById(int id) { DataSet ds = new DataSet(); DataSetTableAdapters.ordersTableAdapter adapter = new DataSetTableAdapters.ordersTableAdapter(); adapter.Fill(ds.orders); Order o = new Order(); // find the order DataSet.ordersDataTable table = adapter.GetOrderById(id); // if a order was found, then fill in the details if (table.Rows.Count > 0) { // use the 1st row's data DataSet.ordersRow row = (DataSet.ordersRow)table.Rows[0]; o.ID = row.orderId; o.CatalogId = row.catalogId; o.ClientId = row.clientId; o.PaymentId = row.paymentId; o.OrderDate = row.orderDate; o.Details = row.details; o.Price = row.price; return o; } else { return null; } }
private static void ConfirmBranchApprovedOrder(int hcmisOrderID) { var tsvc = new ServiceOrderClient(); var issuedList = new Collection <Issuance>(); BLL.Order order = new Order(); order.LoadByPrimaryKey(hcmisOrderID); var collOrders = new Collection <int>(); while (!order.EOF) { collOrders.Add(order.HCTSReferenceID); order.MoveNext(); } try { tsvc.ConfirmBranchApprovedOrders(collOrders, PlitsUserName, PlitsPassword); } catch (Exception e) { throw e.InnerException; } }
private void btnDeleteRequisition_Click(object sender, EventArgs e) { DataRow dr = gridRequisitionListView.GetFocusedDataRow(); if (dr != null) { int orderID = Convert.ToInt32(dr["ID"]); Order ord = new Order(); ord.LoadByPrimaryKey(orderID); if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { if (XtraMessageBox.Show("Are you sure you would like to cancel this requisition?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { ord.ChangeStatus(OrderStatus.Constant.CANCELED, CurrentContext.UserId); LoadRequisitions(); XtraMessageBox.Show("Your requisisition has been canceled.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { } LoadRequisitions(); } } else { XtraMessageBox.Show("This requisition has already been submitted, you cannot resubmit/cancel it.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
/// <summary> /// Formats the cash invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCashInvoice_Smaller(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { string activityName = txtConfirmFromStore.Text; bool hasInsurnance = chkIncludeInsurance.Checked; return(WorkflowReportFactory.CreateCashInvoiceSmaller(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName)); }
/// <summary> /// 申请返款 /// </summary> /// <param name="context"></param> public void SubmitRebates(HttpContext context) { string orderId = context.Request["orderId"]; if (string.IsNullOrEmpty(orderId)) { context.Response.Write("{\"msg\":\"没有可以提交的销售单。\",\"success\":\"false\"}"); return; } var order = new BLL.Order(); string result = ""; foreach (string s in orderId.Split(new char[] { ',' })) { if (order.SubmitOrders(s, order.GetOrderByPKID(orderId).CustomerID.ToString()).Length > 0) { result += "不可提交"; } else if (!CommonFunction.CheckOrderAttach(int.Parse(orderId), "attachRequireSale")) { result += "电子资料不全。具体要求查看在线帮助。"; } else { result += order.SubmitRebates(orderId); } } result = (result.Length > 0) ? "部分销售单不能申请返款。可能以下情况:<BR>1.被禁止申请返款;2.已提交过<BR>3.未填写交车记录;4.车型不符合返款规定;5.电子资料不全" : ""; context.Response.Write("{\"msg\":\" " + result + "\",\"success\":\"false\"}"); }
private void btnDeleteRequisition_Click(object sender, EventArgs e) { DataRow dr = gridRequisitionListView.GetFocusedDataRow(); if (dr != null) { int orderID = Convert.ToInt32(dr["ID"]); Order ord = new Order(); ord.LoadByPrimaryKey(orderID); if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { if (XtraMessageBox.Show("Are you sure you would like to cancel this requisition?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { ord.ChangeStatus(OrderStatus.Constant.CANCELED,CurrentContext.UserId); LoadRequisitions(); XtraMessageBox.Show("Your requisisition has been canceled.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { } LoadRequisitions(); } } else { XtraMessageBox.Show("This requisition has already been submitted, you cannot resubmit/cancel it.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
public void GetData(HttpContext context) { int orderId = int.Parse(context.Request["orderId"]); Common.Entity.ReportOrder order = new BLL.Order().GetOrderFullInfo(orderId); context.Response.Write(JsonConvert.SerializeObject(order)); }
private XtraReport FormatCreditInvoice_Larger(DataTable dvPriced, Order ord, PickList pl, Institution rus, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { bool hasInsurance = chkIncludeInsurance.Checked; string activityName = txtConfirmFromStore.Text; return(WorkflowReportFactory.CreateCreditInvoice(dvPriced, ord, pl, rus, deliveryNote, hasInsurance, activityName, true, null)); }
public void BatchUpdateAudit(HttpContext context) { string orderId = context.Request["orderId"]; string Batch_cboAudit = context.Request["Batch_cboAudit"]; string Batch_FN_RebatesRemark = context.Request["Batch_FN_RebatesRemark"]; string result = ""; if (string.IsNullOrEmpty(orderId)) { result = "没有可以审核的订单。"; context.Response.Write("{\"msg\":\"" + result + "。\",\"success\":false}"); return; } BLL.Order bll = new BLL.Order(); string[] orders = orderId.Split(new char[] { ',' }); List <string> newOrders = new List <string>(); var rightCar = string.Format("'{0}'", context.Session["UserCar"].ToString().Replace(",", "','")); foreach (string s in orders) { if (bll.ExistsCarOrder(s, rightCar.Trim())) { newOrders.Add(s); } } int orderlen = orderId.Length; if (newOrders.Count < 1) { result = "没有有权限审核的订单"; context.Response.Write("{\"msg\":\"" + result + "。\",\"success\":false}"); return; } orderId = string.Join(",", newOrders.ToArray <string>()); if (orderId.Length != orderlen) { result = "部分订单没有权限审核"; context.Response.Write("{\"msg\":\"" + result + "。\",\"success\":false}"); return; } bll.BatchUpdateAudit(orderId, context.Session["Name"].ToString(), Batch_cboAudit, Batch_FN_RebatesRemark); if (Batch_cboAudit.Equals("同意")) { foreach (string s in orderId.Split(new char[] { ',' })) { try { // 更新审核状态 bll.SplitOrders(orderId); result = "批审核成功。"; } catch { } } } context.Response.Write("{\"msg\":\"" + result + "。\",\"success\":true}"); }
/// <summary> /// 作废订单操作 /// </summary> /// <param name="context">上下文对象</param> public void DeleteOrders(HttpContext context) { BLL.Order bll = new BLL.Order(); int orderId = ZJRequest.GetFormInt("orderId"); string username = context.User.Identity.Name; Common.SysUserEntity model = new BLL.sysUser().GetSysUserByLoginName(username); bll.Delete(model.Name, orderId); }
/// <summary> /// Formats the cash invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCashInvoice(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { if (BLL.Settings.UseSmallerCashPrintout) { return(FormatCashInvoice_Smaller(ord, dvPriced, rus, pl, deliveryNote, printerName, pLogService)); } return(FormatCashInvoice_Larger(ord, dvPriced, rus, pl, deliveryNote, printerName, pLogService)); }
public Domain.Request FindSingle(int requestID) { var request = new Domain.Request(); var order = new Order(); order.LoadByPrimaryKey(requestID); request.RequestID = order.ID; request.OrderNumber = order.RefNo; request.LetterNumber = !order.IsColumnNull("LetterNo") ? order.LetterNo : ""; request.RequestedDate = order.EurDate; request.Client = _clientRepository.FindSingle(order.RequestedBy); request.Mode = _modeService.GetEnum(order.FromStore); request.PaymentTerm = _paymentTermService.FindSingle(order.PaymentTypeID); request.OrderStatus = _orderStatusService.GetEnum(order.OrderStatusID); var orderDetail = new OrderDetail(); orderDetail.LoadAllByOrderID(requestID); orderDetail.Rewind(); request.RequestDetails = new Collection<Domain.RequestDetail>(); while (!orderDetail.EOF) { var item = _itemRepository.FindSingle(orderDetail.ItemID); var unitOfIssue = _unitOfIssueRepository.FindSingle(orderDetail.UnitID); var requestDetail = new Domain.RequestDetail() { RequestDetailId = orderDetail.ID, Item = item, Unit = unitOfIssue, RequestedQuantity = orderDetail.Pack, ApprovedQuantity = !orderDetail.IsColumnNull("ApprovedQuantity") ? orderDetail.ApprovedQuantity : orderDetail.Pack, IsFirstLoad = orderDetail.IsColumnNull("ApprovedQuantity"), ActivityGroup = orderDetail.IsColumnNull(OrderDetail.ColumnNames.StoreID)?null:_activityRepository.FindSingle(orderDetail.StoreID,orderDetail.DeliveryNote), ExpiryDate = !orderDetail.IsColumnNull("PreferredExpiryDate") ? orderDetail.PreferredExpiryDate : (DateTime?)null, Manufacturer = !orderDetail.IsColumnNull("PreferredManufacturerID") ? _manufacturerRepository.FindSingle( orderDetail.PreferredManufacturerID) : null, physicalStore = !orderDetail.IsColumnNull("PreferredPhysicalStoreID") ? _physicalStoreRepository.FindSingle( orderDetail.PreferredPhysicalStoreID) : null }; request.RequestDetails.Add(requestDetail); orderDetail.MoveNext(); } return request; }
private void PrintPickList(Order ord, Institution rus) { var pickList = WorkflowReportFactory.CreatePicklistReport(ord, rus.Name, _dvPickListMakeup); if (pickList != null) { pickList.PrintDialog(); // Log the pick list } }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount == 0) { XtraMessageBox.Show("You have to select an Order to return to approval, ", "Error - Select Order"); return; } if (!ord.IsColumnNull("OrderTypeID") && ord.OrderTypeID != OrderType.CONSTANTS.STANDARD_ORDER) { XtraMessageBox.Show("You cannot return this order to approval, you can either cancel or confirm this order", "Error - You cannot return this order"); return; } MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED, CurrentContext.UserId); BindApprovedOrders(); } else if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED) { ord.ReleaseReservation(); ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED, CurrentContext.UserId); BindApprovedOrders(); } transaction.CommitTransaction(); } catch (Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; //HCMISLoader.MarkAsDirtyUsingOrderID(_orderID, NewMainWindow.UserId, true); if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Handles the Click event of the btnReturnToApprovalStep control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { if (XtraMessageBox.Show("Are you sure you would like to return this order to the picklist?", "Confirmation", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { BLL.Order order = new Order(); order.LoadByPrimaryKey(_orderID); order.ReturnBacktoPicklistConfirmation(); BindOutstandingPicklists(); gridOutstandingPicklistDetail.DataSource = null; } }
public void FinishOrders(HttpContext context) { string orderId = context.Request["orderId"]; if (string.IsNullOrEmpty(orderId)) { return; } BLL.Order bll = new BLL.Order(); bll.FinishOrders(orderId.Replace(" ", "").Replace("\"", "").Replace("[", "").Replace("]", "")); }
/// <summary> /// 获取订单实体对象 /// </summary> /// <param name="context">上下文对象</param> public void GetOrderByPKID(HttpContext context) { int orderId = Convert.ToInt32(context.Request["orderId"]); if (orderId > 0) { Common.Entity.Order model = new Common.Entity.Order(); model = new BLL.Order().GetOrderByPKID(orderId); context.Response.Write(JsonConvert.SerializeObject(model)); } }
private void bgWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { int orderID = Convert.ToInt32(e.Argument); Order or = new Order(); _dvPickListMakeup = or.GetBatchConfirmationChoice(orderID, CurrentContext.UserId, bgWorker); _dvPickListMakeup.Sort = "StorageTypeID, ShelfID, Column, Row"; // dvPickListMakeup = dvPickListMakeup.Table.DefaultView; List<DataView> list = new List<DataView>(); list.Add(_dvPickListMakeup); list.Add(or._replenishmentList.DefaultView); e.Result = list; }
// Get Order and order Detail private static Collection <int> GetapprovedOrderIDs() { var orderIDs = new Collection <int>(); var o = new Order(); foreach (var order in o.GetPLITSApprovedOrders(CurrentContext.UserId, Mode.Constants.RDF)) { orderIDs.Add(Convert.ToInt32(o.ID)); } return(orderIDs); }
public void SplitOrders(HttpContext context) { string id = context.Request["orderId"]; BLL.Order order = new BLL.Order(); string[] ordersList = getOrdersList(id); foreach (string ids in ordersList) { order.SplitOrders(ids); context.Response.Write("{\"msg\":\"拆单完成。\",\"success\":true}"); } }
/// <summary> /// 配车状态:恢复配车1,取消配车0 /// </summary> /// <param name="context"></param> public void DistributeNeed(HttpContext context) { string orderId = context.Request["orderId"]; if (string.IsNullOrEmpty(orderId)) { return; } int needType = Convert.ToInt32(context.Request["needType"]); BLL.Order bll = new BLL.Order(); bll.ChangeOrdersNeeds(orderId.Replace(" ", "").Replace("\"", "").Replace("[", "").Replace("]", ""), needType); }
private void bgWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { int orderID = Convert.ToInt32(e.Argument); Order or = new Order(); _dvPickListMakeup = or.GetBatchConfirmationChoice(orderID, CurrentContext.UserId, bgWorker); _dvPickListMakeup.Sort = "StorageTypeID, ShelfID, Column, Row"; // dvPickListMakeup = dvPickListMakeup.Table.DefaultView; List <DataView> list = new List <DataView>(); list.Add(_dvPickListMakeup); list.Add(or._replenishmentList.DefaultView); e.Result = list; }
/// <summary> /// 获取一个新订单编号和日期的JSON数据 /// </summary> /// <param name="context">上下文对象</param> public void GetOrderNoandDate(HttpContext context) { BLL.Order bll = new BLL.Order(); StringBuilder sb = new StringBuilder(); string username = context.User.Identity.Name; int DealerId = 0; Common.SysUserEntity model = new BLL.sysUser().GetSysUserByLoginName(username); DealerId = model.DealerId; sb.Append("{\"OrderNo\":"); sb.Append(string.Format("\"{0}\"", bll.GetNewOrdersNo(DealerId))); sb.Append(",\"DateNow\":"); sb.Append(string.Format("\"{0}\"}}", CommonFunction.GetDateString())); context.Response.Write(sb.ToString()); }
/// <summary> /// 提交订单 /// </summary> /// <param name="context"></param> public void SubmitOrders(HttpContext context) { string submitIDs = context.Request["submitData"]; string customerIDs = context.Request["customerData"]; if (string.IsNullOrWhiteSpace(submitIDs)) { context.Response.Write("{\"msg\":\"没有可以提交的订单。\",\"success\":false}"); return; } BLL.Order order = new BLL.Order(); string username = context.User.Identity.Name; Common.SysUserEntity model = new BLL.sysUser().GetSysUserByLoginName(username); if (new BLL.DealerContact().GetDealerContactCount(model.DealerId) < 1) { context.Response.Write("{\"msg\":\"至少添加一个经销店联系人(需要返款的话,请填写返款联系人)。\",\"success\":\"false\"}"); return; } bool directSubmit = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["directSubmitOrders"]); string[] subIDs = submitIDs.Split(','); string[] subCustomerIDs = customerIDs.Split(','); // 判断是否提交的订单数据中已有购车等信息 string result = ""; string tempResult = ""; for (int i = 0; i < subIDs.Length; i++) { if (!CommonFunction.CheckOrderAttach(int.Parse(subIDs[i]), "attachRequireOrder")) { context.Response.Write("{\"msg\":\"电子资料不全。具体要求查看在线帮助。\",\"success\":\"false\"}"); return; } else { tempResult = order.SubmitOrders(model.Name, subIDs[i], subCustomerIDs[i], model.DealerId, directSubmit); if (!string.IsNullOrWhiteSpace(tempResult)) { result = tempResult; } context.Response.Write("{\"msg\":\"" + result + "\",\"success\":true}"); return; } } }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.OrderStatusID = OrderStatus.Constant.ORDER_FILLED; ord.Save(); BindApprovedOrders(); } else if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED) { ord.ReleaseReservation(); ord.OrderStatusID = OrderStatus.Constant.ORDER_FILLED; ord.Save(); BindApprovedOrders(); } transaction.CommitTransaction(); } catch (Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; //HCMISLoader.MarkAsDirtyUsingOrderID(_orderID, NewMainWindow.UserId, true); if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void bgWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { try { int orderID = Convert.ToInt32(e.Argument); Order or = new Order(); _dvPickListMakeup = or.GetPalletLocationChoice(CurrentContext.UserId, orderID, bgWorker); _dvPickListMakeup.Sort = "StorageTypeID, ShelfID, Column, Row"; // dvPickListMakeup = dvPickListMakeup.Table.DefaultView; List<DataView> list = new List<DataView>(); list.Add(_dvPickListMakeup); list.Add(or._replenishmentList.DefaultView); e.Result = list; } catch(Exception exception) { XtraMessageBox.Show(exception.Message); throw exception; } }
private void bgWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { try { int orderID = Convert.ToInt32(e.Argument); Order or = new Order(); _dvPickListMakeup = or.GetPalletLocationChoice(CurrentContext.UserId, orderID, bgWorker); _dvPickListMakeup.Sort = "StorageTypeID, ShelfID, Column, Row"; // dvPickListMakeup = dvPickListMakeup.Table.DefaultView; List <DataView> list = new List <DataView>(); list.Add(_dvPickListMakeup); list.Add(or._replenishmentList.DefaultView); e.Result = list; } catch (Exception exception) { XtraMessageBox.Show(exception.Message); throw exception; } }
public void CancelOrders(HttpContext context) { string orderIds = context.Request["orderIds"]; string[] ordersList = getOrdersList(orderIds); int result = 0; foreach (string ids in ordersList) { result = new BLL.Order().InitialiseStatus(ids, -1000); } if (result > 0) { context.Response.Write("{\"msg\":\"操作完成。\",\"success\":true}"); } else { context.Response.Write("{\"msg\":\"操作失败。\",\"success\":false}"); } }
/// <summary> /// 删除订单 /// </summary> /// <param name="context"></param> public void Delete(HttpContext context) { string id = context.Request["orderId"]; BLL.Order order = new BLL.Order(); string[] ordersList = getOrdersList(id); int result = 0; foreach (string ids in ordersList) { result = order.Remove(ids); } if (result > 0) { context.Response.Write("{\"msg\":\"删除成功。\",\"success\":true}"); } else { context.Response.Write("{\"msg\":\"删除失败。\",\"success\":false}"); } }
private void btnSubmitWishlist_Click(object sender, EventArgs e) { DataRow dr = gridRequisitionListView.GetFocusedDataRow(); if (dr != null) { int orderID = Convert.ToInt32(dr["ID"]); Order ord = new Order(); ord.LoadByPrimaryKey(orderID); if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED, CurrentContext.UserId); LoadRequisitions(); XtraMessageBox.Show("Your requisisition has been submitted.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("This requisition has already been submitted, you cannot resubmit it.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED, CurrentContext.UserId);; BindApprovedOrders(); } transaction.CommitTransaction(); this.LogActivity("Return-Pick-List-To-Approval", ord.ID); } catch (Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void SetOrdersStatus(HttpContext context) { BLL.Order order = new BLL.Order(); string ordersID = context.Request["rowIDs"]; string status = context.Request["status"]; string[] ordersList = getOrdersList(ordersID); int statusInt = int.Parse(status); int result = 0; foreach (string ids in ordersList) { result = order.InitialiseStatus(ids, statusInt); } if (result > 0) { context.Response.Write("{\"msg\":\"保存成功。\",\"success\":true}"); } else { context.Response.Write("{\"msg\":\"保存失败。\",\"success\":false}"); } }
/// <summary> /// 获取全部订单信息 /// </summary> /// <param name="context">上下文对象</param> public void GetOrdersAllPager(HttpContext context) { int totalCount = 0; // 总记录数 int pageIndex = Convert.ToInt32(context.Request["page"]); // 当前页 int pageSize = Convert.ToInt32(context.Request["rows"]); // 页码大小 Common.Entity.Order filter = new Common.Entity.Order(); if (!string.IsNullOrEmpty(context.Request.Form["OrdersearchContext"])) { filter = JsonConvert.DeserializeObject <Common.Entity.Order>(context.Request.Form["OrdersearchContext"]); } var list = new BLL.Order().GetOrdersAllPager(pageIndex, pageSize, filter, out totalCount); int totalPages = CommonFunction.CalculateTotalPage(pageSize, totalCount); var ResultData = new CommonFunction.DataResult <Common.Entity.Order>() { totalCount = totalCount, totalpages = totalPages, currPage = pageIndex, dataList = list, }; context.Response.Write(JsonConvert.SerializeObject(ResultData)); }
public void ChangeType(HttpContext context) { BLL.Order order = new BLL.Order(); string ordersID = context.Request["rowIDs"]; string ordersType = context.Request["cmboxOrderType"]; string[] ordersList = getOrdersList(ordersID); int nType = int.Parse(ordersType); int result = 0; foreach (string ids in ordersList) { result = order.ChangeOrderType(ids, nType); } if (result > 0) { context.Response.Write("{\"msg\":\"保存成功。\",\"success\":true}"); } else { context.Response.Write("{\"msg\":\"保存失败。\",\"success\":false}"); } }
public int UpdateOrder(Order o) { return UpdateOrder(o.ID, o.CatalogId, o.ClientId, o.PaymentId, o.OrderDate, o.Details, o.Price); }
public int InsertOrder(Order o) { return InsertOrder(o.CatalogId, o.ClientId, o.PaymentId, o.OrderDate, o.Details, o.Price); }
private Order GenerateOrder() { var or = new Order(); if (OrderID == null) or.AddNew(); else or.LoadByPrimaryKey(OrderID.Value); or.RefNo = Order.GetNextOrderReference(); txtRefNo.Text = or.RefNo; var oldOrderStatus = or.IsColumnNull("OrderStatusID") ? (int?)null : or.OrderStatusID; or.OrderStatusID = OrderStatus.Constant.PICK_LIST_GENERATED; //or.Remark = txtRemark.Text; or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates. if (TransferTypeID == 1) or.RequestedBy = Convert.ToInt32(lkForHub.EditValue); or.FilledBy = CurrentContext.UserId; or.ContactPerson = txtContactPerson.Text; var activity = new Activity(); activity.LoadByPrimaryKey(Convert.ToInt32(lkAccountType.EditValue)); or.FromStore = activity.ModeID; if (BLL.Settings.IsCenter) { //What the Hell is this? or.PaymentTypeID = PaymentType.Constants.STV; } else { or.PaymentTypeID = PaymentType.Constants.STV; } or.FiscalYearID = FiscalYear.Current.ID; or.Save(); or.LogRequisitionStatus(or.ID, oldOrderStatus, OrderStatus.Constant.PICK_LIST_GENERATED,CurrentContext.UserId); return or; }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount == 0) { XtraMessageBox.Show("You have to select an Order to return to approval, ", "Error - Select Order"); return; } if(!ord.IsColumnNull("OrderTypeID") && ord.OrderTypeID != OrderType.CONSTANTS.STANDARD_ORDER) { XtraMessageBox.Show("You cannot return this order to approval, you can either cancel or confirm this order", "Error - You cannot return this order"); return; } MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED,CurrentContext.UserId); BindApprovedOrders(); } else if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED) { ord.ReleaseReservation(); ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED,CurrentContext.UserId); BindApprovedOrders(); } transaction.CommitTransaction(); } catch(Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; //HCMISLoader.MarkAsDirtyUsingOrderID(_orderID, NewMainWindow.UserId, true); if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Formats the credit invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCreditInvoice(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { if (BLL.Settings.UseSmallerCreditPrintout) { return FormatCreditInvoice_Smaller(dvPriced, ord, pl, rus, deliveryNote, printerName, pLogService); } return FormatCreditInvoice_Larger(dvPriced, ord, pl, rus, deliveryNote, printerName, pLogService); }
private void SavePickListItems(object sender, EventArgs e) { var ord = new Order(); var rus = new Institution(); ord.LoadByPrimaryKey(_orderID); rus.LoadByPrimaryKey(ord.RequestedBy); if (_dvPickListMakeup == null || ValidatePickList()) { return; } // First of all .. print the pick list var pls = new PickList(); PrintPickList(ord, rus); MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { mgr.BeginTransaction(); pls.SavePickList(_orderID, _dvPickListMakeup, CurrentContext.UserId); mgr.CommitTransaction(); BindApprovedOrders(); this.LogActivity("Print-Pick-List", ord.ID); XtraMessageBox.Show("Your pick list has been saved! please continue to the next step or prepare another Picklist here.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception exp) { mgr.RollbackTransaction(); ViewHelper.ShowErrorMessage("System couldn't save the Pick List, Please contact administrator for additional help", exp); ErrorHandler.Handle(exp); } }
/// <summary> /// Formats the STV. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="stvSentTo">The STV sent to.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatSTV(Order ord, DataTable dvPriced, string stvSentTo, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int orderID) { bool hasInsurance = chkIncludeInsurance.Checked; string accountName = txtConfirmFromStore.Text; string transferType = null; int? orderTypeID = null; BLL.Order order = new Order(); order.LoadByPrimaryKey(orderID); if (!order.IsColumnNull("OrderTypeID")) orderTypeID = Convert.ToInt32(ord.GetColumn("OrderTypeID")); string transferDetail = ""; if (orderTypeID.HasValue) { BLL.Transfer transfer = new Transfer(); if (orderTypeID == OrderType.CONSTANTS.STORE_TO_STORE_TRANSFER) { transfer.LoadByOrderID(orderID); PhysicalStore toStore = new PhysicalStore(); toStore.LoadByPrimaryKey(transfer.ToPhysicalStoreID); BLL.Warehouse toWarehouse = new BLL.Warehouse(); toWarehouse.LoadByPrimaryKey(toStore.PhysicalStoreTypeID); transferType = "Store to Store Transfer"; stvSentTo = toWarehouse.Name; } if (orderTypeID == OrderType.CONSTANTS.ACCOUNT_TO_ACCOUNT_TRANSFER) { transfer.LoadByOrderID(orderID); Activity fromActivity = new Activity(); fromActivity.LoadByPrimaryKey(transfer.FromStoreID); Activity toActivity = new Activity(); toActivity.LoadByPrimaryKey(transfer.ToStoreID); transferType = "Account to Account Transfer"; transferDetail = string.Format("From: {0} To: {1}", fromActivity.FullActivityName, toActivity.FullActivityName); } } if (!deliveryNote) { if(InstitutionIType.IsVaccine(GeneralInfo.Current)) { return WorkflowReportFactory.CreateModel22(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType); } var stvReport = WorkflowReportFactory.CreateSTVonHeadedPaper(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType); if (transferDetail != "") { stvReport.TransferDetails.Text = transferDetail; stvReport.TransferDetails.Visible = true; } else { stvReport.TransferDetails.Visible = false; } return stvReport; } else { return WorkflowReportFactory.CreateDeliveryNote(ord, dvPriced, stvSentTo, pl.ID, null, false, true, hasInsurance, transferType); } }
public int DeleteOrder(Order o) { return DeleteOrder(o.ID); }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.OrderStatusID = OrderStatus.Constant.ORDER_FILLED; ord.Save(); BindApprovedOrders(); } else if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.PICK_LIST_GENERATED) { ord.ReleaseReservation(); ord.OrderStatusID = OrderStatus.Constant.ORDER_FILLED; ord.Save(); BindApprovedOrders(); } transaction.CommitTransaction(); } catch(Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; //HCMISLoader.MarkAsDirtyUsingOrderID(_orderID, NewMainWindow.UserId, true); if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnReturnToApprovalStep_Click(object sender, EventArgs e) { //int ordId = Convert.ToInt32(gridApprovedOrdersView.GetFocusedDataRow()["ID"].ToString()); MyGeneration.dOOdads.TransactionMgr transaction = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { transaction.BeginTransaction(); Order ord = new Order(); ord.LoadByPrimaryKey(_orderID); if (ord.RowCount > 0 && ord.OrderStatusID == OrderStatus.Constant.ORDER_APPROVED) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED,CurrentContext.UserId);; BindApprovedOrders(); } transaction.CommitTransaction(); this.LogActivity("Return-Pick-List-To-Approval", ord.ID); } catch(Exception exp) { transaction.RollbackTransaction(); throw exp; } gridPickListDetail.DataSource = null; if (BLL.Settings.IsCenter) { XtraMessageBox.Show("The Issue Order List has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("The Pick list has been returned to approval stage", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnSubmitWishlist_Click(object sender, EventArgs e) { DataRow dr = gridRequisitionListView.GetFocusedDataRow(); if (dr != null) { int orderID = Convert.ToInt32(dr["ID"]); Order ord = new Order(); ord.LoadByPrimaryKey(orderID); if (ord.OrderStatusID == OrderStatus.Constant.DRAFT_WISHLIST) { ord.ChangeStatus(OrderStatus.Constant.ORDER_FILLED,CurrentContext.UserId); LoadRequisitions(); XtraMessageBox.Show("Your requisisition has been submitted.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("This requisition has already been submitted, you cannot resubmit it.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }
public void EditRequisition(int orderID) { OrderID = orderID; Order ord = new Order(); ord.LoadByPrimaryKey(orderID); txtRefNo.Text = ord.RefNo; txtLetterNumber.Text = ord.LetterNo; labelControl4.Text = ord.RefNo; Institution ru = new Institution(); ru.LoadByPrimaryKey(ord.RequestedBy); if (!ru.IsColumnNull("Zone")) { // Just because the region Property on the Receiving Unit is not working as desired. Zone zone = new Zone(); zone.LoadByPrimaryKey(ru.Zone); lkRegion.EditValue = zone.RegionId; lkZone.EditValue = ru.Zone; } lkForFacility.EditValue = ru.ID; lkModes.EditValue = ord.FromStore; lkModes_EditValueChanged(null, null); lkPaymentType.EditValue = ord.PaymentTypeID; txtContactPerson.EditValue = ord.ContactPerson; BLL.OrderDetail or = new BLL.OrderDetail(); or.LoadAllByOrderID(orderID); DataView selectables = (DataView)gridItemChoiceView.DataSource; if (_dtSelectedTable != null) { _dtSelectedTable.Clear(); } else { PopulateItemsList(); } while (!or.EOF) { // select the items and put it in the dtselected table. if (selectables != null) { DataRow[] dataRows = selectables.Table.Select(String.Format("ID = {0} and UnitID = {1}", or.ItemID, or.UnitID)); if (dataRows.Length > 0) { _dtSelectedTable.ImportRow(dataRows[0]); dataRows[0]["IsSelected"] = true; } } or.MoveNext(); } _dvOrderTable = or.DefaultView; orderGrid.DataSource = _dvOrderTable; EnableDisableButtons(); }
/// <summary> /// Handles the Click event of the btnConfirmIssue control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> /// <exception cref="System.Exception"></exception> private void btnConfirmIssue_Click(object sender, EventArgs e) { // This is where the Issue is actually recorded and the stv is printed. // Do all kinds of validations. XtraReport STVReport = null; XtraReport DeliveryNoteReport = null; btnConfirmIssue1.Enabled = false; if (!IssueValid()) { XtraMessageBox.Show("Please Correct the Items Marked in Red before Proceeding with Issue", "Errors", MessageBoxButtons.OK, MessageBoxIcon.Error); btnConfirmIssue1.Enabled = (BLL.Settings.UseNewUserManagement && this.HasPermission("Print-Invoice")) ? true : (!BLL.Settings.UseNewUserManagement); return; } if (XtraMessageBox.Show("Are You Sure, You want to save this Transaction?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DateTimePickerEx dtDate = ConvertDate.GetCurrentEthiopianDateText(); DateTime dtCurrent = ConvertDate.DateConverter(dtDate.Text); // The User is now sure that the STV has to be printed and that // the order is also good to save. // This is the section that does the saving. BLL.Order order = new Order(); order.LoadByPrimaryKey(_orderID); // what are the pick lists, do we have devliery notes too? DataView dv = _dvOutstandingPickList; DataTable dvUnpriced = new DataTable(); DataTable dvPriced = dv.ToTable(); if (BLL.Settings.HandleGRV) { if (BLL.Settings.IsCenter) dv.RowFilter = "(Cost is null or Cost=0)"; else dv.RowFilter = "DeliveryNote = true and (Cost is null or Cost=0)"; dvUnpriced = dv.ToTable(); dv.RowFilter = "Cost is not null and Cost <> 0"; dvPriced = dv.ToTable(); } else { dvPriced = dv.ToTable(); } string stvPrinterName = ""; string deliveryNotePrinter = ""; if (!ConfirmPrinterSettings(dvPriced, dvUnpriced, out stvPrinterName, out deliveryNotePrinter)) return; bool saveSuccessful = false; MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr(); try { if (dvPriced.Rows.Count == 0 && dvUnpriced.Rows.Count == 0) throw new Exception("The Items doesn’t meet the requirement: please check the price status for non-delivery notes!"); mgr.BeginTransaction(); if (dvPriced.Rows.Count > 0) { STVReport = SaveAndPrintSTV(dvPriced.DefaultView, false, stvPrinterName, dtDate, dtCurrent); } if (dvUnpriced.Rows.Count > 0) { DeliveryNoteReport = SaveAndPrintSTV(dvUnpriced.DefaultView, true, deliveryNotePrinter, dtDate, dtCurrent); } var ordr = new Order(); ordr.LoadByPrimaryKey(_orderID); if (!ordr.IsColumnNull("OrderTypeID") && (ordr.OrderTypeID == BLL.OrderType.CONSTANTS.ACCOUNT_TO_ACCOUNT_TRANSFER || ordr.OrderTypeID == BLL.OrderType.CONSTANTS.STORE_TO_STORE_TRANSFER)) { var transfer = new Transfer(); DateTime convertedEthDate = ConvertDate.DateConverter(dtDate.Text); transfer.CommitAccountToAccountTransfer(ordr.ID, CurrentContext.UserId, convertedEthDate); } mgr.CommitTransaction(); saveSuccessful = true; } catch (Exception exp) { mgr.RollbackTransaction(); //Removed the reset logic //MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgrReset(); XtraMessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); ErrorHandler.Handle(exp); saveSuccessful = false; } if (saveSuccessful) { if (STVReport != null) { if (InstitutionIType.IsVaccine(GeneralInfo.Current)) { for (int i = 0; i < BLL.Settings.STVCopies; i++) { STVReport.Print(stvPrinterName); } } else { STVReport.Print(stvPrinterName); } } if (DeliveryNoteReport != null) { DeliveryNoteReport.Print(deliveryNotePrinter); } XtraMessageBox.Show("Transaction Successfully Saved!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } btnConfirmIssue1.Enabled = (BLL.Settings.UseNewUserManagement && this.HasPermission("Print-Invoice")) ? true : (!BLL.Settings.UseNewUserManagement); BindOutstandingPicklists(); gridOutstandingPicklistDetail.DataSource = null; PalletLocation.GarbageCollection(); if (BLL.Settings.AllowOnlineOrders) { Helpers.RRFServiceIntegration.SubmitOnlineIssue(_orderID); } } }
public List<Order> GetOrders() { List<Order> orders = new List<Order>(); DataSet ds = new DataSet(); DataSetTableAdapters.ordersTableAdapter adapter = new DataSetTableAdapters.ordersTableAdapter(); adapter.Fill(ds.orders); DataSet.ordersDataTable table = adapter.GetOrderData(); // load all orders into the list foreach (DataSet.ordersRow row in table.Rows) { // create memory for new order & fill in properties Order o = new Order(); o.ID = row.orderId; o.CatalogId = row.catalogId; o.ClientId = row.clientId; o.PaymentId = row.paymentId; o.OrderDate = row.orderDate; o.Details = row.details; o.Price = row.price; // add this order to the list orders.Add(o); } // returns the list w/ 0 or more Orders return orders; }
/// <summary> /// Formats the cash invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCashInvoice_Larger(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { string activityName = txtConfirmFromStore.Text; bool hasInsurnance = chkIncludeInsurance.Checked; return WorkflowReportFactory.CreateCashInvoice(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName, true, null); }
private static void ConfirmFacilityApprovdOrder(int hcmisOrderID) { var tsvc = new ServiceOrderClient(); var issuedList = new Collection<Issuance>(); BLL.Order order = new Order(); order.LoadByPrimaryKey(hcmisOrderID); var collOrders = new Collection<int>(); while (!order.EOF) { collOrders.Add(order.HCTSReferenceID); order.MoveNext(); } try { tsvc.ConfirmFacilityApprovedOrders(GetBranchID(), collOrders, PlitsUserName, PlitsPassword); } catch (Exception e) { throw e; } }
/// <summary> /// Formats the credit invoice. /// </summary> /// <param name="ord">The ord.</param> /// <param name="dvPriced">The dv priced.</param> /// <param name="rus">The rus.</param> /// <param name="pl">The pl.</param> /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param> /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param> /// <exception cref="System.Exception"></exception> private XtraReport FormatCreditInvoice_Smaller(DataTable dvPriced, Order ord, PickList pl, Institution rus, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService) { string activityName = txtConfirmFromStore.Text; bool hasInsurnance = chkIncludeInsurance.Checked; return WorkflowReportFactory.CreateCreditInvoiceSmaller(dvPriced, ord, pl, rus, deliveryNote, hasInsurnance, activityName); }
// Get Order and order Detail private static Collection<int> GetapprovedOrderIDs() { var orderIDs = new Collection<int>(); var o = new Order(); foreach (var order in o.GetPLITSApprovedOrders(CurrentContext.UserId, Mode.Constants.RDF)) { orderIDs.Add(Convert.ToInt32(o.ID)); } return orderIDs; }
/// <summary> /// Issues the valid. /// </summary> /// <returns></returns> private bool IssueValid() { //check approved against // check if the order has not alrady been printed Order Order = new Order(); Order.LoadByPrimaryKey(_orderID); if (Order.OrderStatusID < OrderStatus.Constant.PICK_LIST_CONFIRMED) { XtraMessageBox.Show("Order is not yet ready for printing Invoice"); return false; } else if (Order.OrderStatusID == OrderStatus.Constant.ISSUED) { XtraMessageBox.Show("This Order has already been printed. Please select another one."); return false; } else if (Order.OrderStatusID == OrderStatus.Constant.CANCELED) { XtraMessageBox.Show("This Order has been canceled. Please select another one."); return false; } bool valid = true; DataView pl = gridOutstandingPicklistDetail.DataSource as DataView; foreach (DataRowView drv in pl) { ReceiveDoc rd = new ReceiveDoc(); drv.Row.ClearErrors(); if (drv["SKUPICKED"] == null || drv["SKUPICKED"] == DBNull.Value) { drv.Row.SetColumnError("SKUPICKED", @"Field cannot be left empty"); valid = false; } else if (Convert.ToInt32(drv["SKUPICKED"]) > Convert.ToInt32(drv["SKUTOPICK"])) { drv.Row.SetColumnError("SKUPICKED", @"You cannot issue more amount than the Approved Quantity"); valid = false; } else if (BLL.Settings.BlockWhenExpectingPriceChange && BLL.ReceiveDoc.DoesPriceNeedToBeChanged(int.Parse(drv["StoreID"].ToString()), int.Parse(drv["ItemID"].ToString()), int.Parse(drv["UnitID"].ToString()), int.Parse(drv["ManufacturerID"].ToString())) && Convert.ToInt32(drv["SKUPICKED"]) > 0) //rd.IsInNonPricedItemsList(int.Parse(drv["ItemID"].ToString())) && Convert.ToInt32(drv["SKUPICKED"]) > 0) { drv.Row.SetColumnError("FullItemName", @"Price Pending!"); Item itm = new Item(); itm.LoadByPrimaryKey(int.Parse(drv["ItemID"].ToString())); XtraMessageBox.Show(string.Format("The item {0} cannot be issued because it is waiting for price change.", itm.FullItemName), "Price Pending", MessageBoxButtons.OK, MessageBoxIcon.Warning); valid = false; } } if (Order.PaymentTypeID != PaymentType.Constants.CASH && Order.PaymentTypeID != PaymentType.Constants.CREDIT && Order.PaymentTypeID != PaymentType.Constants.STV) { //TODO: This needs to be handled well. XtraMessageBox.Show( string.Format("PaymentTypeID has a problem. The order has a payment type id of {0}", Order.PaymentTypeID.ToString()), "Payment Type ID Problem"); btnConfirmIssue1.Enabled = (BLL.Settings.UseNewUserManagement && this.HasPermission("Print-Invoice")) ? true : (!BLL.Settings.UseNewUserManagement); valid = false; } if (valid) { valid = dxValidationProvider1.Validate(); } return valid; }
public void Save(Domain.Request _request,int userID, Domain.OrderStatus orderStatus = Domain.OrderStatus.Submitted) { var order = new Order(); order.LoadByPrimaryKey(_request.RequestID); var dborderStatus = new BLL.OrderStatus(); dborderStatus.LoadByCode(EnumService<Domain.OrderStatus>.GetCode(orderStatus)); order.ChangeStatus(dborderStatus.ID,CurrentContext.UserId); order.ApprovedBy = userID; order.ApprovedDate = DateTimeHelper.ServerDateTime; var orderDetail = new OrderDetail(); orderDetail.LoadAllByOrderID(_request.RequestID); while (!orderDetail.EOF) { var requestDetail = _request.RequestDetails.SingleOrDefault(r => r.RequestDetailId == orderDetail.ID); if(requestDetail== null) { orderDetail.MarkAsDeleted(); } else { //Set Activity if (requestDetail.ActivityGroup != null) { orderDetail.StoreID = requestDetail.ActivityGroup.Activity.ActivityID; orderDetail.DeliveryNote = requestDetail.ActivityGroup.IsDeliveryNote; } else { orderDetail.SetColumnNull("StoreID"); } //Set Manufacturer if (requestDetail.Manufacturer != null) { orderDetail.PreferredManufacturerID = requestDetail.Manufacturer.ManufacturerID; } else { orderDetail.SetColumnNull("PreferredManufacturerID"); } //Set PhysicalStore if (requestDetail.physicalStore != null) { orderDetail.PreferredPhysicalStoreID = requestDetail.physicalStore.PhysicalStoreID; } else { orderDetail.SetColumnNull("PreferredPhysicalStoreID"); } //Set ExpiryDate if (requestDetail.ExpiryDate.HasValue) { orderDetail.PreferredExpiryDate = requestDetail.ExpiryDate.Value; } else { orderDetail.SetColumnNull("PreferredExpiryDate"); } orderDetail.ApprovedQuantity = requestDetail.ApprovedQuantity; orderDetail.StockedOut = requestDetail.StockedOut; } orderDetail.MoveNext(); } foreach (var requestDetail in _request.RequestDetails.Where(r => r.RequestDetailId == 0).ToList()) { orderDetail.AddNew(); orderDetail.ItemID = requestDetail.Item.ItemID; orderDetail.UnitID = requestDetail.Unit.UnitID; orderDetail.Pack = requestDetail.RequestedQuantity; orderDetail.OrderID = order.ID; orderDetail.QtyPerPack = 1; orderDetail.Quantity = requestDetail.RequestedQuantity; orderDetail.ApprovedQuantity = requestDetail.ApprovedQuantity; orderDetail.StockedOut = requestDetail.StockedOut; if (requestDetail.ActivityGroup != null) { orderDetail.StoreID = requestDetail.ActivityGroup.Activity.ActivityID; orderDetail.DeliveryNote = requestDetail.ActivityGroup.IsDeliveryNote; } else { orderDetail.SetColumnNull("StoreID"); } //Set Manufacturer if (requestDetail.Manufacturer != null) { orderDetail.PreferredManufacturerID = requestDetail.Manufacturer.ManufacturerID; } else { orderDetail.SetColumnNull("PreferredManufacturerID"); } //Set PhysicalStore if (requestDetail.physicalStore != null) { orderDetail.PreferredPhysicalStoreID = requestDetail.physicalStore.PhysicalStoreID; } else { orderDetail.SetColumnNull("PreferredPhysicalStoreID"); } //Set ExpiryDate if (requestDetail.ExpiryDate.HasValue) { orderDetail.PreferredExpiryDate = requestDetail.ExpiryDate.Value; } else { orderDetail.SetColumnNull("PreferredExpiryDate"); } } order.Save(); orderDetail.Save(); }