Пример #1
0
        public static List<InventoryBody> getInventoryBodyByInventoryId(int Inventory_id)
        {
            List<InventoryBody> lst = new List<InventoryBody>();

            try
            {
                InventoryBodyProvider pr = new InventoryBodyProvider();
                DataSet ds = pr.getByInventoryId(Inventory_id);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    InventoryBody o = new InventoryBody();
                    o.id = int.Parse(ds.Tables[0].Rows[i]["id_Inventorybody"].ToString());
                    o.del = bool.Parse(ds.Tables[0].Rows[i]["del"].ToString());
                    o.guid = ds.Tables[0].Rows[i]["guid"].ToString();
                    o.Inventory_id = Inventory_id;
                    o.number = ds.Tables[0].Rows[i]["order_number"].ToString();
                    o.found = bool.Parse(ds.Tables[0].Rows[i]["order_found"].ToString());
                    o.status = ds.Tables[0].Rows[i]["order_status"].ToString();
                    o.status_t = ds.Tables[0].Rows[i]["order_status_t"].ToString();
                    o.status_fact = ds.Tables[0].Rows[i]["order_status_fact"].ToString();
                    o.status_fact_t = ds.Tables[0].Rows[i]["order_status_fact_t"].ToString();
                    if (ds.Tables[0].Rows[i]["order_in"].ToString() != "")
                        o.date_in = DateTime.Parse(ds.Tables[0].Rows[i]["order_in"].ToString());
                    if (ds.Tables[0].Rows[i]["order_out"].ToString() != "")
                        o.date_out = DateTime.Parse(ds.Tables[0].Rows[i]["order_out"].ToString());
                    o.action = ds.Tables[0].Rows[i]["order_action"].ToString();
                    o.action_t = ds.Tables[0].Rows[i]["order_action_t"].ToString();
                    o.usr = new Photoland.Security.User.UserInfo();
                    o.usr.Id_user = int.Parse(ds.Tables[0].Rows[i]["order_user"].ToString());
                    o.exported = bool.Parse(ds.Tables[0].Rows[i]["exported"].ToString());

                    lst.Add(o);

                }
            }
            catch (Exception ex)
            {
            }

            return lst;
        }