Ejemplo n.º 1
0
        public void Method(PaperDTO objpaper)
        {
            ModelState.Remove("ListState");
            List <StateDTO> liststate = new List <StateDTO>();

            liststate = new List <StateDTO>()
            {
                new StateDTO {
                    StateId = 0, StateName = "Select"
                }
            };

            foreach (var item in objState.GetStates())
            {
                StateDTO sm = new StateDTO();
                sm.StateId   = item.StateId;
                sm.StateName = item.StateName;
                liststate.Add(sm);
            }


            objpaper.ListState = liststate;
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            CityDTO objCM = new CityDTO();

            List <StateDTO> liststate = new List <StateDTO>();

            liststate = new List <StateDTO>()
            {
                new StateDTO {
                    StateId = 0, StateName = "Select"
                }
            };

            foreach (var item in objState.GetStates())
            {
                StateDTO st = new StateDTO();
                st.StateId   = item.StateId;
                st.StateName = item.StateName;

                liststate.Add(st);
            }
            objCM.ListState = liststate;
            return(View(objCM));
        }
Ejemplo n.º 3
0
        [NonAction] // if Method is not Action method then use NonAction
        public List <StateDTO> BindListState()
        {
            List <StateDTO> liststate = new List <StateDTO>()
            {
                new StateDTO  {
                    StateId = 0, StateName = "Select"
                }
            };

            foreach (var item in objStateMaster.GetStates())
            {
                StateDTO st = new StateDTO();
                st.StateId   = item.StateId;
                st.StateName = item.StateName;
                liststate.Add(st);
            }
            return(liststate);
        }
Ejemplo n.º 4
0
 public ActionResult Details()
 {
     return(View(objIStateMaster.GetStates()));
 }
 public IEnumerable <StateDTO> StateList()
 {
     return(objStateM.GetStates());
 }