public async Task <bool> UpdateCostCenter(ShipTo shipTo, Ship2Model model)
        {
            shipTo.Sorderedby = model.Sorderedby;
            shipTo.DivisionId = model.DivisionId;
            shipTo.ShipId     = model.ShipId;
            shipTo.Sname      = model.Sname;
            shipTo.Sadd1      = model.Sadd1;
            shipTo.Sadd2      = model.Sadd2;
            shipTo.Scity      = model.Scity;
            shipTo.Sst        = model.Sst;
            shipTo.Szip       = model.Szip;
            shipTo.Sph        = model.Sph;
            shipTo.SsalesTax  = model.SsalesTax;
            shipTo.ApprovalId = model.ApprovalId;

            var result = await _shipRepository.UpdateAsync(shipTo);

            if (result != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public async Task PrepareCostCenter(Ship2Model model, ShipTo shipTo)
        {
            var division = _divisonRepository.Table;

            division = division.Where(c => c.ClientId == (int)_workContext.CurrentCustomer.ClientId);

            model.AvailableDepartment.Add(new SelectListItem {
                Text = "Select Department", Value = "0"
            });
            foreach (var item in division)
            {
                model.AvailableDepartment.Add(new SelectListItem {
                    Text = item.Division1, Value = item.DivisionId.ToString()
                });
            }
            var logons = _logonRepository.Table;

            logons = logons.Where(c => c.ClientId == (int)_workContext.CurrentCustomer.ClientId);


            model.AvailableOrderBy.Add(new SelectListItem {
                Text = "Select Name", Value = "0"
            });
            foreach (var item in logons)
            {
                model.AvailableOrderBy.Add(new SelectListItem {
                    Text = item.UserName, Value = item.UserName.ToString()
                });
            }


            model.AvailableApprovalManager.Add(new SelectListItem {
                Text = "Select Manager", Value = "0"
            });
            foreach (var item in logons)
            {
                model.AvailableApprovalManager.Add(new SelectListItem {
                    Text = item.UserName, Value = item.LogonId.ToString()
                });
            }

            if (shipTo != null)
            {
                model.Sid            = shipTo.Sid;
                model.ClientId       = shipTo.ClientId;
                model.CreateDate     = shipTo.CreateDate;
                model.DivisionId     = shipTo.DivisionId;
                model.LogonId        = shipTo.DivisionId;
                model.Principal      = shipTo.Principal != null ? (bool)shipTo.Principal : false;
                model.Sadd1          = shipTo.Sadd1;
                model.Sadd2          = shipTo.Sadd2;
                model.Scity          = shipTo.Scity;
                model.SsalesTax      = shipTo.DivisionId;
                model.Sst            = shipTo.Sst;
                model.Sorderedby     = shipTo.Sorderedby;
                model.Sph            = shipTo.Sph;
                model.ShipId         = shipTo.ShipId;
                model.Sname          = shipTo.Sname;
                model.Szip           = shipTo.Szip;
                model.ApprovalId     = shipTo.ApprovalId;
                model.IsPrimaryCheck = shipTo.Principal == true ? 1 : 0;
            }
        }