public SortedDictionary <int, MaterielProOccupiedInfo> getMaterielProOccupiedList()
        {
            m_materielProlist.Clear();

            SortedDictionary <int, MaterielProOccupiedOrderTable> list =
                MaterielProOccupiedOrder.getInctance().getAllReviewMaterielProOccupiedOrderInfo();

            for (int index = 0; index < list.Count; index++)
            {
                MaterielProOccupiedOrderTable record = new MaterielProOccupiedOrderTable();
                record = (MaterielProOccupiedOrderTable)list[index];

                SortedDictionary <int, MaterielProOccupiedOrderDetailsTable> listDetails =
                    MaterielProOccupiedOrderDetails.getInctance().getMaterielProOccupiedInfoFromBillNumber(record.billNumber);

                for (int index2 = 0; index2 < listDetails.Count; index2++)
                {
                    MaterielProOccupiedOrderDetailsTable recordDeatils = new MaterielProOccupiedOrderDetailsTable();
                    recordDeatils = (MaterielProOccupiedOrderDetailsTable)listDetails[index2];

                    addDeatisToList(recordDeatils.materielID, record.applyStaffName, recordDeatils.value);
                }
            }

            return(m_materielProlist);
        }
Пример #2
0
        public MaterielProOccupiedOrderTable getMaterielProOccupiedOrderInfoFromBillNumber(string billNumber)
        {
            MaterielProOccupiedOrderTable record = new MaterielProOccupiedOrderTable();

            foreach (KeyValuePair <int, MaterielProOccupiedOrderTable> index in m_tableDataList)
            {
                if (index.Value.billNumber == billNumber)
                {
                    record = index.Value;
                    return(record);
                }
            }

            return(null);
        }
Пример #3
0
        public bool checkBillIsExist(string billNumber)
        {
            bool isRet = false;

            foreach (KeyValuePair <int, MaterielProOccupiedOrderTable> index in m_tableDataList)
            {
                MaterielProOccupiedOrderTable record = new MaterielProOccupiedOrderTable();

                if (index.Value.billNumber == billNumber)
                {
                    isRet = true;
                    break;
                }
            }

            return(isRet);
        }
Пример #4
0
        public SortedDictionary <int, MaterielProOccupiedOrderTable> getAllNotReviewMaterielProOccupiedOrderInfo()
        {
            SortedDictionary <int, MaterielProOccupiedOrderTable> list = new SortedDictionary <int, MaterielProOccupiedOrderTable>();

            foreach (KeyValuePair <int, MaterielProOccupiedOrderTable> index in m_tableDataList)
            {
                MaterielProOccupiedOrderTable record = new MaterielProOccupiedOrderTable();
                record = index.Value;

                if (index.Value.isReview != "1")
                {
                    list.Add(list.Count, index.Value);
                }
            }

            return(list);
        }
Пример #5
0
        private void load()
        {
            string sql = "SELECT [PKEY],[TRADING_DATE],[BILL_NUMBER],[EXCHANGES_UNIT],[SUM_VALUE],[SUM_MONEY],[MAKE_ORDER_STAFF],[APPLY_STAFF]";

            sql += ",[ORDERR_REVIEW],[REVIEW_DATE],[IS_REVIEW] ";
            sql += " FROM [dbo].[WAREHOUSE_MANAGEMENT_PRO_OCCUPIED] ORDER BY PKEY";

            m_tableDataList.Clear();

            using (DataTable dataTable = DatabaseAccessFactoryInstance.Instance.QueryDataTable(FormMain.DB_NAME, sql))
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    MaterielProOccupiedOrderTable record = new MaterielProOccupiedOrderTable();

                    record.pkey          = DbDataConvert.ToInt32(row["PKEY"]);
                    record.tradingDate   = DbDataConvert.ToDateTime(row["TRADING_DATE"]).ToString("yyyy-MM-dd");
                    record.billNumber    = DbDataConvert.ToString(row["BILL_NUMBER"]);
                    record.exchangesUnit = DbDataConvert.ToString(row["EXCHANGES_UNIT"]);

                    record.sumValue = DbDataConvert.ToString(row["SUM_VALUE"]);
                    record.sumMoney = DbDataConvert.ToString(row["SUM_MONEY"]);

                    record.makeOrderStaff     = DbDataConvert.ToInt32(row["MAKE_ORDER_STAFF"]);
                    record.makeOrderStaffName = Staff.getInctance().getStaffNameFromPkey(record.makeOrderStaff);

                    record.applyStaffId   = DbDataConvert.ToInt32(row["APPLY_STAFF"]);
                    record.applyStaffName = Staff.getInctance().getStaffNameFromPkey(record.applyStaffId);

                    record.makeOrderStaff     = DbDataConvert.ToInt32(row["MAKE_ORDER_STAFF"]);
                    record.makeOrderStaffName = Staff.getInctance().getStaffNameFromPkey(record.makeOrderStaff);

                    record.isReview = DbDataConvert.ToString(row["IS_REVIEW"]);

                    if (DbDataConvert.ToString(row["ORDERR_REVIEW"]).Length > 0)
                    {
                        record.orderrReview     = DbDataConvert.ToInt32(row["ORDERR_REVIEW"]);
                        record.orderrReviewName = Staff.getInctance().getStaffNameFromPkey(record.orderrReview);
                        record.reviewDate       = DbDataConvert.ToDateTime(row["REVIEW_DATE"]).ToString("yyyy-MM-dd");
                    }

                    m_tableDataList.Add(m_tableDataList.Count, record);
                }
            }
        }
Пример #6
0
        public void insert(MaterielProOccupiedOrderTable record, bool isDisplayMessageBox = true)
        {
            MaterielProOccupiedOrderTable oldRecord = new MaterielProOccupiedOrderTable();

            string insert = "INSERT INTO [dbo].[WAREHOUSE_MANAGEMENT_PRO_OCCUPIED]([TRADING_DATE],[BILL_NUMBER],[EXCHANGES_UNIT],[SUM_VALUE],[SUM_MONEY],";

            insert += "[MAKE_ORDER_STAFF],[APPLY_STAFF]) VALUES(";

            // 根据单据编号,判断库中是否已经存在该单据 如果存在单据首先删除单据,然后再执行插入操作
            if (checkBillIsExist(record.billNumber))
            {
                delete(record.billNumber);
            }

            insert += "'" + record.tradingDate + "',";
            insert += "'" + record.billNumber + "',";
            insert += "'" + record.exchangesUnit + "',";
            insert += "'" + record.sumValue + "',";
            insert += "'" + record.sumMoney + "',";

            insert += record.makeOrderStaff + ",";
            insert += record.applyStaffId + ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);

                if (isDisplayMessageBox)
                {
                    MessageBoxExtend.messageOK("数据保存成功");
                }

                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }

            writeOperatorLog(306, OperatorLogType.Add, record.billNumber);
        }