Exemplo n.º 1
0
        private static MamutOrder GetDatesFromMamut(Iorderheader orderheader)
        {
            List <MamutOrder> list = new List <MamutOrder>();

            SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionStringMamut"].ConnectionString);
            SqlDataSource sqlDataSource = new SqlDataSource();

            sqlDataSource.ConnectionString = sqlConnection.ConnectionString;

            sqlDataSource.SelectCommand = "SELECT [LINKID], [STATUSID] , [ORDERID], [CONTNAME], [ADRDELIV], [DATEDELIV], [DATEPROD], [REFYOUR], [LORDERPICKED]  FROM [G_ORDER] WHERE LINKID = '" + orderheader.Linkid + "'";
            sqlDataSource.DataBind();

            IEnumerable iteratorObject = sqlDataSource.Select
                                             (DataSourceSelectArguments.Empty);

            try
            {
                list.AddRange(from DataRowView record in iteratorObject
                              select new MamutOrder(
                                  Convert.ToInt32(record["LINKID"].ToString()), Convert.ToInt32(record["STATUSID"].ToString()), Convert.ToInt32(record["ORDERID"].ToString()), record["CONTNAME"].ToString(), record["ADRDELIV"].ToString(), record["DATEDELIV"].ToString(), record["DATEPROD"].ToString(), record["REFYOUR"].ToString(), Convert.ToBoolean(record["LORDERPICKED"].ToString())));
            }
            catch
            {
                return(null);
            }


            return(list[0]);
        }
Exemplo n.º 2
0
        private static MamutOrder GetDatesFromMamut(Iorderheader orderheader)
        {
            List<MamutOrder> list = new List<MamutOrder>();

            SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionStringMamut"].ConnectionString);
            SqlDataSource sqlDataSource = new SqlDataSource();
            sqlDataSource.ConnectionString = sqlConnection.ConnectionString;

            sqlDataSource.SelectCommand = "SELECT [LINKID], [STATUSID] , [ORDERID], [CONTNAME], [ADRDELIV], [DATEDELIV], [DATEPROD], [REFYOUR], [LORDERPICKED]  FROM [G_ORDER] WHERE LINKID = '" + orderheader.Linkid + "'";
            sqlDataSource.DataBind();

            IEnumerable iteratorObject = sqlDataSource.Select
                (DataSourceSelectArguments.Empty);

            try
            {
                list.AddRange(from DataRowView record in iteratorObject
                              select new MamutOrder(
                                  Convert.ToInt32(record["LINKID"].ToString()), Convert.ToInt32(record["STATUSID"].ToString()), Convert.ToInt32(record["ORDERID"].ToString()), record["CONTNAME"].ToString(), record["ADRDELIV"].ToString(), record["DATEDELIV"].ToString(), record["DATEPROD"].ToString(), record["REFYOUR"].ToString(), Convert.ToBoolean(record["LORDERPICKED"].ToString())));
            }
            catch
            {
                return null;
            }

            return list[0];
        }