/// <summary> /// Insert member info /// </summary> /// <param name="oMemberInfoViewModel"></param> /// <returns>Response</returns> public Response oInsertMemberInfo(MemberInfoViewModel oMemberInfoViewModel) { #region ": Insert :" Response oResponse = new Response(); try { if (oMemberInfoViewModel != null) { var lstMemberInfo = (from c in this.MemberInfoDBSet where c.APPLICATION_ID == oMemberInfoViewModel.APPLICATION_ID where c.LANGUAGE_ID == oMemberInfoViewModel.LANGUAGE_ID orderby c.ID descending select new { ID = c.ID, APPLICATION_ID = c.APPLICATION_ID, MEMBER_INFO_TITLE = c.MEMBER_INFO_TITLE, MEMBER_INFO_DESCRIPTION = c.MEMBER_INFO_DESCRIPTION }); if (lstMemberInfo.Count() >= 3) { oResponse.OperationResult = enumOperationResult.RelatedRecordFaild; return(oResponse); } MEMBER_INFO oMEMBER_INFO = new MEMBER_INFO() { APPLICATION_ID = oMemberInfoViewModel.APPLICATION_ID, LANGUAGE_ID = oMemberInfoViewModel.LANGUAGE_ID, MEMBER_INFO_TITLE = oMemberInfoViewModel.MEMBER_INFO_TITLE, MEMBER_INFO_DESCRIPTION = oMemberInfoViewModel.MEMBER_INFO_DESCRIPTION, CREATED_BY = oMemberInfoViewModel.CREATED_BY, CREATED_DATE = DateTime.Now }; this.oTakamulConnection.MEMBER_INFO.Add(oMEMBER_INFO); if (this.intCommit() > 0) { oResponse.OperationResult = enumOperationResult.Success; } else { oResponse.OperationResult = enumOperationResult.Faild; } } } catch (Exception Ex) { oResponse.OperationResult = enumOperationResult.Faild; //TODO : Log Error Message oResponse.OperationResultMessage = Ex.Message.ToString(); } return(oResponse); #endregion }
/// <summary> /// Update member info /// </summary> /// <param name="oMemberInfoViewModel"></param> /// <returns>Response</returns> public Response oUpdateMemberInfo(MemberInfoViewModel oMemberInfoViewModel) { Response oResponse = new Response(); #region Try Block try { // Start try #region Check oEventViewModel Value MEMBER_INFO oMEMBER_INFO = new MEMBER_INFO(); oMEMBER_INFO = this.oTakamulConnection.MEMBER_INFO.Find(oMemberInfoViewModel.ID); if (oMEMBER_INFO == null) { throw new ArgumentNullException("oMEMBER_INFO Entity Is Null"); } #endregion #region Update Default EVENTS oMEMBER_INFO.APPLICATION_ID = oMemberInfoViewModel.APPLICATION_ID; oMEMBER_INFO.MEMBER_INFO_TITLE = oMemberInfoViewModel.MEMBER_INFO_TITLE; oMEMBER_INFO.MEMBER_INFO_DESCRIPTION = oMemberInfoViewModel.MEMBER_INFO_DESCRIPTION; oMEMBER_INFO.MODIFIED_BY = oMemberInfoViewModel.CREATED_BY; oMEMBER_INFO.MODIFIED_DATE = DateTime.Now; this.MemberInfoDBSet.Attach(oMEMBER_INFO); this.oTakamulConnection.Entry(oMEMBER_INFO).State = EntityState.Modified; if (this.intCommit() > 0) { oResponse.OperationResult = enumOperationResult.Success; } else { oResponse.OperationResult = enumOperationResult.Faild; } #endregion }// End try #endregion #region Catch Block catch (Exception Ex) {// Start Catch oResponse.OperationResult = enumOperationResult.Faild; //TODO : Log Error Message oResponse.OperationResultMessage = Ex.Message.ToString(); }//End Catch #endregion return(oResponse); }
public async Task <ActionResult> RemoveMember([FromBody] MEMBER_INFO member) { client = new FireSharp.FirebaseClient(iconfig); FirebaseResponse response = await client.DeleteTaskAsync("OSBB/" + member.osbb_id + "/Members/" + member.user_uid); return(StatusCode (200, new { removedmember_uid = member.user_uid //data } )); }