public static Object getData(string YEAR) { DataTable dt = new DataTable(); List <Calendar> data = new List <Calendar>(); MST_CALENDAR_DAL _dalMST_CALENDAR = new MST_CALENDAR_DAL(); Hashtable _htParameters = new Hashtable(); _htParameters["p_keywords"] = YEAR; dt = _dalMST_CALENDAR.GetRows(_htParameters); data = ConvertDataTable <Calendar>(dt); var total = data.Count; return(new { total, data }); }
public static Object insertData(string YEAR) { string resultMessage = ""; try { MST_CALENDAR_DAL _dalMST_CALENDAR = new MST_CALENDAR_DAL(); Hashtable _htParameters = new Hashtable(); Utility.ApplyDefaultProp(_htParameters); _htParameters["Year"] = YEAR; _dalMST_CALENDAR.Insert(_htParameters); } catch (Exception e) { resultMessage = "Process Insert data finish with error: " + e.Message; } return(new { resultMessage }); }
public static Object update(string date_flag, string date_unflag) { string resultMessage = ""; try { MST_CALENDAR_DAL _dalMST_CALENDAR = new MST_CALENDAR_DAL(); Hashtable _htParameters = new Hashtable(); Utility.ApplyDefaultProp(_htParameters); foreach (var dt in date_flag.Split('|')) { _htParameters["p_working_Day"] = 0; _htParameters["p_date"] = dt.ToString(); _dalMST_CALENDAR.Update(_htParameters); //string update = "update tb_m_calendar set working_Day = 0 where date = '" + dt + "'"; } foreach (var dt in date_unflag.Split('|')) { _htParameters["p_working_Day"] = 1; _htParameters["p_date"] = dt.ToString(); _dalMST_CALENDAR.Update(_htParameters); //string update = "update tb_m_calendar set working_Day = 1 where date = '" + dt + "'"; } } catch (Exception e) { resultMessage = "Process Save data finish with error: " + e.Message; } return(new { resultMessage }); }