Exemplo n.º 1
0
        public cornernode(warehouse p_warehouse, int position)
        {
            //Calculate the margin for edge cross aisle
            double margin = p_warehouse.crossaislewidth / 2;

            if (position == 1)
            {
                this.setX(0 + margin);
                this.setY(0 + margin);
            }
            if (position == 2)
            {
                this.setX(p_warehouse.width - margin);
                this.setY(0 + margin);
            }
            if (position == 3)
            {
                this.setX(p_warehouse.width - margin);
                this.setY(p_warehouse.depth - margin);
            }
            if (position == 4)
            {
                this.setX(0 + margin);
                this.setY(p_warehouse.depth - margin);
            }
        }
Exemplo n.º 2
0
        protected void view_btn_Click(object sender, EventArgs e)
        {
            ChooseCPL.ClientState         = "true";
            ChooseCPL.Collapsed           = true;
            ChooseCPL.CollapsedText       = "Search For a Different Warehouse";
            warehouseViewInfoHead.Visible = true;
            warehouseViewInfoBody.Visible = true;
            warehouseInformation_L.Text   = warehouseInformation_L_hf.Value;



            //sdsProductType.SelectCommand += "and warehouse_id = " + Convert.ToString(passWarehouseID_hf.Value);

            GlobalVariables.WarehouseID = Convert.ToInt32(passWarehouseID_hf.Value);
            warehouse = warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address   = address.Select(warehouse.address_id);
            //warehouse_product_Location = warehouse_product_Location.Select()

            name_txt.Text    = warehouse.warehouse_name.ToString();
            address_txt.Text = address.str_add.ToString() + "" + address.city.ToString() + ", " + address.state.ToString() + "" + address.zip_plus_four.ToString();
            type_txt.Text    = warehouse.warehouse_type.ToString();
            int returnValue = getWarehouseProductQty(GlobalVariables.WarehouseID);

            amountOfResources_txt.Text = Convert.ToString(returnValue);
        }
Exemplo n.º 3
0
    public string printOrder(warehouse wh)
    {
        Order  od     = new Order();
        string status = od.printOrder(wh);

        return(status);
    }
