protected override void SetPageSessionContext()
 {
     _isClientSaved = false;
     _savedClient   = null;
     _isGroupSaved  = false;
     _savedGroup    = null;
     base.SetPageSessionContext();
     QueryString.Clear();
     _testEntity     = new customerdetail();
     _privateTestObj = new PrivateObject(_testEntity);
     InitializeAllControls(_testEntity);
     ShimCurrentUser();
     ShimMasterPage();
 }
Esempio n. 2
0
 public ActionResult Edit(int id, customerdetail customer)
 {
     try
     {
         // TODO: Add update logic here
         using (CustomerModels cst = new CustomerModels())
         {
             cst.Entry(customer).State = EntityState.Modified;
             cst.SaveChanges();
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
        public ActionResult Create(customerdetail customer)
        {
            try
            {
                using (CustomerModels cst = new CustomerModels())
                {
                    cst.customerdetails.Add(customer);
                    cst.SaveChanges();
                }
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 4
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                using (CustomerModels cd = new CustomerModels())
                //modelname
                {
                    customerdetail customer = cd.customerdetails.Where(x => x.id == id).FirstOrDefault();
                    //tablenmame               searching id from table name
                    cd.customerdetails.Remove(customer);
                    //table name
                    cd.SaveChanges();
                }

                // TODO: Add delete logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }