1
zrg
2024-06-25 4bfab3d9173fcced07cea4afb71227b83b47c469
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationInBill.cs
@@ -17,6 +17,7 @@
        {
            InitializeComponent();
        }
        public DBUtility.frmBillQueryCondition_New frmCondition;
        public string ModName = "3790";
        public string ModCaption = "进站接收单";
        public const string ModRightName = "MES_StationInBill";
@@ -138,6 +139,7 @@
        //取消按钮
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            ClsPub.SaveGridView(grdSub, Name+"grdSub", ClsPub.AppPath);//设置列宽
            this.Close();
        }
        //控件位置
@@ -151,6 +153,7 @@
        //窗体加载
        private void Sc_StationInBill_Load(object sender, EventArgs e)
        {
            frmCondition = new DBUtility.frmBillQueryCondition_New();
            //打印初始化       
            this.Text = ModCaption;
            this.lblCaption.Text = ModCaption;
@@ -178,7 +181,7 @@
        private void Sc_StationInBill_FormClosing(object sender, FormClosingEventArgs e)
        {
            BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            //DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
            //DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name);
            DBUtility.Xt_BaseBillFun.SaveGrid(grdCardList, this.Name + "grdCardList");
        }
        //新增单据
@@ -414,7 +417,8 @@
            txtHProcNo.Enabled = false;
            //加载 é…ä»¶ç»‘定清单
            HInterID = BillOld.omodel.HInterID;
            DisplaySub();
@@ -1510,13 +1514,20 @@
                DataSet Dsplay;
                Dsplay = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay   " + HInterID.ToString() + "  ", "h_p_MES_StationInBillSub_BindDisplay");
                //写入信息
                if (Dsplay == null || Dsplay.Tables[0].Rows.Count == 0)
                if (Dsplay == null )
                {
                    MessageBox.Show("刷新失败!");
                    return;
                }
                else if(Dsplay.Tables[0].Rows.Count == 0)
                {
                    return;
                }
                else
                {
                    //释放冻结
                    DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdSub);
                    //
                    grdSub.DataSource = Dsplay.Tables[0].DefaultView;
                    //设置合计列
                    //string sTotalCol = "";
@@ -1526,9 +1537,15 @@
                    //oSumGrid.BuildTotalCols(sT);
                    //  
                    //冻结
                    int FrCol = 0;
                    string s = "是";
                    DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
                    int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
                    string s = frmCondition.cmbHComplete.Text;
                    DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol);
                    //画线
                    GraphLine();
                    //冻结
                    //int FrCol = 0;
                    //string s = "是";
                    //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
                }
            }
            catch (Exception e)
@@ -1536,5 +1553,44 @@
                MessageBox.Show(e.Message + "DisplaySub");
            }
        }
        private void GraphLine()
        {
            int MainIDCol = 0;
            int SubIDCol = 0;
            string s = frmCondition.cmbHComplete.Text;
            long n = 0;
            DBUtility.Xt_BaseBillFun.GraphLine(grdSub, MainIDCol, SubIDCol, s, ref n);
        }
        private void cmdDelLine_Click(object sender, EventArgs e)
        {
            try
            {
                //根据选择的条形码 æ¥åˆ é™¤
                if (grdSub.CurrentRow == null)
                    return;
                string sBarCode = DBUtility.ClsPub.isStrNull(grdSub.Rows[grdSub.CurrentRow.Index].Cells[Fun_GetCol("条形码")].Value);
                SQLHelper.ClsCN oCn = new ClsCN();
                oCn.RunProc(" delete from Sc_StationInBillSub_BindBarCodeTemp " +
                    "Where  HInterID = "+ HInterID.ToString() +" and HBarCode = '"+ sBarCode + "'");
                DisplaySub();
            }
            catch (Exception e1)
            {
                MessageBox.Show("删除行失败!"+e1.Message);
            }
        }
        private void cmdHbclk_Click(object sender, EventArgs e)
        {
            //保存列宽
            DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name);
        }
        private void cmdHmrlk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name);
        }
    }
}