Exemplo n.º 4
0
        public bool EditParty(party oParty)
        {
            try
            {
                party ptParty = _entities.parties.Find((oParty.party_id));
                ptParty.party_name       = oParty.party_name;
                ptParty.parent_party_id  = ptParty.parent_party_id;
                ptParty.party_code       = ptParty.party_code;
                ptParty.address          = oParty.address;
                ptParty.proprietor_name  = oParty.proprietor_name;
                ptParty.phone            = oParty.phone;
                ptParty.mobile           = oParty.mobile;
                ptParty.email            = oParty.email;
                ptParty.area_id          = oParty.area_id;
                ptParty.party_type_id    = oParty.party_type_id;
                ptParty.credit_limit     = oParty.credit_limit;
                ptParty.start_date       = oParty.start_date;
                ptParty.is_active        = oParty.is_active;
                ptParty.is_deleted       = false;
                ptParty.country_id       = oParty.country_id;
                ptParty.province_id      = oParty.province_id;
                ptParty.city_id          = oParty.city_id;
                ptParty.region_id        = oParty.region_id;
                ptParty.territory_id     = oParty.territory_id;
                ptParty.credit_limit     = oParty.credit_limit;
                ptParty.updated_by       = oParty.updated_by;
                ptParty.updated_date     = DateTime.Now;
                ptParty.dealer_type_id   = oParty.dealer_type_id;
                ptParty.retailer_type_id = oParty.retailer_type_id;
                _entities.SaveChanges();

                ////Update Warehouse for Related Party
                var       kkk = _entities.warehouses.SingleOrDefault(p => p.party_id == oParty.party_id).warehouse_id;
                warehouse update_warehouse = new warehouse
                {
                    warehouse_id      = kkk,
                    warehouse_name    = oParty.party_name + " Warehouse",
                    warehouse_address = oParty.address,
                    warehouse_type    = "Physical",
                    party_id          = oParty.party_id,
                    party_type_id     = oParty.party_type_id,
                    region_id         = oParty.region_id,
                    area_id           = oParty.area_id,
                    territory_id      = oParty.territory_id,
                    is_active         = true,
                    is_deleted        = false,
                    updated_by        = oParty.updated_by,
                    created_date      = DateTime.Now
                };
                //Update warehouse

                whr.EditWarehouse(update_warehouse);
                _entities.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor of ES for non-NFT
 /// </summary>
 /// <param name="p_seed">Seed number</param>
 /// <param name="p_M">Number of parents</param>
 /// <param name="p_lambda">Number of children</param>
 /// <param name="p_size">Number of variables in a solution, this number is different between allsearch and specific design search</param>
 /// <param name="p_iteration">Maximum number of iterations</param>
 /// <param name="p_sigma">Sigma value for ES</param>
 /// <param name="p_counter">How often we should update sigma value</param>
 /// <param name="p_successrule">Success rule threshold, this is usually 0.2 (i.e., if 20 percent of the children are more successfuly than their parents then decrease sigma)</param>
 /// <param name="p_l">Lower bound array</param>
 /// <param name="p_u">Upper bound array</param>
 /// <param name="p_wh">Warehouse object</param>
 /// <param name="p_allsearch">Use all of the orders or use dynamicly increasing number of orders</param>
 /// <param name="p_computing">0 is Parallel, 1 is Distributed, 2 is Single Thread Computing</param>
 /// <param name="p_routingsolver">Routing Solver Type, Concorde, LKH, 2-Opt</param>
 public evolutionarystrategy(int p_seed, int p_M, int p_lambda, int p_size, int p_iteration, double p_sigma, int p_counter, double p_successrule, double[] p_l, double[] p_u, warehouse p_wh, bool p_allsearch, int p_computing, string p_routingsolver)
 {
     this.seed          = p_seed;
     this.M             = p_M;
     this.lambda        = p_lambda;
     this.iteration     = p_iteration;
     this.sigma         = p_sigma;
     this.counter       = p_counter;
     this.successrule   = p_successrule;
     this.size          = p_size;
     this.u             = p_u;
     this.l             = p_l;
     this.rnd           = new Random[this.M];
     this.rnd1          = new Random[this.lambda];
     this.wh            = p_wh;
     this.allsearch     = p_allsearch;
     this.computing     = p_computing;
     this.routingSolver = p_routingsolver;
     if (computing == 1)
     {
         mysocketservers = new socketservers();
         mysocketservers.checkAvailableConcordeServers();
     }
     //Use individual random numbers for each M and lambda
     for (int i = 0; i < this.M; i++)
     {
         this.rnd[i] = new Random(this.seed + i * 1000);
     }
     for (int i = 0; i < this.lambda; i++)
     {
         this.rnd1[i] = new Random(this.seed + this.M * 1000 + i * 1000);
     }
 }
        /// <summary>
        /// Converts this instance of <see cref="warehouseDto"/> to an instance of <see cref="warehouse"/>.
        /// </summary>
        /// <param name="dto"><see cref="warehouseDto"/> to convert.</param>
        public static warehouse ToEntity(this warehouseDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new warehouse();

            entity.v_WarehouseId           = dto.v_WarehouseId;
            entity.v_OrganizationId        = dto.v_OrganizationId;
            entity.v_LocationId            = dto.v_LocationId;
            entity.v_Name                  = dto.v_Name;
            entity.v_AdditionalInformation = dto.v_AdditionalInformation;
            entity.i_CostCenterId          = dto.i_CostCenterId;
            entity.i_IsDeleted             = dto.i_IsDeleted;
            entity.i_InsertUserId          = dto.i_InsertUserId;
            entity.d_InsertDate            = dto.d_InsertDate;
            entity.i_UpdateUserId          = dto.i_UpdateUserId;
            entity.d_UpdateDate            = dto.d_UpdateDate;

            dto.OnEntity(entity);

            return(entity);
        }
Exemplo n.º 7
0
    public string printOrder(warehouse wh)
    {
        WarehouseControl wc     = new WarehouseControl();
        string           status = wc.printOrder(wh);

        return(status);
    }
        /// <summary>
        /// Converts this instance of <see cref="warehouse"/> to an instance of <see cref="warehouseDto"/>.
        /// </summary>
        /// <param name="entity"><see cref="warehouse"/> to convert.</param>
        public static warehouseDto ToDTO(this warehouse entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new warehouseDto();

            dto.v_WarehouseId           = entity.v_WarehouseId;
            dto.v_OrganizationId        = entity.v_OrganizationId;
            dto.v_LocationId            = entity.v_LocationId;
            dto.v_Name                  = entity.v_Name;
            dto.v_AdditionalInformation = entity.v_AdditionalInformation;
            dto.i_CostCenterId          = entity.i_CostCenterId;
            dto.i_IsDeleted             = entity.i_IsDeleted;
            dto.i_InsertUserId          = entity.i_InsertUserId;
            dto.d_InsertDate            = entity.d_InsertDate;
            dto.i_UpdateUserId          = entity.i_UpdateUserId;
            dto.d_UpdateDate            = entity.d_UpdateDate;

            entity.OnDTO(dto);

            return(dto);
        }
        // GET: /warehouse/Delete/5
        public ActionResult Delete(int?id)
        {
            warehouse warehouse = db.warehouses.Find(id);

            db.warehouses.Remove(warehouse);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public warehouse Insert_warehouse_select(int ID)
 {
     warehouse = warehouse.Select(ID);
     Insert_warehouse_name_txt.Text = Convert.ToString(warehouse.warehouse_name);
     Insert_address_id_txt.Text = Convert.ToString(warehouse.address_id);
     Insert_warehouse_type_txt.Text = Convert.ToString(warehouse.warehouse_type);
     Insert_Location_ID_txt.Text = Convert.ToString(warehouse.Location_ID);
     return warehouse;
 }
Exemplo n.º 11
0
        public void LoadItem(int id)
        {
            _id = id;
            DataAccess da = new DataAccess();
            warehouse  b  = da.GetWarehouse(id);

            edtName.Text  = b.name;
            edtDescr.Text = b.description;
        }
Exemplo n.º 12
0
        private warehouse getItemFromFields()
        {
            warehouse item = new warehouse();

            item.id          = this._id;
            item.name        = edtName.Text;
            item.description = edtDescr.Text;
            return(item);
        }
Exemplo n.º 13
0
        }                                     // Additional column

        public static warehouseModel ToWarehouseModel(warehouse w, string itemname)
        {
            return(new warehouseModel
            {
                itemID = w.itemID,
                totalstock = w.totalstock,
                itemName = itemname
            });
        }
Exemplo n.º 14
0
 public warehouse Insert_warehouse_select(int ID)
 {
     warehouse = warehouse.Select(ID);
     Insert_warehouse_name_txt.Text = Convert.ToString(warehouse.warehouse_name);
     Insert_address_id_txt.Text     = Convert.ToString(warehouse.address_id);
     Insert_warehouse_type_txt.Text = Convert.ToString(warehouse.warehouse_type);
     Insert_Location_ID_txt.Text    = Convert.ToString(warehouse.Location_ID);
     return(warehouse);
 }
Exemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        authCode.Text = Session["AuthCode"].ToString();

        string   uname = Session["UserName"].ToString();
        Customer cm    = new Customer();
        int      cid;

        if (uname == "Guest")
        {
            cid = -1;
        }
        else
        {
            cid = cm.returnClientID(uname);
        }
        PurchaseCtrl p     = new PurchaseCtrl();
        List <cart>  carts = p.validateProduct(cid);

        foreach (cart cart in carts)
        {
            int q = Convert.ToInt32(cart.ProductId);
            p.inventoryUpdate(q, cart.Amount);
        }
        string auth = Session["AuthCode"].ToString();

        p.markOrdersAsPaid(carts, auth);
        Customer cust = new Customer();

        string wName, wAddress;

        if (cid == (-1))
        {
            guest gue = cust.getGuestDetail(1);
            wName    = gue.name;
            wAddress = gue.shippingAddress;
        }
        else
        {
            user use = cust.getUserDetail(cid);
            wName    = use.name;
            wAddress = use.address;
        }

        warehouse wh = new warehouse
        {
            paymentID       = auth,
            Name            = wName,
            shippingAddress = wAddress,
            packagingStatus = "ReadyToPacked",
            ShippingStatus  = "NotShipped",
            DeliveryStatus  = "NotDelivered"
        };
        WarehouseScreen ws     = new WarehouseScreen();
        string          report = ws.printOrder(wh);
    }
Exemplo n.º 16
0
 public ActionResult Edit(warehouse warehouse)
 {
     if (ModelState.IsValid)
     {
         db.Entry(warehouse).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(warehouse));
 }
        public IActionResult Update(warehouse Warehouse)
        {
            if (!ModelState.IsValid)
            {
                return(View(Warehouse));
            }
            _repository.Update(Warehouse);

            return(RedirectToAction("List"));
        }
Exemplo n.º 18
0
        private void LoadWarehouses()
        {
            DataAccess       da = new DataAccess();
            List <warehouse> l  = da.GetWarehouses();
            warehouse        w  = new warehouse();

            w.name = "Все склады";
            l.Add(w);
            edtWarehouse.DataContext  = l;
            edtWarehouse.SelectedItem = w;
        }
Exemplo n.º 19
0
        public ActionResult Create(warehouse warehouse)
        {
            if (ModelState.IsValid)
            {
                db.warehouses.Add(warehouse);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(warehouse));
        }
        public IActionResult Update(int id)
        {
            warehouse Warehouse = _repository.GetById(id);

            if (Warehouse == null)
            {
                return(NotFound());
            }

            return(View(Warehouse));
        }
Exemplo n.º 21
0
 public warehouse warehouse_insert()
 {
     warehouse.warehouse_name = Insert_warehouse_name_txt.Text;
     warehouse.address_id     = Convert.ToInt32(Insert_address_id_txt.Text);
     warehouse.warehouse_type = Insert_warehouse_type_txt.Text;
     warehouse.Location_ID    = Convert.ToInt32(Insert_Location_ID_txt.Text);
     warehouse = warehouse.Insert(warehouse);
     Insert_warehouse_GridView.DataBind();
     Update_warehouse_GridView.DataBind();
     Delete_warehouse_GridView.DataBind();
     return(warehouse);
 }
Exemplo n.º 22
0
        // GET: /warehouse/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            warehouse warehouse = db.warehouses.Find(id);

            if (warehouse == null)
            {
                return(HttpNotFound());
            }
            return(View(warehouse));
        }
