/********************************* * Title :: CollectUserData * Description :: Collect user data for list all user * Parameter :: none * Return :: JSON *********************************/ public string CollectUserDataOnLoad(string User_id = null, string Status = null, string Role = null) { string _jsonString = string.Empty; //RestClient _client = new RestClient(); //_client.URL = Constant.GET_VOLUNTEER_DATA; //_client.Method = HttpMethod.GET; //_client.Execute(); //_response = _client.Response(); //return _response; MasterManagement _MM = new MasterManagement(); _MM = new MasterManagement(); _dtable = new DataTable(); // User_id = "1"; // Session["USER_ID"].ToString(); // Role = "BADM"; _dtable = _MM.View_User_Data(User_id, Status, Role); if (_dtable.Rows.Count > 0) { _jsonString = Convert.ToString(_dtable.Rows[0]["JSON_VALUE"]); // response = this.Request.CreateResponse(HttpStatusCode.OK); } else { _jsonString = Data.DatatableEmpty(); //response = this.Request.CreateResponse(HttpStatusCode.OK); } return(_jsonString); }
public string LoginAction(AuthenticateManagement authData) { string _jsonString = string.Empty; string _user_name = string.Empty, _password = string.Empty; // bool _isadmin = true; _user_name = authData.UserName; _password = authData.Password; // Initialize Post Data //{"USER_ID":"*****@*****.**","PASSWORD":"******","IS_ADMIN":true} SortedList <string, object> _postArrData = new SortedList <string, object>(); _postArrData.Add("V_USER_NAME", _user_name); _postArrData.Add("V_PASSWORD", _password); // _postArrData.Add("IS_ADMIN", _isadmin); //role id is hardcode in backend var _postContent = Json.Encode(_postArrData); MasterManagement _mmob = new MasterManagement(); _dtable = _mmob.Admin_Login(_postContent); if (_dtable.Rows.Count > 0) { _jsonString = Convert.ToString(_dtable.Rows[0]["JSON_VALUE"]); //response = this.Request.CreateResponse(HttpStatusCode.OK); } else { _jsonString = Data.DatatableEmpty(); //response = this.Request.CreateResponse(HttpStatusCode.OK); } //previous code which was logging in with service //RestClient _client = new RestClient(); //_client.URL = Constant.LOGIN; //_client.Method = HttpMethod.POST; //_client.Content = _postContent; //_client.Type = ContentType.URLENCODE; //_client.Execute(); //var response = _client.Response(); //if (response == string.Empty) //{ // response = _client.errordata(); //} return(_jsonString); }
/*************************************** * Title :: Get Satsang Chapter Data * Description :: this module use for get satsang chapter * Param :: * Return :: Response data **************************************/ public string GetSatsangChapterData() { string _response = string.Empty; MasterManagement mmobj = new MasterManagement(); DataTable dt = new DataTable(); dt = mmobj.GetSatsangChapterData(); _response = Convert.ToString(dt.Rows[0]["JSON_VALUE"]); // return response; //RestClient _client = new RestClient(); //_client.URL = Constant.GET_SATSANG_CHAPTER_DATA; //_client.Method = HttpMethod.GET; //_client.Execute(); //_response = _client.Response(); return(_response); }
/*************************************** * Title :: Get Event Calender Data * Description :: this module use for collect event list through event id * Param :: event id * Return :: Event data. **************************************/ public string GetEventData(int EventId = 0) { string _response = string.Empty; if (EventId > 0) { MasterManagement _mmObj = new MasterManagement(); DataTable dt = new DataTable(); dt = _mmObj.Get_Event_Data(EventId); _response = Convert.ToString(dt.Rows[0]["JSON_VALUE"]); //string _URL = Constant.GET_EVENT_DATA + "?eventid=" + EventId + "&isactive=1,0"; //RestClient _client = new RestClient(); //_client.URL = _URL; //_client.Method = HttpMethod.GET; //_client.Execute(); //_response = _client.Response(); } return(_response); }
/*************************************** * Title :: Add Event Calender * Description :: this module use for collect list of Master Event Type Data(e.g - Nivritty Gurukul, Workshop) * Param :: none * Return :: Event list type. **************************************/ public string AddEventCalender(EventManagement data, int createdby = 0) { //@START_DATE,@END_DATE,@YEAR,@MONTH,@EXPIRED_ON,@EVENT_TYPE,@MALE,@FEMALE,@ISACTIVE,@CREATED_BY //{"EVENT_ID":"","START_DATE":"","END_DATE":"","EXPIRE_DATE":"","NO_OF_MALE":"","NO_OF_FEMALE":"","LOCATION_ID":"","STATE_ID":"","YEAR":"","MONTH":"","STATUS":""} string _response = string.Empty, _endDate = string.Empty, _enddate = string.Empty, _expiredate = string.Empty, Message_to_user = string.Empty, Holiday = string.Empty, HolidayEnd = string.Empty; int _eventid = 0, _male_no = 0, _female_no = 0, _stateid = 0, _locationid = 0, _year = 0, _month = 0, _isactive = 0; SortedList <string, object> _data = new SortedList <string, object>(); _eventid = Convert.ToInt32(data.EventId); _endDate = data.EventStartDate; _enddate = data.EventEndDate; _expiredate = data.EventExpireDate; _male_no = Convert.ToInt32(data.EventMaleNo); _female_no = Convert.ToInt32(data.EventFemaleNo); _isactive = data.IsActive ? 1 : 0; //DateTime s_date = Convert.ToDateTime(_endDate); //_month = s_date.Month; //_year = s_date.Year; // Ready Array _data.Add("EVENT_TYPE", _eventid); _data.Add("USER_ID", createdby); _data.Add("EVENT_START_DATE", _endDate); _data.Add("EVENT_END_DATE", _enddate); _data.Add("EVENT_EXPIRED_ON", _expiredate); _data.Add("EVENT_REQ_MALE", _male_no); _data.Add("EVENT_REQ_FEMALE", _female_no); //_data.Add("YEAR", _year); //_data.Add("MONTH", _month); _data.Add("STATUS", _isactive); if (_eventid == 2) { _stateid = Convert.ToInt32(data.EventStateId); Holiday = Convert.ToString(data.HolidayStartDate); HolidayEnd = Convert.ToString(data.HolidayEndDate); _data.Add("EVENT_STATE_ID", _stateid); _data.Add("VACATION_START_DATE", Holiday); _data.Add("VACATION_END_DATE", HolidayEnd); } else if (_eventid == 3) { Message_to_user = Convert.ToString(data.Message_to_user); _stateid = Convert.ToInt32(data.EventStateId); _locationid = Convert.ToInt32(data.EventLocationId); _data.Add("EVENT_STATE_ID", _stateid); _data.Add("EVENT_LOCATION_ID", _locationid); //Message_to_user _data.Add("MESSAGE_TO_USER", Message_to_user); } MasterManagement _mmobj = new MasterManagement(); DataTable dt = new DataTable(); var _postContent = System.Web.Helpers.Json.Encode(_data); dt = _mmobj.AddNewEvent(_postContent); _response = Convert.ToString(dt.Rows[0]["JSON_VALUE"]); //RestClient _client = new RestClient(); //_client.URL = Constant.ADD_EVENT_CALENDER; //_client.Method = HttpMethod.POST; //_client.Content = Json.Encode(_data); //_client.Type = ContentType.URLENCODE; //_client.Execute(); //_response = _client.Response(); return(_response); }