private Billing fillBill(Bill bill) { com.Sconit.Entity.Svp.Party supplier = new com.Sconit.Entity.Svp.Party(); supplier.id = bill.BillAddress.Party.Code; supplier.code = bill.BillAddress.Party.Code; supplier.description = bill.BillAddress.Party.Name; supplier.address = bill.BillAddress.Code; supplier.contact = bill.BillAddress.ContactPersonName; supplier.telephone = bill.BillAddress.TelephoneNumber; supplier.mobilephone = bill.BillAddress.MobilePhone; supplier.fax = bill.BillAddress.Fax; supplier.postCode = bill.BillAddress.PostalCode; com.Sconit.Entity.Svp.User user = new com.Sconit.Entity.Svp.User(); user.name = bill.CreateUser.Name; com.Sconit.Entity.Svp.Billing billing = new com.Sconit.Entity.Svp.Billing(); billing.partyFrom = supplier; billing.id = bill.BillNo; billing.billingNo = bill.BillNo; billing.billingDateSpecified = true; billing.billingDate = bill.CreateDate; billing.createDateSpecified = true; billing.createDate = bill.CreateDate; billing.createUser = user; return(billing); }
private RequisitionOrder fillOrderHead(OrderHead orderHead) { RequisitionOrder order = new RequisitionOrder(); com.Sconit.Entity.Svp.User createUser = new com.Sconit.Entity.Svp.User(); createUser.name = orderHead.CreateUser.Name; com.Sconit.Entity.Svp.User planner = new com.Sconit.Entity.Svp.User(); planner.name = orderHead.CreateUser.Name; com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party(); partyFrom.id = orderHead.PartyFrom.Code; partyFrom.code = orderHead.PartyFrom.Code; partyFrom.description = orderHead.PartyFrom.Name; if (orderHead.ShipFrom != null) { partyFrom.address = orderHead.ShipFrom.Address; partyFrom.contact = orderHead.ShipFrom.ContactPersonName; partyFrom.telephone = orderHead.ShipFrom.TelephoneNumber; partyFrom.mobilephone = orderHead.ShipFrom.MobilePhone; partyFrom.fax = orderHead.ShipFrom.Fax; partyFrom.postCode = orderHead.ShipFrom.PostalCode; } com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party(); partyTo.id = orderHead.PartyTo.Code; partyTo.code = orderHead.PartyTo.Code; partyTo.description = orderHead.PartyTo.Name; if (orderHead.ShipTo != null) { partyTo.address = orderHead.ShipTo.Address; partyTo.contact = orderHead.ShipTo.ContactPersonName; partyTo.telephone = orderHead.ShipTo.TelephoneNumber; partyTo.mobilephone = orderHead.ShipTo.MobilePhone; partyTo.fax = orderHead.ShipTo.Fax; partyTo.postCode = orderHead.ShipTo.PostalCode; } order.id = orderHead.OrderNo; order.requisitionOrderNo = orderHead.OrderNo; order.type = orderHead.Type; order.orderType = orderHead.SubType; order.priority = orderHead.Priority; order.createUser = createUser; order.createDate = orderHead.CreateDate; order.createDateSpecified = true; order.effectiveDate = orderHead.StartTime; order.effectiveDateSpecified = true; order.demandDeliverDate = orderHead.WindowTime; order.demandDeliverDateSpecified = true; string t = (orderHead.DockDescription == null || orderHead.DockDescription == string.Empty) ? orderHead.PartyTo.Code : orderHead.PartyTo.Code + "@" + orderHead.DockDescription; order.demandDeliverAddr = orderHead.PartyTo.Name + " " + t + " " + (orderHead.DockDescription != null ? orderHead.DockDescription : string.Empty); order.partyFrom = partyFrom; order.partyTo = partyTo; if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { order.status = "In_Process"; } else { order.status = orderHead.Status; } order.planner = planner; order.print = orderHead.IsPrinted; order.printSpecified = true; return(order); }
private RequisitionOrder fillOrderHead(OrderHead orderHead) { RequisitionOrder order = new RequisitionOrder(); com.Sconit.Entity.Svp.User createUser = new com.Sconit.Entity.Svp.User(); createUser.name = orderHead.CreateUser.Name; com.Sconit.Entity.Svp.User planner = new com.Sconit.Entity.Svp.User(); planner.name = orderHead.CreateUser.Name; com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party(); partyFrom.id = orderHead.PartyFrom.Code; partyFrom.code = orderHead.PartyFrom.Code; partyFrom.description = orderHead.PartyFrom.Name; if (orderHead.ShipFrom != null) { partyFrom.address = orderHead.ShipFrom.Address; partyFrom.contact = orderHead.ShipFrom.ContactPersonName; partyFrom.telephone = orderHead.ShipFrom.TelephoneNumber; partyFrom.mobilephone = orderHead.ShipFrom.MobilePhone; partyFrom.fax = orderHead.ShipFrom.Fax; partyFrom.postCode = orderHead.ShipFrom.PostalCode; } com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party(); partyTo.id = orderHead.PartyTo.Code; partyTo.code = orderHead.PartyTo.Code; partyTo.description = orderHead.PartyTo.Name; if (orderHead.ShipTo != null) { partyTo.address = orderHead.ShipTo.Address; partyTo.contact = orderHead.ShipTo.ContactPersonName; partyTo.telephone = orderHead.ShipTo.TelephoneNumber; partyTo.mobilephone = orderHead.ShipTo.MobilePhone; partyTo.fax = orderHead.ShipTo.Fax; partyTo.postCode = orderHead.ShipTo.PostalCode; } order.id = orderHead.OrderNo; order.requisitionOrderNo = orderHead.OrderNo; order.type = orderHead.Type; order.orderType = orderHead.SubType; order.priority = orderHead.Priority; order.createUser = createUser; order.createDate = orderHead.CreateDate; order.createDateSpecified = true; order.effectiveDate = orderHead.StartTime; order.effectiveDateSpecified = true; order.demandDeliverDate = orderHead.WindowTime; order.demandDeliverDateSpecified = true; string t = (orderHead.DockDescription == null || orderHead.DockDescription == string.Empty) ? orderHead.PartyTo.Code : orderHead.PartyTo.Code + "@" + orderHead.DockDescription; order.demandDeliverAddr = orderHead.PartyTo.Name + " " + t + " " + (orderHead.DockDescription != null ? orderHead.DockDescription : string.Empty); order.partyFrom = partyFrom; order.partyTo = partyTo; if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS) { order.status = "In_Process"; }else{ order.status = orderHead.Status; } order.planner = planner; order.print = orderHead.IsPrinted; order.printSpecified = true; return order; }
private Billing fillBill(Bill bill) { com.Sconit.Entity.Svp.Party supplier = new com.Sconit.Entity.Svp.Party(); supplier.id = bill.BillAddress.Party.Code; supplier.code = bill.BillAddress.Party.Code; supplier.description = bill.BillAddress.Party.Name; supplier.address = bill.BillAddress.Code; supplier.contact = bill.BillAddress.ContactPersonName; supplier.telephone = bill.BillAddress.TelephoneNumber; supplier.mobilephone = bill.BillAddress.MobilePhone; supplier.fax = bill.BillAddress.Fax; supplier.postCode = bill.BillAddress.PostalCode; com.Sconit.Entity.Svp.User user = new com.Sconit.Entity.Svp.User(); user.name = bill.CreateUser.Name; com.Sconit.Entity.Svp.Billing billing = new com.Sconit.Entity.Svp.Billing(); billing.partyFrom = supplier; billing.id = bill.BillNo; billing.billingNo = bill.BillNo; billing.billingDateSpecified = true; billing.billingDate = bill.CreateDate; billing.createDateSpecified = true; billing.createDate = bill.CreateDate; billing.createUser = user; return billing; }
public ReceivingNote[] getReceivingNote(GetReceivingNoteRequest request) { DetachedCriteria criteria = DetachedCriteria.For <Receipt>(); criteria.AddOrder(Order.Desc("ReceiptNo")); if (request.supplier != null && request.supplier != string.Empty) { criteria.Add(Expression.Like("PartyFrom.Name", request.supplier)); } if (request.supplierPartyCode != null && request.supplierPartyCode != string.Empty) { criteria.Add(Expression.Eq("PartyFrom.Code", request.supplierPartyCode)); } if (request.customerPartyCode != null && request.customerPartyCode != string.Empty) { criteria.Add(Expression.Eq("PartyTo.Code", request.customerPartyCode)); } if (request.customer != null && request.customer != string.Empty) { criteria.Add(Expression.Like("PartyTo.Name", request.customer)); } if (request.receivingNo != null && request.receivingNo != string.Empty) { criteria.Add(Expression.Eq("ReceiptNo", request.receivingNo)); } if (request.receiveDateFromSpecified) { criteria.Add(Expression.Ge("CreateDate", request.receiveDateFrom)); } if (request.receiveDateToSpecified) { criteria.Add(Expression.Le("CreateDate", request.receiveDateTo)); } IList <Receipt> receiptList = TheCriteriaMgr.FindAll <Receipt>(criteria); List <ReceivingNote> noteList = new List <ReceivingNote>(); ReceivingNote note = new ReceivingNote(); foreach (Receipt receipt in receiptList) { note.id = receipt.ReceiptNo; note.receivingNo = receipt.ReceiptNo; note.receiveDate = receipt.CreateDate; note.receiveDateSpecified = true; DeliveryOrder deliveryOrder = new DeliveryOrder(); deliveryOrder.deliveryOrderNo = receipt.ReferenceIpNo; note.deliveryOrder = deliveryOrder; com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party(); partyFrom.code = receipt.PartyFrom.Code; partyFrom.id = receipt.PartyFrom.Code; partyFrom.description = receipt.PartyFrom.Name; note.partyFrom = partyFrom; com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party(); partyTo.code = receipt.PartyTo.Code; partyTo.id = receipt.PartyTo.Code; partyTo.description = receipt.PartyTo.Name; note.partyTo = partyTo; com.Sconit.Entity.Svp.User receiveUser = new com.Sconit.Entity.Svp.User(); receiveUser.id = receipt.CreateUser.Code; receiveUser.name = receipt.CreateUser.Name; note.receiveUser = receiveUser; noteList.Add(note); } return(noteList.ToArray()); }
public ReceivingNote[] getReceivingNote(GetReceivingNoteRequest request) { DetachedCriteria criteria = DetachedCriteria.For<Receipt>(); criteria.AddOrder(Order.Desc("ReceiptNo")); if (request.supplier != null && request.supplier != string.Empty) { criteria.Add(Expression.Like("PartyFrom.Name", request.supplier)); } if (request.supplierPartyCode != null && request.supplierPartyCode != string.Empty) { criteria.Add(Expression.Eq("PartyFrom.Code", request.supplierPartyCode)); } if (request.customerPartyCode != null && request.customerPartyCode != string.Empty) { criteria.Add(Expression.Eq("PartyTo.Code", request.customerPartyCode)); } if (request.customer != null && request.customer != string.Empty) { criteria.Add(Expression.Like("PartyTo.Name", request.customer)); } if (request.receivingNo != null && request.receivingNo != string.Empty) { criteria.Add(Expression.Eq("ReceiptNo", request.receivingNo)); } if (request.receiveDateFromSpecified) { criteria.Add(Expression.Ge("CreateDate", request.receiveDateFrom)); } if (request.receiveDateToSpecified) { criteria.Add(Expression.Le("CreateDate", request.receiveDateTo)); } IList<Receipt> receiptList = TheCriteriaMgr.FindAll<Receipt>(criteria); List<ReceivingNote> noteList = new List<ReceivingNote>(); ReceivingNote note = new ReceivingNote(); foreach (Receipt receipt in receiptList) { note.id = receipt.ReceiptNo; note.receivingNo = receipt.ReceiptNo; note.receiveDate = receipt.CreateDate; note.receiveDateSpecified = true; DeliveryOrder deliveryOrder = new DeliveryOrder(); deliveryOrder.deliveryOrderNo = receipt.ReferenceIpNo; note.deliveryOrder = deliveryOrder; com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party(); partyFrom.code = receipt.PartyFrom.Code; partyFrom.id = receipt.PartyFrom.Code; partyFrom.description = receipt.PartyFrom.Name; note.partyFrom = partyFrom; com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party(); partyTo.code = receipt.PartyTo.Code; partyTo.id = receipt.PartyTo.Code; partyTo.description = receipt.PartyTo.Name; note.partyTo = partyTo; com.Sconit.Entity.Svp.User receiveUser = new com.Sconit.Entity.Svp.User(); receiveUser.id = receipt.CreateUser.Code; receiveUser.name = receipt.CreateUser.Name; note.receiveUser = receiveUser; noteList.Add(note); } return noteList.ToArray(); }