public ActionResult Detail(int?Id, string TargetCode, InfoDetailCustomer?infoDetailCustomer)
        {
            ViewBag.InfoDetail = infoDetailCustomer;
            var customer = new vwCustomer();

            if (Id != null)
            {
                customer = CustomerRepository.GetvwCustomerById(Id.Value);
            }
            if (!string.IsNullOrEmpty(TargetCode))
            {
                customer = CustomerRepository.GetAllvwCustomer()
                           .Where(item => item.Code == TargetCode).FirstOrDefault();
            }
            if (customer != null && customer.IsDeleted != true)
            {
                var model = new CustomerViewModel();
                AutoMapper.Mapper.Map(customer, model);
                return(View(model));
            }

            if (Request.UrlReferrer != null)
            {
                return(Redirect(Request.UrlReferrer.AbsoluteUri));
            }
            return(RedirectToAction("Index"));
        }
Example #2
0
 public static List <vwClaimant> getListClaimantForGrid(List <string> listProductClaimantSelected, vwCustomer customer)
 {
     return(dataservices.claimant.getListClaimantForGrid(listProductClaimantSelected, customer));
 }
Example #3
0
 //poziva pri otvaranju prozora AddBoss ali pri editovanju nekog boss
 public AddCustomerViewModel(AddCustomer addCustomerOpen, vwCustomer CustomerEdit)
 {
     customer    = CustomerEdit;
     addCustomer = addCustomerOpen;
 }
Example #4
0
 //poziva pri otvaranju prozora AddBoss pri dodavanju novih boss
 public AddCustomerViewModel(AddCustomer addCustomerOpen)
 {
     customer    = new vwCustomer();
     addCustomer = addCustomerOpen;
 }
Example #5
0
 public AddCustomer(vwCustomer officeEdit)
 {
     InitializeComponent();
     this.DataContext = new AddCustomerViewModel(this, officeEdit);
 }