public void saveAddCameti(int app_id, string cameti_name, string start_date, double total_amount, int months, string installment, string no_of_people, string coin_one, string coin_two) { try { CametiData cdata = new CametiData(); cdata.App_id = app_id; cdata.Cameti_name = cameti_name; cdata.Start_date = start_date; cdata.Total_amount = total_amount; cdata.Months = months; cdata.Installment = installment; cdata.No_of_people = no_of_people; cdata.Coin_one = coin_one; cdata.Coin_two = coin_two; cdata.Save(); } catch (Exception ex) { } }
public void getCameti(int app_id) { //DataSet ds=null; string res = ""; string responce = ""; ResponseData rsData = new ResponseData(); List <CametiData> clist = new List <CametiData>(); try { CametiData cdata = new CametiData(); DataSet ds = cdata.getCameti("select * from cameti where app_id=" + app_id); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int cid = int.Parse(ds.Tables[0].Rows[i][0].ToString()); CametiData ciddata = new CametiData(cid); clist.Add(ciddata); } } catch (Exception ex) { } rsData.Message = "success"; rsData.Description = "successfully"; rsData.Data = clist; JavaScriptSerializer js = new JavaScriptSerializer(); responce = js.Serialize(rsData); Context.Response.Clear(); Context.Response.ContentType = "application/json"; Context.Response.AddHeader("content-length", responce.Length.ToString()); Context.Response.Flush(); Context.Response.Write(responce); }