public SocietyMember AddSociety(SocietyMember society) { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString); SqlCommand command = new SqlCommand("AddSocietyForMember", conn); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("societyId", society.SocietyId)); command.Parameters.Add(new SqlParameter("memberId", society.MemberId)); command.Parameters.Add(new SqlParameter("flatNo", society.FlatNo)); command.Parameters.Add(new SqlParameter("memberType", society.MemberType)); SqlDataAdapter adapter = new SqlDataAdapter(command); DataTable t = new DataTable(); adapter.Fill(t); if (t.Rows.Count == 0) { return(null); } return(new SocietyMember { SocietyId = (int)t.Rows[0][0], MemberId = (int)t.Rows[0][1], FlatNo = (short)t.Rows[0][2], MemberType = (short)t.Rows[0][3], SocietyName = (string)t.Rows[0][4] }); }
public bool Update(SocietyMember item) { throw new NotImplementedException(); }
public SocietyMember Add(SocietyMember item) { throw new NotImplementedException(); }
// POST api/member public HttpResponseMessage Post(SocietyMember society) { return(Request.CreateResponse <SocietyMember>(HttpStatusCode.Created, societyApi.AddSociety(society))); }
public SocietyMember AddSociety(SocietyMember society) { return(_repository.AddSociety(society)); }