Exemplo n.º 23
0
 public warehouse warehouse_update(int ID)
 {
     warehouse = warehouse.Select(ID);
     warehouse.warehouse_id   = Convert.ToInt32(Update_warehouse_id_txt.Text);
     warehouse.warehouse_name = Update_warehouse_name_txt.Text;
     warehouse.address_id     = Convert.ToInt32(Update_address_id_txt.Text);
     warehouse.warehouse_type = Update_warehouse_type_txt.Text;
     warehouse.Location_ID    = Convert.ToInt32(Update_Location_ID_txt.Text);
     warehouse.Update(warehouse);
     Insert_warehouse_GridView.DataBind();
     Update_warehouse_GridView.DataBind();
     Delete_warehouse_GridView.DataBind();
     return(warehouse);
 }
Exemplo n.º 24
0
        public ActionResult insertLog(int itemID, int totalnumber, int reasonID)
        {
            String description = _reasonRepository.getDescription(reasonID);
            String itemName    = _itemRepository.GetItemName(itemID);

            log       newlog       = _logRepository.insertLog(itemID, totalnumber, description);
            warehouse newwarehouse = _warehouseRepository.UpdateWarehouse(itemID, totalnumber, description);

            logModel.logString lm = logModel.ToLogString(newlog, itemName);
            warehouseModel     wm = warehouseModel.ToWarehouseModel(newwarehouse, itemName);

            return(Json(new
            {
                lm
            }));
        }
