public void LogUse(int MedicID, int ProgramID) { string sIPAddress; sIPAddress = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (sIPAddress == null) { sIPAddress = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } string sp; sp = "wsAddIntranetLog"; SqlParameter Param1 = new SqlParameter("@MedicID", MedicID); SqlParameter Param2 = new SqlParameter("@ProgramID", ProgramID); SqlParameter Param3 = new SqlParameter("@IPAddress", sIPAddress); InfiniEdge.SqlParameterCollection parameters = new InfiniEdge.SqlParameterCollection(); parameters.Add(Param1); parameters.Add(Param2); parameters.Add(Param3); clsUtility.ExecuteSP(sp, parameters); }
public void updateNote(string EncounterStatus, MedicNotes mNotes) { clsUtility.Connection = getConnectionString(); Type type = mNotes.GetType(); InfiniEdge.SqlParameterCollection parameters = new InfiniEdge.SqlParameterCollection(); foreach (PropertyInfo pi in type.GetProperties()) { if (pi.GetValue(mNotes, null) == null) { parameters.Add(new SqlParameter("@" + pi.Name, "")); } else { parameters.Add(new SqlParameter("@" + pi.Name, pi.GetValue(mNotes, null).ToString())); } } parameters.Add(new SqlParameter("@EncounterStatus", EncounterStatus)); parameters.Add(new SqlParameter("@patientID", Int32.Parse(HttpContext.Current.Session["PatientID"].ToString()))); clsUtility.ExecuteSP("updateNotes", parameters); }