Exemplo n.º 1
0
        /// <summary>
        /// 订单确认排产
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_pc_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show("是否确认排产所选中的订单?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
            {
                lstwl = bll_wl.GetListLZ("");
                #region 新方法
                WaitingFrom.ShowWait("");
                if (lst.Count > 0)
                {
                    if (lst.Where(a => a.B_check).ToList().Count > 0)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (lst[i].B_check)
                            {
                                if (lst[i].B_check)
                                {
                                    decimal down_wgt = lst[i].N_WGT - lst[i].N_PROD_WGT - lst[i].N_ROLL_PROD_WGT;
                                    if (down_wgt > 0)
                                    {
                                        #region 验证订单是否有首尾炉钢种
                                        bool      flag = true;
                                        DataTable dtsl = Cls_Order_PC.GetSWLGZ(lst[i].C_STL_GRD_SLAB, lst[i].C_STD_CODE_SLAB, "首炉");
                                        if (dtsl != null && dtsl.Rows.Count > 0)
                                        {
                                            string slorder = "";//首炉生产钢种的订单
                                            for (int m = 0; m < dtsl.Rows.Count; m++)
                                            {
                                                string C_STL_GRD  = dtsl.Rows[m]["C_B_E_STOVE_STEEL"].ToString();
                                                string C_STD_CODE = dtsl.Rows[m]["C_BORDER_STD_CODE"].ToString();
                                            }
                                        }

                                        #endregion


                                        Cls_APS_PC.DownOrder(lst[i].C_ID, down_wgt);
                                    }
                                }
                            }
                        }
                        //string group = bll_plan.P_LGPLAN_GROUPING();//炼钢计划重新分组
                    }
                }
                WaitingFrom.CloseWait();
                #endregion
            }

            btn_query_order_Click(null, null);
        }