Пример #1
0
        /**作者:周雅雯 修改时间:2016/7/30
         * 入库按钮对应的操作
         */
        public Boolean inStorage(string receipt_no)
        {
            //1.比较暂收数量(Rec_Qty)和允收量,若不相等则把入库量(deliver_qty)修改为允收量(Accepted_qty)
            Receive_mtlDC receive_dc1 = new Receive_mtlDC();
            Boolean       flag1       = receive_dc1.CompareRec_QtyAndAccepted_qty(receipt_no);

            //2.修改庫存總表庫存量,庫存明細表里對應的料號+datecode 的數量
            Receive_mtlDC receive_dc2 = new Receive_mtlDC();
            Boolean       flag2       = receive_dc2.updateOnhand_quantiyAndOnhand_qtyByReceipt_no(receipt_no);

            //通过暂收单号获取入库量
            Receive_mtlDC receive_dc3 = new Receive_mtlDC();
            int           deliver_qty = receive_dc3.getDeliver_qtyByReceipt_no(receipt_no);

            if (deliver_qty == -1)  //获取入库量失败时
            {
                return(false);
            }

            //3.在交易表中插入入庫信息
            Transaction_operationDC transaction_operationdc = new Transaction_operationDC();
            DateTime transaction_time = DateTime.Now;
            Boolean  flag3            = transaction_operationdc.insertTransaction_operation(deliver_qty, "ruku", transaction_time);

            if (flag1 == true && flag2 == true && flag3 == true)  //当且仅当三个操作都满足要求时,返回true
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }