public static WhatsAppLink WhatsAppLinkCreate(WhatsAppLink whatsAppLink, int iUserId) { try { List <SqlParameter> parameters = new List <SqlParameter>(); parameters.Add(new SqlParameter("iWhatsAppLinkId", whatsAppLink.iWhatsAppLinkId)); parameters.Add(new SqlParameter("nvRedirectLink", whatsAppLink.nvRedirectLink)); parameters.Add(new SqlParameter("nvSource", whatsAppLink.nvSource)); parameters.Add(new SqlParameter("iUserId", iUserId)); DataSet ds = SqlDataAccess.ExecuteDatasetSP("TWhatsAppLink_INS_UPDT", parameters); if (ds.Tables != null && ds.Tables[0].Rows.Count > 0) { whatsAppLink = ObjectGenerator <WhatsAppLink> .GeneratFromDataRow(ds.Tables[0].Rows[0]); } return(whatsAppLink); } catch (Exception x) { Log.LogError("GeTWhatsAppLinks", x.Message); return(null); } }
public static WhatsAppLink GetWhatsApp(int iLinkId) { try { //Log.LogInfo("GetWhatsApp iLinkId:"+ iLinkId); WhatsAppLink whatsAppLink = new WhatsAppLink(); DataSet ds = SqlDataAccess.ExecuteDatasetSP("TWhatsAppLink_SLCT_ById", new SqlParameter("iLinkId", iLinkId)); if (ds.Tables != null && ds.Tables[0].Rows.Count > 0) { //Log.LogInfo("GetWhatsApp ds.Tables[0].Rows:" + ds.Tables[0].Rows.Count); whatsAppLink = ObjectGenerator <WhatsAppLink> .GeneratFromDataRow(ds.Tables[0].Rows[0]); } //Log.LogInfo("GetWhatsApp iWhatsAppLinkId:" + whatsAppLink.iWhatsAppLinkId); return(whatsAppLink); } catch (Exception x) { Log.LogError("GetWhatsApp", x.Message); return(null); } finally { string soap = OperationContext.Current.RequestContext.RequestMessage.ToString(); IncomingWebRequestContext ctx = WebOperationContext.Current.IncomingRequest; //ctx; //Log.LogInfo("RequestUri: " + ctx.IncomingRequest.UriTemplateMatch.Data); //Log.LogInfo("StatusCode: " + ctx.OutgoingResponse.StatusCode); //Log.LogInfo("Format: " + ctx.OutgoingResponse.Format); //Log.LogInfo("Headers: " + ctx.OutgoingResponse.Headers); //Log.LogInfo("Location: " + ctx.OutgoingResponse.Location); //Message msg = OperationContext.Current.RequestContext.RequestMessage.CreateBufferedCopy(Int32.MaxValue).CreateMessage(); //Log.LogInfo(msg.ToString()); } }