Пример #1
0
        private void TaskList_Load(object sender, EventArgs e)
        {
            DataGridViewTranslation.LoadMainColHeader(dgviewnone);
            DataGridViewTranslation.LoadDetailColHeader(dgviewnonedetail);

            dgviewnonedetail.DataSource = null;


            SortingLineTaskList sortingLineTaskList1 = SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("3", true, AppUtil._SortingLineId, "desc"));

            dgviewnone.DataSource = sortingLineTaskList1;
        }
Пример #2
0
        public void LoadOrder()
        {
            if (chkisall.Checked)
            {
                dgviewnonedetail.DataSource = null;
                dgvIssueddetail.DataSource  = null;
                dgviewfindetail.DataSource  = null;

                dgviewnone.DataSource = m_nonSortingLineTaskList = SortingLineTaskList.GetNonSortingLineTaskList(true);

                dgviewfin.DataSource         =
                    m_finSortingLineTaskList =
                        SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("2", true, AppUtil._SortingLineId, "desc"));

                dgvIssued.DataSource            =
                    m_issuedSortingLineTaskList =
                        SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("1", true, AppUtil._SortingLineId, "desc"));
            }
            else
            {
                dgviewnonedetail.DataSource = null;
                dgvIssueddetail.DataSource  = null;
                dgviewfindetail.DataSource  = null;

                dgviewnone.DataSource = m_nonSortingLineTaskList = SortingLineTaskList.GetNonSortingLineTaskList(false);

                dgviewfin.DataSource         =
                    m_finSortingLineTaskList =
                        SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("2", false, AppUtil._SortingLineId, "desc"));

                dgvIssued.DataSource            =
                    m_issuedSortingLineTaskList =
                        SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("1", false, AppUtil._SortingLineId, "desc"));
            }
            footSumLabel1.Sumdata();
            footSumLabel2.Sumdata();
            footSumLabel3.Sumdata();
        }
Пример #3
0
        private void SetFinDynamicBox()
        {
            try
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new Action(SetFinDynamicBox));
                }



                int indexno    = 0;
                int rowindexno = 0;

                //获取混合仓中已分拣完成的卷烟列表
                SortingLineTaskList sortingLineTaskList = SortingLineTaskList.GetFinSortingLineTaskList(new QueryCondition("2", true, AppUtility.AppUtil._SortingLineId, "desc"));


                //得到最新完成的流水号
                if (sortingLineTaskList.Count > 0)
                {
                    indexno = sortingLineTaskList[0].INDEXNO;
                }

                //重置列表
                foreach (DataGridViewRow row in dgvybDynamicBox.Rows)
                {
                    row.DefaultCellStyle.BackColor = Color.White;
                    row.Cells["outputnum"].Value   = "";
                }

                //将混仓显示列表中的已完成卷烟背景色显示为灰色
                for (int i = dgvybDynamicBox.Rows.Count - 1; i >= 0; i--)
                {
                    if (Convert.ToInt16(dgvybDynamicBox.Rows[i].Cells[0].Value) <= indexno)
                    {
                        dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.DarkGray;
                        //row.Cells["outputnum"].Value = "";
                    }
                    else
                    {
                        //控制滚动条的显示位置
                        if (dgvybDynamicBox.Rows[i].Index - 10 >= 0)
                        {
                            dgvybDynamicBox.FirstDisplayedScrollingRowIndex = dgvybDynamicBox.Rows[i].Index - 10;
                        }
                        else
                        {
                            dgvybDynamicBox.FirstDisplayedScrollingRowIndex = 0;
                        }
                        //获取表格中已分拣完成混仓烟位置
                        rowindexno = dgvybDynamicBox.Rows[i].Index;
                        break;
                    }
                }


                //将混仓显示列表中的已完成卷烟背景色显示为灰色
                //foreach (DataGridViewRow row in dgvybDynamicBox.Rows)
                //{
                //    if (Convert.ToInt16(row.Cells[0].Value) <= indexno)
                //    {
                //        row.DefaultCellStyle.BackColor = Color.DarkGray;
                //        //row.Cells["outputnum"].Value = "";
                //    }
                //    else
                //    {
                //        //控制滚动条的显示位置
                //        if (row.Index >= 6)
                //        {
                //            dgvybDynamicBox.FirstDisplayedScrollingRowIndex = row.Index - 6 ;
                //        }
                //        else
                //        {
                //            dgvybDynamicBox.FirstDisplayedScrollingRowIndex = row.Index - row.Index;
                //        }
                //        //获取表格中已分拣完成混仓烟位置
                //        rowindexno = row.Index;
                //        break;
                //    }
                //}

                //在皮带上的混仓卷烟数量
                sortingtaskarrive = SortingTaskArrive.GetSortingTaskArrive("0");
                int outputnum = Convert.ToInt32(sortingtaskarrive.Value);

                //数量大于0表示皮带上有混仓烟
                if (outputnum > 0)
                {
                    if (rowindexno - 1 > 0)
                    {
                        //对列表上的卷烟进行已分拣出的标记
                        for (int i = rowindexno; i > 0; i--)
                        {
                            if (outputnum > 0)
                            {
                                //当前行的数量小于皮带上的数量,在已打出显示当前数量
                                if (Convert.ToInt32(dgvybDynamicBox.Rows[i].Cells["InQty"].Value) <= outputnum)
                                {
                                    //将已打出的混仓烟标记为蓝色背景
                                    dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.Blue;
                                    dgvybDynamicBox.Rows[i].Cells["outputnum"].Value   = dgvybDynamicBox.Rows[i].Cells["InQty"].Value;
                                }
                                else
                                {
                                    //将已打出的混仓烟标记为蓝色背景
                                    dgvybDynamicBox.Rows[i].DefaultCellStyle.BackColor = Color.Blue;
                                    //当前行的数量大于皮带上的剩余数量,显示剩余数量
                                    dgvybDynamicBox.Rows[i].Cells["outputnum"].Value = outputnum;
                                    break;
                                }
                                //减去当前行的数量,得到剩余数量进行下一次循环
                                outputnum = outputnum - Convert.ToInt32(dgvybDynamicBox.Rows[i].Cells["InQty"].Value);
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }