コード例 #1
0
        public ActionResult Delete(string id, FormCollection collection)
        {
            UncreditSaleDetailDetailView uncreditSaleDetailDetailView = new UncreditSaleDetailDetailView();

            uncreditSaleDetailDetailView.UncreditSaleDetailView = this.GetUncreditSaleDetailView(id);
            //uncreditSaleDetailDetailView.EmployeeView = GetEmployee();

            DeleteRequest request = new DeleteRequest()
            {
                ID = Guid.Parse(id)
            };

            DeleteResponse response = this._uncreditSaleDetailService.DeleteUncreditSaleDetail(request);

            if (response.Success)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                foreach (string error in response.ErrorMessages)
                {
                    ModelState.AddModelError("", error);
                }
                return(View(uncreditSaleDetailDetailView));
            }
        }
コード例 #2
0
        public ActionResult Create()
        {
            UncreditSaleDetailDetailView uncreditSaleDetailDetailView = new UncreditSaleDetailDetailView();

            uncreditSaleDetailDetailView.EmployeeView = GetEmployee();

            return(View(uncreditSaleDetailDetailView));
        }
コード例 #3
0
        public ActionResult Edit(string id)
        {
            UncreditSaleDetailDetailView uncreditSaleDetailDetailView = new UncreditSaleDetailDetailView();

            uncreditSaleDetailDetailView.UncreditSaleDetailView = this.GetUncreditSaleDetailView(id);
            //uncreditSaleDetailDetailView.EmployeeView = GetEmployee();

            return(View(uncreditSaleDetailDetailView));
        }
コード例 #4
0
        public ActionResult Edit(string id, UncreditSaleDetailDetailView uncreditSaleDetailDetailView)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    EditUncreditSaleDetailRequest request = new EditUncreditSaleDetailRequest();

                    request.ID = Guid.Parse(id);
                    request.ModifiedEmployeeID       = GetEmployee().ID;
                    request.Discount                 = uncreditSaleDetailDetailView.UncreditSaleDetailView.Discount;
                    request.Imposition               = uncreditSaleDetailDetailView.UncreditSaleDetailView.Imposition;
                    request.LineDiscount             = uncreditSaleDetailDetailView.UncreditSaleDetailView.LineDiscount;
                    request.LineImposition           = uncreditSaleDetailDetailView.UncreditSaleDetailView.LineImposition;
                    request.LineTotal                = uncreditSaleDetailDetailView.UncreditSaleDetailView.LineTotal;
                    request.MainUncreditSaleDetailID = uncreditSaleDetailDetailView.UncreditSaleDetailView.MainUncreditSaleDetailID;
                    request.RollbackNote             = uncreditSaleDetailDetailView.UncreditSaleDetailView.RollbackNote;
                    request.SaleID            = uncreditSaleDetailDetailView.UncreditSaleDetailView.SaleID;
                    request.UncreditServiceID = uncreditSaleDetailDetailView.UncreditSaleDetailView.UncreditServiceID;
                    request.UnitPrice         = uncreditSaleDetailDetailView.UncreditSaleDetailView.UnitPrice;
                    request.Units             = uncreditSaleDetailDetailView.UncreditSaleDetailView.Units;
                    request.RowVersion        = uncreditSaleDetailDetailView.UncreditSaleDetailView.RowVersion;

                    EditResponse response = this._uncreditSaleDetailService.EditUncreditSaleDetail(request);

                    if (response.Success)
                    {
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        foreach (string error in response.ErrorMessages)
                        {
                            ModelState.AddModelError("", error);
                        }
                        return(View(uncreditSaleDetailDetailView));
                    }
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("", ex.Message);
                    return(View(uncreditSaleDetailDetailView));
                }
            }

            return(View(uncreditSaleDetailDetailView));
        }