public static List <ReturnTypeInfo> GetAllReturnType() { string sql = @"SELECT * FROM dbo.ReturnType"; DataTable dt = DBHelper.GetTable(sql, false); List <ReturnTypeInfo> result = new List <ReturnTypeInfo>(); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { ReturnTypeInfo item = ReturnTypeInfo.BuildReturnType(row); result.Add(item); } } return(result); }
public static List <ReturnTypeInfo> getReturnType(string pin, string se) { try { string sql = string.Format(@"SELECT * FROM dbo.ReturnType where ZPRDNR='{0}' and ZCOLSN='{1}'", pin, se); DataTable dt = DBHelper.GetTable(sql, false); List <ReturnTypeInfo> result = new List <ReturnTypeInfo>(); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { ReturnTypeInfo item = ReturnTypeInfo.BuildReturnType(row); result.Add(item); } } return(result); } catch (Exception ex) { LogHelper.WriteLine(ex.ToString()); } return(null); }