zzr99
2022-04-19 22eec752e72650a42c7208397fefdcb0e61a749d
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Source_View.cs
@@ -31,19 +31,75 @@
            GC.SuppressFinalize(this);
        }
        //
        //返回项目信息
        public override bool GetInfoByID(Int64 sItemID)
        {
            DataSet DS ;
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HItemID='" + sItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count  == 0)
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    return GetInfo(DS);
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //返回项目信息    å¥¥é‚¦ä¸“用
        public bool GetInfoByID_AoBang(Int64 sItemID)
        {
            DataSet DS;
            try
            {
                Pub_Control.frmHlpInfo_View ofrm = new Pub_Control.frmHlpInfo_View();
                ofrm.sTitle = MvarReportTitle;
                ofrm.sBill = MvarItemKey;
                ofrm.txtFindInfo.Text = WherePart;
                DS = oCn.RunProcReturn("select  distinct HItemID,b.HNumber ,b.HName from Sc_ICMOBillStatus_Tmp a inner join  Gy_Source b on a.HSourceID = b.HItemID Where a.HEMPID =" + sItemID + " or a.HEMPID2 = " + sItemID + " or HEMPID3 =  " + sItemID + "", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    //绑定
                    ofrm.grdShow.DataSource = DS.Tables[0].DefaultView;
                    DS.Dispose();
                    DS = null;
                    ofrm.grdShow.SuspendLayout();
                    ofrm.grdShow.Columns[0].Visible = false;
                    ofrm.ShowDialog();
                    //得到对应列
                    int HItemIDCol = 0;
                    int HNumberCol = 1;
                    int HNameCol = 2;
                    //
                    if (ofrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
                    {
                        if (ofrm.grdShow.CurrentRow == null)
                        {
                            return false;
                        }
                        oModel = new DBUtility.ClsGy_Base_Model();
                        oModel.HItemID = Pub_Class.ClsPub.isLong(ofrm.grdShow.Rows[ofrm.grdShow.CurrentRow.Index].Cells[0].Value);
                        oModel.HNumber = Pub_Class.ClsPub.isStrNull(ofrm.grdShow.Rows[ofrm.grdShow.CurrentRow.Index].Cells[1].Value);
                        oModel.HName = Pub_Class.ClsPub.isStrNull(ofrm.grdShow.Rows[ofrm.grdShow.CurrentRow.Index].Cells[2].Value);
                    }
                    else
                    {
                        return false;
                    }
                    //
                    ofrm.Dispose();
                    ofrm = null;
                    //
                    return true;
                }
            }
            catch (Exception e)
@@ -117,6 +173,7 @@
                omodel.HBarCode = DS.Tables[0].Rows[0]["HBarCodeForBase"].ToString().Trim();
                omodel.HType = DS.Tables[0].Rows[0]["HType"].ToString().Trim();
                omodel.HEquipFileID_K3 = Convert.ToInt64(DS.Tables[0].Rows[0]["HEquipFileID_K3"]);
                //omodel.HGroupK3ID = Convert.ToInt64(DS.Tables[0].Rows[0]["HGroupK3ID"]);
                //omodel.HGroupID = Convert.ToInt64(DS.Tables[0].Rows[0]["HGroupID"]);
                //omodel.HDeptID = Convert.ToInt64(DS.Tables[0].Rows[0]["HDeptID"]);
@@ -135,6 +192,25 @@
            }
        }
        //返回项目信息    å¥¥é‚¦ä¸“用
        public bool GetInfo_AoBang(DataSet DS)
        {
            try
            {
                omodel = new Model.ClsGy_Source_Model();
                omodel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                omodel.HNumber = DS.Tables[0].Rows[0]["HNumber"].ToString().Trim();
                omodel.HName = DS.Tables[0].Rows[0]["HName"].ToString().Trim();
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        /// <summary>
        /// å¾—到默认资源根据部门