Ejemplo n.º 1
0
 public state_list find_state_list_By_ID(int id)
 {
     try
     {
         state_list = db.state_lists.SingleOrDefault(a => a.id == id);
         return(state_list);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Ejemplo n.º 2
0
 public state_list delete_state_list()
 {
     try
     {
         state_list prev_state_list = db.state_lists.SingleOrDefault(a => a.id == state_list.id);
         db.state_lists.DeleteOnSubmit(prev_state_list);
         return(state_list);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
        public state_list alter_state_list()
        {
            try
            {
                state_list prev_state_list = db.state_lists.SingleOrDefault(a => a.id == state_list.id);

                prev_state_list.state = state_list.state;



                db.SubmitChanges();
                return(state_list);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Ejemplo n.º 4
0
        public ActionResult state(statelistmodel obj, string Add, string Delete)
        {
            if (ModelState.IsValid)
            {
                using (ebmsEntities abj = new ebmsEntities())
                {
                    state_list oo = new state_list();

                    oo.state_code = obj.state_code.ToString();
                    oo.state_name = obj.state_name.ToString();

                    string state_code = objcommon.read_state_code();

                    oo.state_id = state_code.ToString();

                    bool res = objcommon.check_state_exist(oo.state_code, oo.state_name);

                    if (res == false)
                    {
                        abj.state_list.Add(oo);

                        abj.SaveChanges();

                        objcommon.update_statelist_code();


                        ViewBag.message = "Record Saved Successfully!!!!!";

                        ModelState.Clear();
                    }
                    else
                    {
                        ViewBag.message = "Duplicate Recod Found!!!!!";
                    }
                }
            }

            return(View());
        }
Ejemplo n.º 5
0
 public state_list_crud(state_list state_list_)
 {
     this.state_list_ = state_list_;
 }