예제 #1
0
        private static void SubmitBranchIssues(int hcmisOrderID)
        {
            var tsvc       = new ServiceOrderClient();
            var issuedList = new Collection <Issuance>();

            BLL.OrderDetail hcmisOrderDetail = new OrderDetail();
            hcmisOrderDetail.LoadOrderDetailsWithIssueAndPicklistForPLITS(hcmisOrderID);

            while (!hcmisOrderDetail.EOF)
            {
                var issuance = new Issuance
                {
                    DateIssued            = Convert.ToDateTime(hcmisOrderDetail.GetColumn("EurDate")),
                    ApprovedOrderDetailId = Convert.ToInt32(hcmisOrderDetail.GetColumn("HACTOrderDetailID")),
                    QuantityIssued        = Convert.ToInt32(hcmisOrderDetail.GetColumn("NoOfPack"))
                };
                issuedList.Add(issuance);
                hcmisOrderDetail.MoveNext();
            }


            var validationmessage = tsvc.SubmitBranchIssues(issuedList, PlitsUserName, PlitsPassword);

            XtraMessageBox.Show(validationmessage[0].Message, "Issuance", MessageBoxButtons.OK);
        }
예제 #2
0
        /// <summary>
        /// This function gives the previous order from the one specified in the parameter
        /// </summary>
        /// <param name="orderId">The order that gets returned is going to be the one just previous to this order.</param>
        /// <param name="facilityId">The facility ID</param>
        /// <returns></returns>
        public DataTable GetLastOrderDetailByFacility(int orderId, int facilityId)
        {
            var query = HCMIS.Repository.Queries.OrderDetail.SelectLastOrderDetailByFacility(orderId, facilityId);

            this.LoadFromRawSql(query);
            this.AddColumn("LastApprovedQuantity", typeof(decimal));
            this.AddColumn("LastRequestedQuantity", typeof(decimal));
            this.AddColumn("LastRequestedDate", typeof(DateTime));
            while (!this.EOF)
            {
                var oDetail          = new OrderDetail();
                var querylastdetails = HCMIS.Repository.Queries.OrderDetail.SelectQueryLastDetails(this.ItemID, this.UnitID, (int)this.GetColumn("RequestedBy"));
                oDetail.LoadFromRawSql(querylastdetails);
                if (oDetail.RowCount > 0)
                {
                    this.SetColumn("LastApprovedQuantity", oDetail.GetColumn("LastApprovedQuantity"));
                    this.SetColumn("LastRequestedQuantity", oDetail.GetColumn("LastRequestedQuantity"));
                    this.SetColumn("LastRequestedDate", oDetail.GetColumn("LastRequestedDate"));
                }
                this.MoveNext();
            }
            return(this.DataTable);
        }
예제 #3
0
 private bool IsApprovalValid()
 {
     //Let's see if there are rows with identical preferrence
     BLL.OrderDetail validatedOrder = new OrderDetail();
     validatedOrder.ValidateOrderDetailForIdenticalPreference(_orderID);
     if (validatedOrder.RowCount > 0)
     {
         XtraMessageBox.Show(
             string.Format(
                 "The item {0} has a split entries with the same preference.  Please correct that to approve the order.",
                 validatedOrder.GetColumn("FullItemName").ToString()));
         return(false);
     }
     return(true);
 }
 private bool IsApprovalValid()
 {
     //Let's see if there are rows with identical preferrence
     BLL.OrderDetail validatedOrder = new OrderDetail();
     validatedOrder.ValidateOrderDetailForIdenticalPreference(_orderID);
     if (validatedOrder.RowCount > 0)
     {
         XtraMessageBox.Show(
             string.Format(
                 "The item {0} has a split entries with the same preference.  Please correct that to approve the order.",
                 validatedOrder.GetColumn("FullItemName").ToString()));
         return false;
     }
     return true;
 }
        // Submit Branch and Facility Issues
        private static void SubmitFacilityIssues(int hcmisOrderID)
        {
            var tsvc = new ServiceOrderClient();
            var issuedList = new Collection<Issuance>();

            BLL.OrderDetail hcmisOrderDetail = new OrderDetail();
            hcmisOrderDetail.LoadOrderDetailsWithIssueAndPicklistForPLITS(hcmisOrderID);

            while (!hcmisOrderDetail.EOF)
            {
                var issuance = new Issuance
                                 {
                                     DateIssued = Convert.ToDateTime(hcmisOrderDetail.GetColumn("EurDate")),
                                     ApprovedOrderDetailId = Convert.ToInt32(hcmisOrderDetail.GetColumn("HACTOrderDetailID")),
                                     QuantityIssued = Convert.ToInt32(hcmisOrderDetail.GetColumn("NoOfPack"))
                                 };
                issuedList.Add(issuance);
                hcmisOrderDetail.MoveNext();
            }

            var validationmessage = tsvc.SubmitFacilityIssues(GetBranchID(), issuedList, PlitsUserName, PlitsPassword);
            XtraMessageBox.Show(validationmessage[0].Message, "Issuance", MessageBoxButtons.OK);
        }