Exemplo n.º 25
0
        public bool setwarehouse(warehouseViewModel warehouse)
        {
            warehouse asset = new warehouse();

            asset.Device_ID     = warehouse.Device_ID;
            asset.Device_Name   = warehouse.Device_Name;
            asset.Device_Type   = warehouse.Device_Type;
            asset.Processor     = warehouse.Processor;
            asset.Purchase_Date = warehouse.Purchase_Date;
            asset.Remarks       = warehouse.Remarks;
            asset.Serial_No     = warehouse.Serial_No;
            asset.Status        = warehouse.Status;
            employeecontext.warehouses.Add(asset);
            employeecontext.SaveChanges();
            return(true);
        }
Exemplo n.º 26
0
    public string printOrder(warehouse wh)
    {
        try
        {
            autopartsEntities db = new autopartsEntities();

            db.warehouses.Add(wh);
            db.SaveChanges();

            return("success");
        }
        catch (Exception e)
        {
            return("Error :" + e);
        }
    }
Exemplo n.º 27
0
 public bool DeleteWarehouse(long warehouse_id, long?updated_by)
 {
     try
     {
         warehouse whwarehouse = _entities.warehouses.FirstOrDefault(w => w.warehouse_id == warehouse_id);
         whwarehouse.is_deleted   = true;
         whwarehouse.updated_by   = updated_by;
         whwarehouse.updated_date = DateTime.Now;
         _entities.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 28
0
        private void AddToWarehouse(object sender, RoutedEventArgs e)
        {
            if (ProductsBox.SelectedValue == null)
            {
                MessageBox.Show("Выберите продукт для добавления на склад", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            try
            {
                Convert.ToInt32(QuantityField.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(QuantityField.Text + " - не целое число", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            producttable prod     = table.FirstOrDefault(f => f.Name == (string)ProductsBox.SelectedValue);
            int          quantity = Convert.ToInt32(QuantityField.Text);
            warehouse    whItem   = new warehouse()
            {
                producttable = prod, Quantity = quantity
            };
            warehouse exItem = MainWindow.Database.warehouse.FirstOrDefault(f => f.id_product == prod.id);

            if (exItem == null)
            {
                MainWindow.Database.warehouse.Add(whItem);
            }
            else
            {
                exItem.Quantity += quantity;
                whItem           = exItem;
            }

            warehouse_operations whop = new warehouse_operations()
            {
                ChangeTime    = DateTime.Now,
                id_warehouse  = whItem.id,
                QuantityDelta = quantity
            };

            MainWindow.Database.warehouse_operations.Add(whop);

            MainWindow.Database.SaveChanges();
        }
 public Order_Product Order_Product_insert()
 {
     //loop through each product_id in the product_id_array and insert each time
     for (int i = 0; i < product_id_array.Length; i++)
     {
         warehouse_product_location = warehouse_product_location.Select_By_Product_ID(Convert.ToInt32(product_id_array[i]));
         warehouse                 = warehouse.Select(warehouse_product_location.warehouse_id);
         Order_Product.orderID     = Convert.ToInt32(requestor_Order.OrderID);
         Order_Product.ProductID   = Convert.ToInt32(product_id_array[i]);
         Order_Product.Quantity    = 1;
         Order_Product.warehouseid = warehouse.warehouse_id;
         Order_Product.DatePicked  = DateTime.Now;
         Order_Product.Qtypicked   = 1;
         Order_Product             = Order_Product.Insert(Order_Product);
     }
     return(Order_Product);
 }
        protected void updateDatabase()
        {
            //product_id_array has all product ids
            call_center        = call_center.Select(Convert.ToInt32(DDL_Call_Center.SelectedValue));
            selected_Warehouse = selected_Warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address            = address.Select(selected_Warehouse.address_id);

            //case_intake
            case_intake = case_intake_insert();
            //encounter
            encounter = encounter_insert();
            //requestor
            requestor = requestor_insert();
            //requestor_Order
            requestor_Order = requestor_Order_insert();
            //Order_product
            Order_Product = Order_Product_insert();
        }
Exemplo n.º 31
0
        public long AddWarehouse(warehouse warehouse)
        {
            try
            {
                // generate warehouse Code
                long WarehouseSerial = _entities.warehouses.Max(rq => (long?)rq.warehouse_id) ?? 0;

                if (WarehouseSerial != 0)
                {
                    WarehouseSerial++;
                }
                else
                {
                    WarehouseSerial++;
                }
                var    whStr         = WarehouseSerial.ToString().PadLeft(7, '0');
                string warehouseCode = "WH-" + whStr;

                warehouse insert_warehouse = new warehouse
                {
                    warehouse_name    = warehouse.warehouse_name,
                    warehouse_code    = warehouseCode,
                    warehouse_address = warehouse.warehouse_address,
                    warehouse_type    = warehouse.warehouse_type,
                    party_id          = 1,
                    party_type_id     = 1,
                    region_id         = warehouse.region_id,
                    area_id           = warehouse.area_id,
                    territory_id      = warehouse.territory_id,
                    created_by        = warehouse.created_by,
                    is_active         = warehouse.is_active,
                    created_date      = DateTime.Now
                };
                _entities.warehouses.Add(insert_warehouse);
                _entities.SaveChanges();
                long last_insert_id = insert_warehouse.warehouse_id;
                return(last_insert_id);
            }
            catch (Exception)
            {
                return(0);
            }
        }
 public warehouse warehouse_update(int ID)
 {
     warehouse = warehouse.Select(ID);
     warehouse.warehouse_id = Convert.ToInt32(Update_warehouse_id_txt.Text);
     warehouse.warehouse_name = Update_warehouse_name_txt.Text;
     warehouse.address_id = Convert.ToInt32(Update_address_id_txt.Text);
     warehouse.warehouse_type = Update_warehouse_type_txt.Text;
     warehouse.Location_ID = Convert.ToInt32(Update_Location_ID_txt.Text);
     warehouse.Update(warehouse);
     Insert_warehouse_GridView.DataBind();
     Update_warehouse_GridView.DataBind();
     Delete_warehouse_GridView.DataBind();
     return warehouse;
 }
 protected void Insert_Select_Record(object sender, EventArgs e)
 {
     warehouse = Insert_warehouse_select(Convert.ToInt32(Insert_warehouse_GridView.SelectedValue));
 }
 protected void UPDATE(object sender, EventArgs e)
 {
     warehouse = warehouse_update(Convert.ToInt32(Update_warehouse_GridView.SelectedValue));
 }
 protected void Update_Select_Record(object sender, EventArgs e)
 {
     warehouse = Update_warehouse_select(Convert.ToInt32(Update_warehouse_GridView.SelectedValue));
 }
 public warehouse warehouse_insert()
 {
     warehouse.warehouse_name = Insert_warehouse_name_txt.Text;
     warehouse.address_id = Convert.ToInt32(Insert_address_id_txt.Text);
     warehouse.warehouse_type = Insert_warehouse_type_txt.Text;
     warehouse.Location_ID = Convert.ToInt32(Insert_Location_ID_txt.Text);
     warehouse = warehouse.Insert(warehouse);
     Insert_warehouse_GridView.DataBind();
     Update_warehouse_GridView.DataBind();
     Delete_warehouse_GridView.DataBind();
     return warehouse;
 }
        protected void view_btn_Click(object sender, EventArgs e)
        {
            ChooseCPL.ClientState = "true";
            ChooseCPL.Collapsed = true;
            ChooseCPL.CollapsedText = "Search For a Different Warehouse";
            warehouseViewInfoHead.Visible = true;
            warehouseViewInfoBody.Visible = true;
            warehouseInformation_L.Text = warehouseInformation_L_hf.Value;

            //sdsProductType.SelectCommand += "and warehouse_id = " + Convert.ToString(passWarehouseID_hf.Value);

            GlobalVariables.WarehouseID = Convert.ToInt32(passWarehouseID_hf.Value);
            warehouse = warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(warehouse.address_id);
            //warehouse_product_Location = warehouse_product_Location.Select()

            name_txt.Text = warehouse.warehouse_name.ToString();
            address_txt.Text = address.str_add.ToString() + "" + address.city.ToString() + ", " + address.state.ToString() + "" + address.zip_plus_four.ToString();
            type_txt.Text = warehouse.warehouse_type.ToString();
            int returnValue = getWarehouseProductQty(GlobalVariables.WarehouseID);
            amountOfResources_txt.Text = Convert.ToString(returnValue);
        }
 public Order_Product Order_Product_insert()
 {
     //loop through each product_id in the product_id_array and insert each time
     for (int i = 0; i < product_id_array.Length; i++)
     {
         warehouse_product_location = warehouse_product_location.Select_By_Product_ID(Convert.ToInt32(product_id_array[i]));
         warehouse = warehouse.Select(warehouse_product_location.warehouse_id);
         Order_Product.orderID = Convert.ToInt32(requestor_Order.OrderID);
         Order_Product.ProductID = Convert.ToInt32(product_id_array[i]);
         Order_Product.Quantity = 1;
         Order_Product.warehouseid = warehouse.warehouse_id;
         Order_Product.DatePicked = DateTime.Now;
         Order_Product.Qtypicked = 1;
         Order_Product = Order_Product.Insert(Order_Product);
     }
     return Order_Product;
 }
        protected void createEmail()
        {
            call_center = call_center.Select(Convert.ToInt32(DDL_Call_Center.SelectedValue));
            selected_Warehouse = selected_Warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(selected_Warehouse.address_id);
            //email
            callcenter_Address = call_center.call_center_name + "<br />" + "(219) 564 5567";// +address.str_add + "<br />" + address.city + " " + address.state + " " + address.zip_plus_four + "<br />" + "(219) 564 5567";

            NameOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Product Name: </b><br/><br/>";
            TypeOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Type: </b><br/><br/>";
            DescriptionOrderData = "<td colspan='1' width='10%' align='left' style='height: 87px'>" + "<b>Item Discription: </b><br/><br/>";

            for (int i = 0; i < EName.Count; i++)
            {
                NameOrderData += EName[i] + "<br/>";
                TypeOrderData += EType[i] + "<br/>";
                DescriptionOrderData += EDescription[i] + "<br/>";
            }

            NameOrderData += "</td>";
            TypeOrderData += "</td>";
            DescriptionOrderData += "</td>";

            var result = string.Join("|", EName.ToArray());

            var message = new MailMessage("*****@*****.**", "*****@*****.**");
            // here is an important part:

            message.Subject = result + " -Has just been assigned a new location";
            message.Body =
            "<Table><tr><tb><b><font size='3'>The following product has been assigned a new location:</b></font></td></tr></table>" +

            "<table id='Table1' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td colspan='12' align='left' style='border-style: none'>" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +

                        "<tr>" +
                            "<td rowspan='3' align='left' valign='top'>" +
                                "<font size='6' color='red'>DMCS</font>" +
                                "<br />" +
                                "Disaster Management Communication System" +
                                "<br />" +
                                "<br />" +
                                "<b>This order was placed at: </b><br />" +
                                callcenter_Address +
                            "</td>" +
                            "<td align='right' style='font-size: x-large; color: #808080; font-family: 'Times New Roman'; font-weight: bold;'>" + "<b>INVOICE</b>" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td>" +
                                "<br />" +
                                "<br />" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                            "<td align='right' style='color: #000000'>" +
                                "<b>Invoice/Case/Order</b> #3" +
                                "<br />" +
                                Convert.ToString(System.DateTime.Now) +
                            "</td>" +
                        "</tr>" +

                    "</table>" +

                    "<table id='Table2' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td width='50%' align='left'>" +
                                "<b>Shipping To:</b>" + "<br />" +
                                "United States Steel Corporation" + "<br />" +
                                "1 Broadway" + "<br />" +
                                "Gary,IN" + "<br />" +
                                "(219) 888-2000" + "<br />" +
                            "</td>" +

                            "<td width='50%' align='left'>" +
                                "<b>Shiping From:</b>" + "<br />" +
                                selected_Warehouse.warehouse_name + "<br />" +
                                address.str_add + "<br />" +
                                address.city + " " + address.state + " " + address.zip_plus_four + "<br />" +
                                "(219) 564 5567" + "<br />" +

                            "</td>" +
                        "</tr>" +
                    "</table>" +

                    "<table id='Table7' width='100%' cellspacing='10' bgcolor='Silver'>" +
                        "<tr>" +
                            "<td colspan='10' width='100%' align='left'>" +
                                "<br />" +
                                "<b>ORDER:</b>" +
                            "<br />" +
                            "</td>" +
                        "</tr>" +
                        "<tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +
                        "<tr>" +
                            NameOrderData +
                            TypeOrderData +
                            DescriptionOrderData +
                        "</tr>" +
                        "<tr>" +
                            "<td colspan='12' style='background-color: Gray' height='5px'>" + "</td>" +
                        "</tr>" +
                        "<tr>" +

                    "</table>" +
                "<table><tr><tb></td></tr>" +
                "<tr><tb><br/><br/><br/><br/>DO NOT RESPOND TO THIS MESSAGE." + "</td></tr>" +
                "<tr><tb>THIS WAS A AUTOMATED MESSAGE SENT FROM THE DMSC SERVERS. </td></tr></table>";

            //Set html to true! This allows for more then just a string with no breaks.
            message.IsBodyHtml = true;
            var client = new SmtpClient();
            client.EnableSsl = true;
            client.Send(message);
            /////////////////////////////////////////////////////// EMAIL SENT
        }
        protected void createInvoicePreview()
        {
            //create invoice preview

            final_invoice_div.Style.Add("display", "block");

            FINAL_to_Name_L.Text = selected_Warehouse.warehouse_name;
            FINAL_to_CompanyName_L.Text = selected_Warehouse.warehouse_name;
            FINAL_to_StreetAddress_L.Text = address.str_add;
            FINAL_to_CityStateZip_L.Text = address.city + " " + address.state + " " + address.zip_plus_four;

            FINAL_caseNumber_L.Text = "Case #/Order #: " + case_intake.case_id + " / " + requestor_Order.OrderID;
            FINAL_date_L.Text = Convert.ToString(DateTime.Now);

            for (int i = 0; i < product_id_array.Length; i++)
            {
                products = products.Select(Convert.ToInt32(product_id_array[i]));
                warehouse_product_location = warehouse_product_location.Select_By_Product_ID(products.product_id);
                warehouse = warehouse.Select(warehouse_product_location.warehouse_id);
                checkWarehouseIDs.Add(warehouse.warehouse_id);
                for (int j = 0; j < checkWarehouseIDs.Count; j++)
                {
                    if (warehouse.warehouse_id != checkWarehouseIDs[j] || checkWarehouseIDs.Count == 1)
                    {
                        selectedWarehouseIDs.Add(warehouse.warehouse_id);
                    }
                }

                int itemNum = i + 1;
                FINAL_orderNum_div.InnerHtml += itemNum + "<br/>";
                FINAL_ProductID_and_WarehouseID_div.InnerHtml += products.product_id + " / " + warehouse.warehouse_id + "<br/>";
                FINAL_orderQTY_div.InnerHtml += 1 + "<br/>";
                FINAL_orderDESCRIPTION_div.InnerHtml += products.product_name + "<br/>";

            }
            FINAL_from_Name_L.Text = "";
            FINAL_from_CompanyName_L.Text = "";
            FINAL_from_StreetAddress_L.Text = "";
            FINAL_from_CityStateZip_L.Text = "";
            for (int k = 0; k < selectedWarehouseIDs.Count; k++)
            {
                warehouse = warehouse.Select(selectedWarehouseIDs[k]);
                address = address.Select(warehouse.address_id);
                if (selectedWarehouseIDs[k] == selectedWarehouseIDs.Count - 1 && selectedWarehouseIDs.Count > 0)
                {
                    FINAL_from_Name_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name + " | ";
                    FINAL_from_CompanyName_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name + " | ";
                    FINAL_from_StreetAddress_L.Text += selectedWarehouseIDs[k] + ": " + address.str_add + " | ";
                    FINAL_from_CityStateZip_L.Text += selectedWarehouseIDs[k] + ": " + address.city + " " + address.state + " " + address.zip_plus_four + " | ";
                }
                else if (selectedWarehouseIDs[k] != selectedWarehouseIDs.Count - 1 && selectedWarehouseIDs.Count > 0)
                {
                    FINAL_from_Name_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name;
                    FINAL_from_CompanyName_L.Text += selectedWarehouseIDs[k] + ": " + warehouse.warehouse_name;
                    FINAL_from_StreetAddress_L.Text += selectedWarehouseIDs[k] + ": " + address.str_add;
                    FINAL_from_CityStateZip_L.Text += selectedWarehouseIDs[k] + ": " + address.city + " " + address.state + " " + address.zip_plus_four;
                }
                else
                {
                    FINAL_from_Name_L.Text += warehouse.warehouse_name;
                    FINAL_from_CompanyName_L.Text += warehouse.warehouse_name;
                    FINAL_from_StreetAddress_L.Text += address.str_add;
                    FINAL_from_CityStateZip_L.Text += address.city + " " + address.state + " " + address.zip_plus_four;
                }
            }
            placeOrder_div.Style.Add("display", "none");
        }
        protected void updateDatabase()
        {
            //product_id_array has all product ids
            call_center = call_center.Select(Convert.ToInt32(DDL_Call_Center.SelectedValue));
            selected_Warehouse = selected_Warehouse.Select(Convert.ToInt32(passWarehouseID_hf.Value));
            address = address.Select(selected_Warehouse.address_id);

            //case_intake
            case_intake = case_intake_insert();
            //encounter
            encounter = encounter_insert();
            //requestor
            requestor = requestor_insert();
            //requestor_Order
            requestor_Order = requestor_Order_insert();
            //Order_product
            Order_Product = Order_Product_insert();
        }
 protected void INSERT(object sender, EventArgs e)
 {
     warehouse = warehouse_insert();
 }