Пример #1
0
        public TempMaterial GetTempMaterialByTempNo(string TempMaterialNo)
        {
            try
            {
                TempMaterial TM = new TempMaterial();

                string strSql = string.Format("select * from T_TEMPMATERIAL where TEMPMATERIALNO = '{0}'", TempMaterialNo);

                using (SqlDataReader dr = OperationSql.ExecuteReader(System.Data.CommandType.Text, strSql))
                {
                    while (dr.Read())
                    {
                        TM.TempMaterialNo   = dr["TEMPMATERIALNO"].ToString();
                        TM.TempMaterialDesc = dr["TEMPMATERIALDESC"].ToString();
                        TM.MaterialNo       = dr["MATERIALNO"].ToString();
                        TM.MaterialDesc     = dr["MATERIALDESC"].ToString();
                        return(TM);
                    }
                }
                return(null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public bool GetTempMaterialByTempNo(string strMaterialDoc, ref TempMaterial tm, ref string strErrMsg)
        {
            bool bSucc = false;

            strErrMsg = string.Empty;
            TempMaterial_DB db = new TempMaterial_DB();

            try
            {
                tm = db.GetTempMaterialByTempNo(strMaterialDoc);
                if (tm != null)
                {
                    bSucc = true;
                }
                return(bSucc);
            }
            catch (Exception ex)
            {
                bSucc     = false;
                strErrMsg = ex.Message;
                return(bSucc);
            }
        }