示例#1
0
        ///Russelll section crude Update :
        public string UpdateData(string id, string value, string columnPosition)
        {
            if (Request.IsAjaxRequest())
            {
                if (columnPosition == "4" )
                {
                    string str_classId = RetriveIDFromThis(value);
                    _classLogic = new PetClassLogic();
                    if (_classLogic.BookThisClassForMyPet(Convert.ToInt32(str_classId), Convert.ToInt32(id)))
                        return value;
                    else return "Internal problem, plz try later";
                }

                try
                {
                    _logic = new PetLogic();
                    return _logic.UpdatePetAjaxService(Convert.ToInt32(id), value, Convert.ToInt32(columnPosition));
                }
                catch (Exception exp)
                {
                    return exp.Message;
                }
            }
            //SomeOne trying to hack, Implement Somemlogic here :
            return null;
        }
示例#2
0
        public ActionResult GetAvailableClassesList()
        {
            _classLogic = new PetClassLogic();
            var classes = _classLogic.GetAllClasses(true).ToList();
            Dictionary<string, string> result = new Dictionary<string, string>();

            foreach (var cl in classes)
            {
                result.Add(string.Format("{0}-{1}", cl.PetClassId, cl.Name), string.Format("{0}-{1}", cl.PetClassId, cl.Name));
            }
            return Json(result, JsonRequestBehavior.AllowGet);
        }