예제 #1
0
        public ActionResult Edit(AdvancePayment AdvancePayment)
        {
            AdvancePayment oAdvancePayment = new AdvancePayment();

            oAdvancePayment.AdvancePaymentID = System.Convert.ToInt32(AdvancePayment.AdvancePaymentID);
            oAdvancePayment = AdvancePaymentData.Select_Record(AdvancePayment);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = AdvancePaymentData.Update(oAdvancePayment, AdvancePayment);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(AdvancePayment_CompanyData.List(), "CompanyID", "CompanyName", AdvancePayment.CompanyID);
            ViewData["ClientID"]  = new SelectList(AdvancePayment_ClientData.List(), "ClientID", "ClientName", AdvancePayment.ClientID);
            ViewData["ProjectID"] = new SelectList(AdvancePayment_ProjectData.List(), "ProjectID", "ProjectName", AdvancePayment.ProjectID);

            return(View(AdvancePayment));
        }
예제 #2
0
        public ActionResult Create([Bind(Include =
                                             "PaymentDate"
                                             + "," + "CompanyID"
                                             + "," + "ClientID"
                                             + "," + "ProjectID"
                                             + "," + "GrossAmount"
                                             + "," + "TDSRate"
                                             + "," + "CGSTRate"
                                             + "," + "SGSTRate"
                                             + "," + "IGSTRate"
                                             + "," + "Remarks"
                                         )] AdvancePayment AdvancePayment)
        {
            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = AdvancePaymentData.Add(AdvancePayment);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Insert");
                }
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(AdvancePayment_CompanyData.List(), "CompanyID", "CompanyName", AdvancePayment.CompanyID);
            ViewData["ClientID"]  = new SelectList(AdvancePayment_ClientData.List(), "ClientID", "ClientName", AdvancePayment.ClientID);
            ViewData["ProjectID"] = new SelectList(AdvancePayment_ProjectData.List(), "ProjectID", "ProjectName", AdvancePayment.ProjectID);

            return(View(AdvancePayment));
        }
예제 #3
0
        // GET: /AdvancePayment/Edit/<id>
        public ActionResult Edit(
            Int32?AdvancePaymentID
            )
        {
            if (
                AdvancePaymentID == null
                )
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            AdvancePayment AdvancePayment = new AdvancePayment();

            AdvancePayment.AdvancePaymentID = System.Convert.ToInt32(AdvancePaymentID);
            AdvancePayment = AdvancePaymentData.Select_Record(AdvancePayment);

            if (AdvancePayment == null)
            {
                return(HttpNotFound());
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(AdvancePayment_CompanyData.List(), "CompanyID", "CompanyName", AdvancePayment.CompanyID);
            ViewData["ClientID"]  = new SelectList(AdvancePayment_ClientData.List(), "ClientID", "ClientName", AdvancePayment.ClientID);
            ViewData["ProjectID"] = new SelectList(AdvancePayment_ProjectData.List(), "ProjectID", "ProjectName", AdvancePayment.ProjectID);

            return(View(AdvancePayment));
        }
예제 #4
0
        // GET: /AdvancePayment/Create
        public ActionResult Create()
        {
            // ComboBox
            ViewData["CompanyID"] = new SelectList(AdvancePayment_CompanyData.List(), "CompanyID", "CompanyName");
            ViewData["ClientID"]  = new SelectList(AdvancePayment_ClientData.List(), "ClientID", "ClientName");
            ViewData["ProjectID"] = new SelectList(AdvancePayment_ProjectData.List(), "ProjectID", "ProjectName");

            return(View());
        }