雅琪诺MES智能条码管理系统
jhz
2022-06-30 0d3b2bd4edaa7385e4ff96370c877be237af054b
SCM/±¨±í/Qk_ProcessbillMain.cs
@@ -26,6 +26,7 @@
        public const string ModName = "1250";
        public string sDlgWhere = "";  //外窗体递入
        public int selectRow = 0;
        Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
        SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
        private void yl_Click(object sender, EventArgs e)
        {
@@ -50,6 +51,7 @@
                return;
            }
            var execSql = "exec " + ViewName + " '"+ dateTimePicker1.Text + "','"+dateTimePicker2.Text+"','"+ txtHBillNo.Text + "','"+ textBox3.Text+ "','"+ textBox4.Text+ "','"+ textBox1.Text + "','"+ textBox2.Text + "'";
            oWeb.Timeout = 300000;
            DataSet DSet = oWeb.getDataSetBySQL(execSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
@@ -59,7 +61,29 @@
            }
            //
            grdMain.DataSource = DSet.Tables[0].DefaultView;
            grdMain.RowHeadersVisible = false;
            ////设置合计列
            string sTotalCol = "";
            sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet);
            string[] sT;
            sT = sTotalCol.Split(Convert.ToChar(","));
            oSumGrid.BuildTotalCols(sT);
            Total();
        }
        //合计 new
        private void Total()
        {
            if (grdMain.Rows.Count > 0 && grdMain.ColumnCount > 0)
            {
                oSumGrid.SetGridsum();
                oSumGrid.TotalAll();
            }
        }
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
@@ -152,7 +176,34 @@
        private void grdMain_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            if (e.RowIndex < grdMain.Rows.Count)
            {
                DataGridViewRow dgrSingle = grdMain.Rows[e.RowIndex];
                try
                {
                    var rowIndex = DBUtility.Xt_BaseBillFun.Fun_GetCol("订单预计交货时间", grdMain);
                    if (dgrSingle.Cells[rowIndex].Value == null)
                        return;
                    var pusTimeStr = dgrSingle.Cells[rowIndex].Value.ToString().Trim();//获取数量
                    if (string.IsNullOrEmpty(pusTimeStr))
                        return;
                    if (DateTime.Parse(pusTimeStr) < DateTime.Now)
                    {
                        // è®¾ç½®å•元格的背景色
                        dgrSingle.DefaultCellStyle.BackColor = Color.FromArgb(255, 128, 128);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
        private void Qk_ProcessbillMain_Load(object sender, EventArgs e)
        {
            oSumGrid.ogrdMain = grdMain;  //初始化 new
            oSumGrid.oGridsum = grdSum;
        }
    }
}