Esempio n. 1
0
        private void BindData()
        {
            Warehouse warehouse = WarehouseManager.GetWarehouseById(this.WarehouseId);

            if (warehouse != null)
            {
                this.txtName.Text          = warehouse.Name;
                this.txtPhoneNumber.Text   = warehouse.PhoneNumber;
                this.txtEmail.Text         = warehouse.Email;
                this.txtFaxNumber.Text     = warehouse.FaxNumber;
                this.txtAddress1.Text      = warehouse.Address1;
                this.txtAddress2.Text      = warehouse.Address2;
                this.txtCity.Text          = warehouse.City;
                this.txtStateProvince.Text = warehouse.StateProvince;
                this.txtZipPostalCode.Text = warehouse.ZipPostalCode;
                CommonHelper.SelectListItem(this.ddlCountry, warehouse.CountryId);
                this.pnlCreatedOn.Visible = true;
                this.pnlUpdatedOn.Visible = true;
                this.lblCreatedOn.Text    = DateTimeHelper.ConvertToUserTime(warehouse.CreatedOn, DateTimeKind.Utc).ToString();
                this.lblUpdatedOn.Text    = DateTimeHelper.ConvertToUserTime(warehouse.UpdatedOn, DateTimeKind.Utc).ToString();
            }
            else
            {
                this.pnlCreatedOn.Visible = false;
                this.pnlUpdatedOn.Visible = false;
            }
        }
Esempio n. 2
0
        public Warehouse SaveInfo()
        {
            Warehouse warehouse = WarehouseManager.GetWarehouseById(this.WarehouseId);

            if (warehouse != null)
            {
                warehouse = WarehouseManager.UpdateWarehouse(warehouse.WarehouseId, txtName.Text,
                                                             txtPhoneNumber.Text, txtEmail.Text, txtFaxNumber.Text,
                                                             txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtStateProvince.Text, txtZipPostalCode.Text,
                                                             int.Parse(this.ddlCountry.SelectedItem.Value), warehouse.Deleted, warehouse.CreatedOn, DateTime.UtcNow);
            }
            else
            {
                DateTime now = DateTime.UtcNow;
                warehouse = WarehouseManager.InsertWarehouse(txtName.Text,
                                                             txtPhoneNumber.Text, txtEmail.Text, txtFaxNumber.Text,
                                                             txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtStateProvince.Text, txtZipPostalCode.Text,
                                                             int.Parse(this.ddlCountry.SelectedItem.Value), false, now, now);
            }

            return(warehouse);
        }
        public ActionResult GetWarehouseById(WarehouseViewModel wViewModel)
        {
            WarehouseViewModel wareViewModel = new WarehouseViewModel();

            try
            {
                wareViewModel.BranchInfoList = _branchManager.GetBranchList();

                wareViewModel.WarehouseInfo = _warehouseManager.GetWarehouseById(wViewModel.WarehouseFilter.Id);

                wareViewModel.AddressViewModelList.Address.ObjectId = wViewModel.WarehouseFilter.Id;

                wareViewModel.ContactViewModelList.ContactDetails.ObjectId = wViewModel.WarehouseFilter.Id;
            }
            catch (Exception ex)
            {
                wViewModel.FriendlyMessage.Add(MessageStore.Get("SYS01"));

                Logger.Error("Warehouse Controller - Update  " + ex.Message);
            }
            return(Index(wareViewModel));
        }