Ejemplo n.º 1
0
        public ActionResult Edit(Guid id)
        {
            var deposit     = _depositService.GetById(id);
            var depositForm = DepositForm.FromDeposit(deposit);

            return(View(depositForm));
        }
Ejemplo n.º 2
0
        private void CreateDeposit()
        {
            //  ambil list brg
            var listBrg = new List <DepositDetilModel>();

            foreach (DataRow dr in DetilPenjualanTable.Rows)
            {
                if (dr["BrgID"].ToString().Trim() == "")
                {
                    continue;
                }

                var depositDetil = new DepositDetilModel()
                {
                    BrgID    = dr["BrgID"].ToString(),
                    Qty      = Convert.ToDecimal(dr["Qty"]),
                    Harga    = Convert.ToDecimal(dr["Harga"]),
                    Diskon   = Convert.ToDecimal(dr["Diskon"]),
                    SubTotal = Convert.ToDecimal(dr["SubTotal"])
                };
                listBrg.Add(depositDetil);
            }

            var jenisBayarID = "";

            if (_listBayarDetil != null)
            {
                jenisBayarID = _listBayarDetil.FirstOrDefault().JenisBayarID;
            }
            var pihakKeduaID = "";

            if (CustomerComboBox.SelectedValue != null)
            {
                pihakKeduaID = CustomerComboBox.SelectedValue.ToString();
            }


            //  save deposit
            var deposit = new DepositModel
            {
                Tgl             = TanggalDateTime.Value.ToString("dd-MM-yyyy"),
                Jam             = JamTextBox.Text,
                PihakKeduaID    = pihakKeduaID,
                BuyerName       = BuyerNameTextBox.Text,
                JenisBayarID    = jenisBayarID,
                NilaiBiayaKirim = BiayaKirimNumText.Value,
                NilaiDeposit    = GrandTotalNumText.Value,
                ListBrg         = listBrg
            };

            var form = new DepositForm(deposit)
            {
                MdiParent     = this.MdiParent,
                StartPosition = FormStartPosition.CenterScreen,
            };

            form.Show();
            ClearForm();
        }
Ejemplo n.º 3
0
        private void btnDeposit_Click(object sender, EventArgs e)
        {
            this.deleteSubs();
            DepositForm depositForm = new DepositForm();

            depositForm.MdiParent = (Form1)this.MdiParent;
            depositForm.Anchor    = AnchorStyles.Top | AnchorStyles.Right;
            depositForm.Dock      = DockStyle.Fill;
            depositForm.Show();
        }
Ejemplo n.º 4
0
        public ActionResult Edit(Guid id, DepositForm depositForm)
        {
            if (!ModelState.IsValid)
            {
                return View(depositForm);
            }

            _depositService.Edit(depositForm.ToDeposit());

            return RedirectToAction("Index", new DepositListFiltersModel().GetRouteValues()).WithSuccess("Depósito Editado");
        }
Ejemplo n.º 5
0
        public ActionResult Edit(Guid id, DepositForm depositForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(depositForm));
            }

            _depositService.Edit(depositForm.ToDeposit());

            return(RedirectToAction("Index", new DepositListFiltersModel().GetRouteValues()).WithSuccess("Depósito Editado"));
        }
Ejemplo n.º 6
0
        private void DepositJualButton_Click(object sender, EventArgs e)
        {
            DepositModel deposit = null;
            var          form    = new DepositForm(deposit)
            {
                MdiParent     = this,
                StartPosition = FormStartPosition.CenterScreen
            };

            form.Show();
        }
Ejemplo n.º 7
0
        public ActionResult Create(DepositForm depositForm)
        {
            if (!ModelState.IsValid)
            {
                return View(depositForm);
            }

            var deposit = depositForm.ToDeposit();

            _depositService.Create(deposit);

            return RedirectToAction("Index", new DepositListFiltersModel().GetRouteValues()).WithSuccess("Depósito Creado");
        }
Ejemplo n.º 8
0
        public ActionResult Create(DepositForm depositForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(depositForm));
            }

            var deposit = depositForm.ToDeposit();

            _depositService.Create(deposit);

            return(RedirectToAction("Index", new DepositListFiltersModel().GetRouteValues()).WithSuccess("Depósito Creado"));
        }
Ejemplo n.º 9
0
 public ActionResult Create()
 {
     var depositForm = new DepositForm();
     return View(depositForm);
 }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            DepositForm depo = new DepositForm();

            depo.Show();
        }
Ejemplo n.º 11
0
        public ActionResult Create()
        {
            var depositForm = new DepositForm();

            return(View(depositForm));
        }