jhz
2023-04-03 23ccdfdf25eaa33098cd44c9bb802e5cfc65eca4
SCM/Gy_UserMaterGroupRelation.cs
@@ -385,7 +385,7 @@
        //显示单据
        public void Sub_ShowBill()
        {
            SCM.ClsCLD_BaseGD_View oMaterGroup = new SCM.ClsCLD_BaseGD_View();
            SCM.ClsCLD_MaterGroup_View oMaterGroup = new SCM.ClsCLD_MaterGroup_View();
            //判断是否存在单据
            if(BillNew.ShowBill(txtHUserID.Text,ref  ClsPub.sExeReturnInfo)==false )
            {
@@ -664,22 +664,26 @@
                        case HMaterGroupNumberCol:
                            oMaterGroup.WherePart = "";
                            string DeWhere = "";
                            DeWhere = " and HUSEORGID = " + ClsPub1.HOrgID;
                            if (oMaterGroup.RefreshView())
                            //DeWhere = " and HUSEORGID = " + ClsPub1.HOrgID;
                            //返回多行记录
                            if (oMaterGroup.RefreshViewMul())
                            {
                                //if (oMaterGroup.GetInfoByID(oMaterGroup.oModel.HItemID))
                                //{
                                grdMain.Rows[sRow].Cells[HMaterGroupIDCol].Value = oMaterGroup.omodel.HGDID.ToString();
                                grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = oMaterGroup.oModel.HNumber;
                                grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = oMaterGroup.oModel.HName;
                                int i = 0;
                                foreach (DBUtility.ClsGy_Base_Model oSub in oMaterGroup.omodelList)
                                {
                                        if (oMaterGroup.GetInfoByID(DBUtility.ClsPub.isStrNull(oSub.HItemID)))
                                        {
                                            if (sRow + i > grdMain.Rows.Count - 10)
                                        {
                                            grdMain.Rows.Add();
                                        }
                                        grdMain.Rows[sRow + i].Cells[HMaterGroupIDCol].Value = oMaterGroup.omodel.HItemID.ToString();
                                        grdMain.Rows[sRow + i].Cells[HMaterGroupNumberCol].Value = oMaterGroup.omodel.HNumber.ToString();
                                        grdMain.Rows[sRow + i].Cells[HMaterGroupNameCol].Value = oMaterGroup.omodel.HName.ToString();
                                    }
                                    i++;
                                }
                                oEdit.Text = oMaterGroup.omodel.HNumber;
                                //}
                                //else
                                //{
                                //    grdMain.Rows[sRow].Cells[HMaterGroupIDCol].Value = 0;
                                //    grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = "";
                                //    grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = "";
                                //}
                            }
                            else
                            {
@@ -687,6 +691,30 @@
                                grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = "";
                                grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = "";
                            }
                            //返回单行记录
                            //if (oMaterGroup.RefreshView())
                            //{
                            //    //if (oMaterGroup.GetInfoByID(oMaterGroup.oModel.HItemID))
                            //    //{
                            //    grdMain.Rows[sRow].Cells[HMaterGroupIDCol].Value = oMaterGroup.omodel.HItemID.ToString();
                            //    grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = oMaterGroup.oModel.HNumber;
                            //    grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = oMaterGroup.oModel.HName;
                            //    oEdit.Text = oMaterGroup.omodel.HNumber;
                            //    //}
                            //    //else
                            //    //{
                            //    //    grdMain.Rows[sRow].Cells[HMaterGroupIDCol].Value = 0;
                            //    //    grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = "";
                            //    //    grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = "";
                            //    //}
                            //}
                            //else
                            //{
                            //    grdMain.Rows[sRow].Cells[HMaterGroupIDCol].Value = 0;
                            //    grdMain.Rows[sRow].Cells[HMaterGroupNumberCol].Value = "";
                            //    grdMain.Rows[sRow].Cells[HMaterGroupNameCol].Value = "";
                            //}
                            break;
                        default:
                            break;