用户物料分组权限表模块,按F7返回物料分组信息改为可选择多行返回数据
2个文件已修改
121 ■■■■ 已修改文件
SCM/Gy_UserMaterGroupRelation.cs 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/系统类/ClsCLD_MaterGroup_View.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/Gy_UserMaterGroupRelation.cs
@@ -665,21 +665,25 @@
                            oMaterGroup.WherePart = "";
                            string DeWhere = "";
                            //DeWhere = " and HUSEORGID = " + ClsPub1.HOrgID;
                            if (oMaterGroup.RefreshView())
                            //返回多行记录
                            if (oMaterGroup.RefreshViewMul())
                            {
                                //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;
                                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;
SCM/ϵͳÀà/ClsCLD_MaterGroup_View.cs
@@ -11,6 +11,7 @@
        
        //
        public DBUtility.ClsGy_Base_Model omodel = new DBUtility.ClsGy_Base_Model();
        public List<DBUtility.ClsGy_Base_Model> omodelList = new List<DBUtility.ClsGy_Base_Model>();
        //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); 
        SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
@@ -243,6 +244,72 @@
            }
        }
        /// <summary>
        /// åŸºç¡€èµ„料帮助-返回多个项目型
        /// </summary>
        /// <returns></returns>
        public override bool RefreshViewMul()
        {
            try
            {//
                oWeb.Url = ClsPub1.WEBSURL;
                SCM.frmHlpInfo_View ofrm = new SCM.frmHlpInfo_View();
                string sSQL = SQLName + SQLWhere + SQLOrder;
                //编辑ofrm
                ofrm.sTitle = MvarReportTitle;
                ofrm.sBill = MvarItemKey;
                ofrm.txtFindInfo.Text = WherePart;
                //
                DataSet Ds;
                Ds = oWeb.getDataSetBySQL(sSQL, MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    return false;
                }
                //绑定
                ofrm.grdShow.DataSource = Ds.Tables[0].DefaultView;
                Ds.Dispose();
                Ds = null;
                ofrm.grdShow.SuspendLayout();
                ofrm.grdShow.Columns[0].Visible = false;
                ofrm.ShowDialog();
                //
                if (ofrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
                {
                    if (ofrm.grdShow.SelectedRows == null)
                    {
                        return false;
                    }
                    else
                    {
                        omodelList.Clear();
                        for (int i = 0; i < ofrm.grdShow.SelectedRows.Count; i++)
                        {
                            oModel = new DBUtility.ClsGy_Base_Model();
                            oModel.HItemID = Pub_Class.ClsPub.isLong(ofrm.grdShow.Rows[ofrm.grdShow.SelectedRows[i].Index].Cells[0].Value);
                            oModel.HNumber = Pub_Class.ClsPub.isStrNull(ofrm.grdShow.Rows[ofrm.grdShow.SelectedRows[i].Index].Cells[1].Value);
                            oModel.HName = Pub_Class.ClsPub.isStrNull(ofrm.grdShow.Rows[ofrm.grdShow.SelectedRows[i].Index].Cells[2].Value);
                            omodelList.Add(oModel);
                        }
                    }
                }
                else
                {
                    return false;
                }
                //
                ofrm.Dispose();
                ofrm = null;
                //
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
    }
}