Esempio n. 1
0
        /// <summary>
        /// DropDownForLabelPath
        /// Calls [usp_dropdown_LabelPath]
        /// </summary>
        public override List <LabelPathDetails> DropDownForPrinter(System.Int32?clientId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_dropdown_LabelPath", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId;
                cn.Open();
                DbDataReader            reader = ExecuteReader(cmd);
                List <LabelPathDetails> lst    = new List <LabelPathDetails>();
                while (reader.Read())
                {
                    LabelPathDetails obj = new LabelPathDetails();
                    obj.LabelPathId   = GetReaderValue_Int32(reader, "LabelPathId", 0);
                    obj.LabelFullPath = GetReaderValue_String(reader, "LabelFullPath", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Label Path", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Call [usp_selectAll_LabelPath_for_Client]
        /// </summary>
        /// <param name="clientId"></param>
        /// <returns></returns>
        public override List <LabelPathDetails> GetListForClient(System.Int32?clientId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_LabelPath_for_Client", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@ClientId", SqlDbType.Int).Value = clientId;
                cn.Open();
                DbDataReader            reader = ExecuteReader(cmd);
                List <LabelPathDetails> lst    = new List <LabelPathDetails>();
                while (reader.Read())
                {
                    LabelPathDetails obj = new LabelPathDetails();
                    obj.LabelPathId   = GetReaderValue_Int32(reader, "LabelPathId", 0);
                    obj.LabelFullPath = GetReaderValue_String(reader, "LabelFullPath", "");
                    obj.Description   = GetReaderValue_String(reader, "Description", "");
                    obj.Inactive      = GetReaderValue_Boolean(reader, "Inactive", false);
                    obj.ClientNo      = GetReaderValue_Int32(reader, "ClientNo", 0);
                    obj.UpdatedBy     = GetReaderValue_Int32(reader, "UpdatedBy", 0);
                    obj.DLUP          = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            }
            catch (SqlException sqlex)
            {
                //LogException(sqlex);
                throw new Exception("Failed to get List", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }