예제 #1
0
        public ActionResult Edit(Client Client)
        {
            Client oClient = new Client();

            oClient.ClientID = System.Convert.ToInt32(Client.ClientID);
            oClient          = ClientData.Select_Record(Client);

            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = ClientData.Update(oClient, Client);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Update");
                }
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(Client_CompanyData.List(), "CompanyID", "CompanyName", Client.CompanyID);

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

            Client Client = new Client();

            Client.ClientID = System.Convert.ToInt32(ClientID);
            Client          = ClientData.Select_Record(Client);

            if (Client == null)
            {
                return(HttpNotFound());
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(Client_CompanyData.List(), "CompanyID", "CompanyName", Client.CompanyID);

            return(View(Client));
        }
예제 #3
0
        // GET: /Client/Create
        public ActionResult Create()
        {
            // ComboBox
            ViewData["CompanyID"] = new SelectList(Client_CompanyData.List(), "CompanyID", "CompanyName");

            return(View());
        }
예제 #4
0
        public ActionResult Create([Bind(Include =
                                             "ClientName"
                                             + "," + "Address1"
                                             + "," + "Address2"
                                             + "," + "City"
                                             + "," + "District"
                                             + "," + "State"
                                             + "," + "PinCode"
                                             + "," + "ContactNo"
                                             + "," + "EMail"
                                             + "," + "GSTIN"
                                             + "," + "CompanyID"
                                             + "," + "AddUserID"
                                             + "," + "AddDate"
                                             + "," + "ArchiveUserID"
                                             + "," + "ArchiveDate"
                                         )] Client Client)
        {
            if (ModelState.IsValid)
            {
                bool bSucess = false;
                bSucess = ClientData.Add(Client);
                if (bSucess == true)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Can Not Insert");
                }
            }
            // ComboBox
            ViewData["CompanyID"] = new SelectList(Client_CompanyData.List(), "CompanyID", "CompanyName", Client.CompanyID);

            return(View(Client));
        }