public void SaveDiagUI(string ieID, string iDiagID, bool DiagChecked, string bp, string dcd, string dc) { string _ieMode = ""; long _ieID = Convert.ToInt64(ieID); long _DiagID = Convert.ToInt64(iDiagID); string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * FROM tblDiagCodesDetail WHERE PatientIE_ID = " + ieID + " AND Diag_Master_ID = " + _DiagID + " AND PatientFu_ID=" + Session["patientFUId"].ToString() + " and BodyPart like '%" + _CurBP + "%' "; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && DiagChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && DiagChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && DiagChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["Diag_Master_ID"] = _DiagID; TblRow["PatientIE_ID"] = _ieID; TblRow["PatientFU_ID"] = Session["patientFUId"].ToString(); TblRow["BodyPart"] = bp.ToString().Trim(); TblRow["DiagCode"] = dc.ToString().Trim(); TblRow["Description"] = dcd.ToString().Trim(); if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); }
public string SaveUI_Ajax() { string ieMode = "New"; string ieID = Session["PatientIE_ID"].ToString(); bool bpChecked = true; // string result= SaveUI(Session["PatientIE_ID"].ToString(), ieMode, true); long _ieID = Convert.ToInt64(ieID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblbpNeck WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; //TblRow["FreeForm"] = txtFreeForm.Text.ToString(); //TblRow["FreeFormCC"] = txtFreeFormCC.Text.ToString(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString().Trim().Replace(" ", string.Empty); TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["Xrays"] = false; //TBD TblRow["TPEpidular"] = false; //TBD TblRow["NoOfTPInjections"] = ""; // txtPainScale; TblRow["ScheduleEpidural"] = false; //txtPainScale; TblRow["NewMBB"] = false; // txtPainScale; TblRow["SPTPMBB"] = false; //txtPainScale; TblRow["ISFirst"] = true; if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (_ieMode == "New") { return("Neck has been added..."); } else if (_ieMode == "Update") { return("Neck has been updated..."); } else if (_ieMode == "Delete") { return("Neck has been deleted..."); } else { return(""); } }
public string SaveUI(string ieID, string fuID, string fuMode, bool bpIsChecked) { long _fuID = Convert.ToInt64(fuID); string _fuMode = ""; string sProvider = System.Configuration.ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblFUbpNeck WHERE PatientFU_ID = " + _fuID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpIsChecked == true) { _fuMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpIsChecked == false) { _fuMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpIsChecked == false) { _fuMode = "Delete"; } else { _fuMode = "Update"; } if (_fuMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_fuMode == "Update" || _fuMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_fuMode == "Update" || _fuMode == "New") { TblRow["PatientFU_ID"] = _fuID; //TblRow["FreeForm"] = txtFreeForm.Text.ToString(); //TblRow["FreeFormCC"] = txtFreeFormCC.Text.ToString(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString().Trim().Replace(" ", string.Empty); TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["Xrays"] = false; //TBD TblRow["TPEpidular"] = false; //TBD TblRow["NoOfTPInjections"] = ""; // txtPainScale; TblRow["ScheduleEpidural"] = false; //txtPainScale; TblRow["NewMBB"] = false; // txtPainScale; TblRow["SPTPMBB"] = false; //txtPainScale; TblRow["CCvalue"] = hdCCvalue.Value; TblRow["PEvalue"] = hdPEvalue.Value; TblRow["PEvalueoriginal"] = hdPEvalueoriginal.Value; TblRow["PESides"] = hdPESides.Value; TblRow["PESidesText"] = hdPESidesText.Value; string strname = "", strleft = "", strright = "", strnormal = "", strcname = "", strcrom = "", strcnormal = ""; for (int i = 0; i < repROM.Items.Count; i++) { Label lblname = repROM.Items[i].FindControl("lblname") as Label; TextBox txtleft = repROM.Items[i].FindControl("txtleft") as TextBox; TextBox txtright = repROM.Items[i].FindControl("txtright") as TextBox; TextBox txtnormal = repROM.Items[i].FindControl("txtnormal") as TextBox; strname = strname + "," + lblname.Text; strleft = strleft + "," + txtleft.Text; strright = strright + "," + txtright.Text; strnormal = strnormal + "," + txtnormal.Text; } TblRow["LeftROM"] = strleft.Substring(1); TblRow["RightROM"] = strright.Substring(1); TblRow["NormalROM"] = strnormal.Substring(1); TblRow["NameROM"] = strname.Substring(1); for (int i = 0; i < repROMCervical.Items.Count; i++) { Label lblname = repROMCervical.Items[i].FindControl("lblname") as Label; TextBox txtrom = repROMCervical.Items[i].FindControl("txtrom") as TextBox; TextBox txtnormal = repROMCervical.Items[i].FindControl("txtnormal") as TextBox; strcname = strcname + "," + lblname.Text; strcrom = strcrom + "," + txtrom.Text; strcnormal = strcnormal + "," + txtnormal.Text; } if (!string.IsNullOrEmpty(strcname)) { TblRow["CNameROM"] = strcname.Substring(1); } if (!string.IsNullOrEmpty(strcrom)) { TblRow["CROM"] = strcrom.Substring(1); } if (!string.IsNullOrEmpty(strcnormal)) { TblRow["CNormalROM"] = strcnormal.Substring(1); } if (_fuMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_fuMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (_fuMode == "New") { return("Neck has been added..."); } else if (_fuMode == "Update") { return("Neck has been updated..."); } else if (_fuMode == "Delete") { return("Neck has been deleted..."); } else { return(""); } }
public void SaveStdUI(string ieID, string iStdID, string heading, string pdesc) { string[] _Type = iStdID.Split('_'); int _StdID = Convert.ToInt32(_Type[0]); string Part = Convert.ToString(_Type[1]); string _ieMode = ""; long _ieID = Convert.ToInt64(ieID); //long _StdID = Convert.ToInt64(iStdID); string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblProceduresDetail WHERE PatientIE_ID = " + ieID + " AND ProcedureDetail_ID = " + _StdID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; //if (sqlTbl.Rows.Count == 0 && StdChecked == true) // _ieMode = "New"; //else if (sqlTbl.Rows.Count == 0 && StdChecked == false) // _ieMode = "None"; //else if (sqlTbl.Rows.Count > 0 && StdChecked == false) // _ieMode = "Delete"; //else _ieMode = "Update"; if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["ProcedureDetail_ID"] = _StdID; TblRow["PatientIE_ID"] = _ieID; if (Part.Equals("R")) { TblRow["Heading"] = heading.ToString().Trim(); TblRow["PDesc"] = pdesc.ToString().Trim(); } else if (Part.Equals("S")) { TblRow["S_Heading"] = heading.ToString().Trim(); TblRow["S_PDesc"] = pdesc.ToString().Trim(); } else if (Part.Equals("E")) { TblRow["E_Heading"] = heading.ToString().Trim(); TblRow["E_PDesc"] = pdesc.ToString().Trim(); } if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); }
public string SaveUI(string ieID, string ieMode, bool bpIsChecked) { long _ieID = Convert.ToInt64(ieID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblbpElbow WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpIsChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpIsChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpIsChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; TblRow["ExtensionROM1"] = txtExtension1.Text.Trim(); TblRow["ExtensionROM2"] = txtExtension2.Text.Trim(); TblRow["FlexionROM1"] = txtFlex1.Text.Trim(); TblRow["FlexionROM2"] = txtFlex2.Text.Trim(); TblRow["FlexionROMNormal"] = txtFlex3.Text.Trim(); TblRow["ExtensionROMNormal"] = txtExtension3.Text.Trim(); TblRow["SupinationROMNormal"] = txtSupination3.Text.Trim(); TblRow["PronationROMNormal"] = txtPronation3.Text.Trim(); TblRow["SupinationROM1"] = txtSupination1.Text.Trim(); TblRow["SupinationROM2"] = txtSupination2.Text.Trim(); TblRow["PronationROM1"] = txtPronation1.Text.Trim(); TblRow["PronationROM2"] = txtPronation2.Text.Trim(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString(); TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["CCvalue"] = hdCCvalue.Value; TblRow["PEvalue"] = hdPEvalue.Value; string strname = "", strleft = "", strright = "", strnormal = ""; for (int i = 0; i < repROM.Items.Count; i++) { Label lblname = repROM.Items[i].FindControl("lblname") as Label; TextBox txtleft = repROM.Items[i].FindControl("txtleft") as TextBox; TextBox txtright = repROM.Items[i].FindControl("txtright") as TextBox; TextBox txtnormal = repROM.Items[i].FindControl("txtnormal") as TextBox; strname = strname + "," + lblname.Text; strleft = strleft + "," + txtleft.Text; strright = strright + "," + txtright.Text; strnormal = strnormal + "," + txtnormal.Text; } TblRow["LeftROM"] = strleft.Substring(1); TblRow["RightROM"] = strright.Substring(1); TblRow["NormalROM"] = strnormal.Substring(1); TblRow["NameROM"] = strname.Substring(1); if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } if (_ieMode == "New") { return("Elbow has been added..."); } else if (_ieMode == "Update") { return("Elbow has been updated..."); } else if (_ieMode == "Delete") { return("Elbow has been deleted..."); } else { return(""); } }
public string SaveUI(string ieID, string ieMode) { string _ieMode = ""; long _ieID = Convert.ToInt64(ieID); string sProvider = System.Configuration.ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblPatientIE WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0) { _ieMode = "New"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["Comments"] = txtComment.Text.ToString().Trim(); TblRow["commentextra"] = txtCommentextra.Text.ToString().Trim(); TblRow["UpdateFlag"] = "NEW"; } if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); TblRow.Table.Dispose(); sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } if (_ieMode == "New") { return("Comments have been added..."); } else { return("Comments have been updated..."); } }
protected void btnSave_Click(object sender, EventArgs e) { try { DBHelperClass db = new DBHelperClass(); string query = ""; //query = "update tblPatientIEDetailPage1 set FreeForm='" + txt_FreeForm.Text + "' where PatientIE_ID=" + Session["PatientIE_ID"].ToString(); //int val = db.executeQuery(query); //if (val > 0) //{ query = "select top 1 * from tblPatientIEDetailPage2 where PatientIE_ID=" + Session["PatientIE_ID"].ToString(); DataSet ds = db.selectData(query); if (ds.Tables[0].Rows.Count == 0) { query = "insert into tblPatientIEDetailPage2 ("; query = query + "intactexcept,LEdtr,DTRtricepsRight,DTRtricepsLeft,DTRBicepsRight,DTRBicepsLeft,DTRBrachioRight,DTRBrachioLeft,UEdtr,DTRKneeLeft,DTRKneeRight,DTRAnkleLeft,DTRAnkleRight,Sensory,PinPrick,Lighttouch,"; query = query + "LEsen,LEL3Right,LEL3Left,LEL4Right,LEL4Left,LEL5Right,LEL5Left,LES1Left,LES1Right,LELumberParaspinalsLeft,LELumberParaspinalsRight,UEsen,UEC5Left,UEC5Right,UEC6Left,UEC6Right,UEC7Left,UEC7Right,UEC8Left,UEC8Right,UET1Right,UET1Left,UECervicalParaspinalsRight,UECervicalParaspinalsLeft,"; query = query + "LEmmst,LEHipFlexionRight,LEHipFlexionLeft,LEHipAbductionRight,LEHipAbductionLeft,LEKneeExtensionRight,LEKneeExtensionLeft,LEKneeFlexionRight,LEKneeFlexionLeft,LEAnkleDorsiRight,LEAnkleDorsiLeft,LEAnklePlantarRight,LEAnklePlantarLeft,LEAnkleExtensorRight,LEAnkleExtensorLeft,"; query = query + "UEmmst,UEShoulderAbductionRight,UEShoulderAbductionLeft,UEShoulderFlexionRight,UEShoulderFlexionLeft,UEElbowExtensionRight,UEElbowExtensionLeft,UEElbowFlexionRight,UEElbowFlexionLeft,UEElbowSupinationRight,UEElbowSupinationLeft,UEElbowPronationRight,UEElbowPronationLeft,UEWristFlexionRight,UEWristFlexionLeft,UEWristExtensionRight,UEWristExtensionLeft,UEHandGripStrengthRight,UEHandGripStrengthLeft,UEHandFingerAbductorsRight,UEHandFingerAbductorsLeft"; query = query + ") values ("; query = query + "'" + txtIntactExcept.Text + "','" + LEdtr.Checked + "','" + RTricepstxt.Text + "','" + LTricepstxt.Text + "','" + RBicepstxt.Text + "','" + LBicepstxt.Text + "','" + RBrachioradialis.Text + "','" + LBrachioradialis.Text + "','" + UExchk.Checked + "','" + LKnee.Text + "','" + RKnee.Text + "','" + LAnkle.Text + "','" + RAnkle.Text + "','" + txtSensory.Text.Replace("'", "''") + "','" + chkPinPrick.Checked + "','" + chkLighttouch.Checked + "',"; query = query + "'" + LESen_Click.Checked + "','" + TextBox4.Text + "','" + txtDMTL3.Text + "','" + TextBox6.Text + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox7.Text + "','" + TextBox10.Text + "','" + TextBox21.Text + "','" + TextBox24.Text + "','" + TextBox25.Text + "','" + UESen_Click.Checked + "','" + TextBox9.Text + "','" + txtUEC5Right.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox14.Text + "','" + TextBox15.Text + "','" + TextBox16.Text + "','" + TextBox18.Text + "','" + TextBox17.Text + "','" + TextBox20.Text + "','" + TextBox19.Text + "',"; query = query + "'" + LEmmst.Checked + "','" + TextBox23.Text + "','" + TextBox22.Text + "','" + TextBox41.Text + "','" + TextBox40.Text + "','" + TextBox27.Text + "','" + TextBox26.Text + "','" + TextBox43.Text + "','" + TextBox42.Text + "','" + TextBox29.Text + "','" + TextBox28.Text + "','" + TextBox45.Text + "','" + TextBox44.Text + "','" + TextBox47.Text + "','" + TextBox46.Text + "',"; query = query + "'" + UEmmst.Checked + "','" + TextBox31.Text + "','" + TextBox30.Text + "','" + TextBox49.Text + "','" + TextBox48.Text + "','" + TextBox33.Text + "','" + TextBox32.Text + "','" + TextBox51.Text + "','" + TextBox50.Text + "','" + TextBox53.Text + "','" + TextBox52.Text + "','" + TextBox55.Text + "','" + TextBox54.Text + "','" + TextBox37.Text + "','" + TextBox36.Text + "','" + TextBox57.Text + "','" + TextBox56.Text + "','" + TextBox39.Text + "','" + TextBox38.Text + "','" + TextBox59.Text + "','" + TextBox58.Text + "')"; } else { query = "update tblPatientIEDetailPage2 set "; query = query + "intactexcept='" + txtIntactExcept.Text + "',LEdtr = '" + LEdtr.Checked + "',DTRtricepsRight = '" + RTricepstxt.Text + "',DTRtricepsLeft ='" + LTricepstxt.Text + "',DTRBicepsRight ='" + RBicepstxt.Text + "',DTRBicepsLeft = '" + LBicepstxt.Text + "',DTRBrachioRight ='" + RBrachioradialis.Text + "',DTRBrachioLeft = '" + LBrachioradialis.Text + "' ,UEdtr = '" + UExchk.Checked + "',DTRKneeLeft = '" + LKnee.Text + "',DTRKneeRight = '" + RKnee.Text + "',DTRAnkleLeft = '" + LAnkle.Text + "' ,DTRAnkleRight = '" + RAnkle.Text + "',Sensory = '" + txtSensory.Text.Replace("'", "''") + "',PinPrick = '" + chkPinPrick.Checked + "',Lighttouch = '" + chkLighttouch.Checked + "',"; query = query + "LEsen = '" + LESen_Click.Checked + "',LEL3Right = '" + TextBox4.Text + "',LEL3Left = '" + txtDMTL3.Text + "',LEL4Right = '" + TextBox6.Text + "',LEL4Left = '" + TextBox5.Text + "',LEL5Right = '" + TextBox8.Text + "',LEL5Left = '" + TextBox7.Text + "',LES1Left = '" + TextBox10.Text + "',LES1Right = '" + TextBox21.Text + "',LELumberParaspinalsLeft = '" + TextBox24.Text + "',LELumberParaspinalsRight = '" + TextBox25.Text + "',UEsen ='" + UESen_Click.Checked + "',UEC5Left = '" + TextBox9.Text + "',UEC5Right = '" + txtUEC5Right.Text + "',UEC6Left = '" + TextBox11.Text + "',UEC6Right = '" + TextBox12.Text + "',UEC7Left = '" + TextBox13.Text + "',UEC7Right = '" + TextBox14.Text + "',UEC8Left = '" + TextBox15.Text + "',UEC8Right = '" + TextBox16.Text + "',UET1Right = '" + TextBox18.Text + "',UET1Left = '" + TextBox17.Text + "',UECervicalParaspinalsRight = '" + TextBox20.Text + "',UECervicalParaspinalsLeft = '" + TextBox19.Text + "',"; query = query + "LEmmst = '" + LEmmst.Checked + "',LEHipFlexionRight = '" + TextBox23.Text + "',LEHipFlexionLeft = '" + TextBox22.Text + "',LEHipAbductionRight = '" + TextBox41.Text + "',LEHipAbductionLeft = '" + TextBox40.Text + "',LEKneeExtensionRight = '" + TextBox27.Text + "',LEKneeExtensionLeft = '" + TextBox26.Text + "',LEKneeFlexionRight = '" + TextBox43.Text + "',LEKneeFlexionLeft = '" + TextBox42.Text + "',LEAnkleDorsiRight = '" + TextBox29.Text + "',LEAnkleDorsiLeft = '" + TextBox28.Text + "',LEAnklePlantarRight = '" + TextBox45.Text + "',LEAnklePlantarLeft = '" + TextBox44.Text + "',LEAnkleExtensorRight = '" + TextBox47.Text + "',LEAnkleExtensorLeft = '" + TextBox46.Text + "',"; query = query + "UEmmst = '" + UEmmst.Checked + "',UEShoulderAbductionRight = '" + TextBox31.Text + "',UEShoulderAbductionLeft = '" + TextBox30.Text + "',UEShoulderFlexionRight = '" + TextBox49.Text + "',UEShoulderFlexionLeft = '" + TextBox48.Text + "',UEElbowExtensionRight = '" + TextBox33.Text + "',UEElbowExtensionLeft = '" + TextBox32.Text + "',UEElbowFlexionRight = '" + TextBox51.Text + "',UEElbowFlexionLeft = '" + TextBox50.Text + "',UEElbowSupinationRight = '" + TextBox53.Text + "',UEElbowSupinationLeft = '" + TextBox52.Text + "',UEElbowPronationRight = '" + TextBox55.Text + "',UEElbowPronationLeft = '" + TextBox54.Text + "',UEWristFlexionRight = '" + TextBox37.Text + "',UEWristFlexionLeft = '" + TextBox36.Text + "',UEWristExtensionRight = '" + TextBox57.Text + "',UEWristExtensionLeft = '" + TextBox56.Text + "',UEHandGripStrengthRight = '" + TextBox39.Text + "',UEHandGripStrengthLeft = '" + TextBox38.Text + "',UEHandFingerAbductorsRight = '" + TextBox59.Text + "',UEHandFingerAbductorsLeft = '" + TextBox58.Text + "'"; query = query + " Where PatientIE_ID=" + Session["PatientIE_ID"].ToString() + ""; } ds.Dispose(); int val = db.executeQuery(query); query = "select top 1 * from tblPage3HTMLContent where PatientIE_ID=" + Session["PatientIE_ID"].ToString(); ds = db.selectData(query); if (ds.Tables[0].Rows.Count == 0) { query = "insert into tblPage3HTMLContent(PatientIE_ID,HTMLContent,topSectionHTML)values(@PatientIE_ID,@HTMLContent,@topSectionHTML)"; } else { query = "update tblPage3HTMLContent set HTMLContent=@HTMLContent,topSectionHTML=@topSectionHTML where PatientIE_ID=@PatientIE_ID"; } using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString)) using (SqlCommand command = new SqlCommand(query, connection)) { command.Parameters.AddWithValue("@PatientIE_ID", Session["PatientIE_ID"].ToString()); command.Parameters.AddWithValue("@HTMLContent", hdHTMLContent.Value); command.Parameters.AddWithValue("@topSectionHTML", hdtopHTMLContent.Value); connection.Open(); var results = command.ExecuteNonQuery(); connection.Close(); } if (val > 0) { try { long _ieID = Convert.ToInt64(Session["PatientIE_ID"].ToString()); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblPatientIEDetailPage3 WHERE PatientIE_ID = " + _ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0) { _ieMode = "New"; } else if (sqlTbl.Rows.Count > 0) { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; TblRow["GAIT"] = cboGAIT.Text.ToString(); TblRow["Ambulates"] = cboAmbulates.Text.ToString(); TblRow["Footslap"] = chkFootslap.Checked; TblRow["Kneehyperextension"] = chkKneehyperextension.Checked; TblRow["Unabletohealwalk"] = chkUnabletohealwalk.Checked; TblRow["Unabletotoewalk"] = chkUnabletotoewalk.Checked; TblRow["Other"] = txtOther.Text.ToString(); if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); } catch (Exception ex) { oSQLConn.Close(); } } ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "openPopup('mymodelmessage')", true); Logger.Info(Session["UserId"].ToString() + "--" + Session["uname"].ToString().Trim() + "-- Create IE - Page4 " + Session["PatientIE_ID"].ToString() + "--" + DateTime.Now); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } else { Response.Redirect("Page5.aspx"); } } catch (Exception ex) { } }
public string SaveUI(string fuID, string ieMode, bool bpChecked) { long _fuID = Convert.ToInt64(fuID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblFUbpMidBack WHERE PatientFU_ID = " + _fuID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientFU_ID"] = _fuID; //TblRow["PalpationAt"] = txtPalpationAt.Text.ToString(); //TblRow["Levels"] = cboLevels.Text.ToString(); //TblRow["ROM"] = cboROM.Text.ToString(); //TblRow["TPSide1"] = cboTPSide1.Text.ToString(); //TblRow["TPText1"] = txtTPText1.Text.ToString(); //TblRow["TPSide2"] = cboTPSide2.Text.ToString(); //TblRow["TPText2"] = txtTPText2.Text.ToString(); //TblRow["TPSide3"] = cboTPSide3.Text.ToString(); //TblRow["TPText3"] = txtTPText3.Text.ToString(); //TblRow["TPSide4"] = cboTPSide4.Text.ToString(); //TblRow["TPText4"] = txtTPText4.Text.ToString(); TblRow["FreeForm"] = txtFreeForm.Text.ToString(); //TblRow["FreeFormCC"] = txtFreeFormCC.Text.ToString(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString(); //TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["CCvalue"] = hdCCvalue.Value; TblRow["PEvalue"] = hdPEvalue.Value; TblRow["PEvalueoriginal"] = hdPEvalueoriginal.Value; TblRow["PESides"] = hdPESides.Value; TblRow["PESidesText"] = hdPESidesText.Value; if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (_ieMode == "New") { return("MidBack has been added..."); } else if (_ieMode == "Update") { return("MidBack has been updated..."); } else if (_ieMode == "Delete") { return("MidBack has been deleted..."); } else { return(""); } }
public void SaveStdUI(string ieID, string iStdID, bool StdIsChecked, string bp, string shd, string scc, string spe, string sa, string sp, bool bcf, bool bpn) { string _ieMode = ""; long _ieID = Convert.ToInt64(ieID); long _StdID = Convert.ToInt64(iStdID); string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblMacros WHERE PatientIE_ID = " + ieID + " AND Macro_Master_ID = " + _StdID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && StdIsChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && StdIsChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && StdIsChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["Macro_Master_ID"] = _StdID; TblRow["PatientIE_ID"] = _ieID; TblRow["BodayParts"] = bp.ToString().Trim(); TblRow["Heading"] = shd.ToString().Trim(); TblRow["CCDesc"] = scc.ToString().Trim(); TblRow["PEDesc"] = spe.ToString().Trim(); TblRow["ADesc"] = sa.ToString().Trim(); TblRow["PDesc"] = sp.ToString().Trim(); TblRow["CF"] = bcf; TblRow["PN"] = bpn; if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); }
public string SaveUI(string fuID, string ieMode, bool bpIsChecked) { _CurIEid = Session["PatientIE_ID2"].ToString(); _FuId = Session["patientFUId"].ToString(); long _fuID = Convert.ToInt64(_FuId); string _fuMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblFUbpOtherPart WHERE PatientFU_ID = " + _fuID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpIsChecked == true) { _fuMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpIsChecked == false) { _fuMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpIsChecked == false) { _fuMode = "Delete"; } else { _fuMode = "Update"; } if (_fuMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_fuMode == "Update" || _fuMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_fuMode == "Update" || _fuMode == "New") { TblRow["PatientFU_ID"] = _fuID; TblRow["OthersCC"] = txtOthersCC.Text.ToString(); TblRow["OthersPE"] = txtOthersPE.Text.ToString(); TblRow["OthersA"] = txtOthersA.Text.ToString(); TblRow["OthersP"] = txtOthersP.Text.ToString(); TblRow["RecommandationDetails"] = Request.Form[txtTreatmentParagraph.UniqueID]; TblRow["RecommandationDelimit"] = bindTeratMentPrintvalue(); TblRow["PONDetails"] = Request.Form[txtPONDetails.UniqueID]; TblRow["PONDelimit"] = bindPONPrintValue(); TblRow["PONPrint"] = ViewState["PONPrint"].ToString(); if (_fuMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_fuMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (_fuMode == "New") { return("other part has been added..."); } else if (_fuMode == "Update") { return("other part has been updated..."); } else if (_fuMode == "Delete") { return("other part has been deleted..."); } else { return(""); } }
public void testCF(string id, string val, string orgval, string painradiation, string painradiation1) { SqlConnection oSQLConn = new SqlConnection(); SqlCommand oSQLCmd = new SqlCommand(); string _ieMode = ""; string sProvider = System.Configuration.ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblTest WHERE id = " + id; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0) { _ieMode = "New"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["id"] = id; TblRow["value"] = val; TblRow["valueoriginal"] = orgval; TblRow["painradiation"] = painradiation; TblRow["painradiation1"] = painradiation1; if (_ieMode == "New") { sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); }
public void SaveMediUI(string ieID, string iMediID, bool MediIsChecked, string medi) { try { string _ieMode = ""; long _ieID = Convert.ToInt64(ieID); long _MediID = Convert.ToInt64(iMediID); string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * FROM tblMedicationRx WHERE PatientIE_ID = " + ieID + " AND MedicationID = " + _MediID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && MediIsChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && MediIsChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && MediIsChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["MedicationID"] = _MediID; TblRow["PatientIE_ID"] = _ieID; TblRow["Medicine"] = medi.ToString().Trim(); if (_ieMode == "New") { TblRow["UpdatedBy"] = "Admin"; TblRow["UpdatedDateTime"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); } catch (Exception ex) { log.Error(ex.Message); } }
public string SaveUI(string ieID, string ieMode, bool bpChecked) { try { long _ieID = Convert.ToInt64(ieID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblbpMidBack WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; //TblRow["FreeForm"] = txtFreeForm.Text.ToString(); //TblRow["FreeFormCC"] = txtFreeFormCC.Text.ToString(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString(); TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["CCvalue"] = hdCCvalue.Value; TblRow["PEvalue"] = hdPEvalue.Value; TblRow["PEvalueoriginal"] = hdPEvalueoriginal.Value; TblRow["PESides"] = hdPESides.Value; TblRow["PESidesText"] = hdPESidesText.Value; if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } if (_ieMode == "New") { return("MidBack has been added..."); } else if (_ieMode == "Update") { return("MidBack has been updated..."); } else if (_ieMode == "Delete") { return("MidBack has been deleted..."); } else { return(""); } } catch (Exception ex) { } return(""); }
public string SaveUI(string ieID, string ieMode, bool bpIsChecked) { long _ieID = Convert.ToInt64(ieID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblbpOtherPart WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpIsChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpIsChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpIsChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; TblRow["OthersCC"] = txtOthersCC.Text.ToString(); TblRow["OthersPE"] = txtOthersPE.Text.ToString(); TblRow["OthersA"] = txtOthersA.Text.ToString(); TblRow["OthersP"] = txtOthersP.Text.ToString(); TblRow["TreatMentDetails"] = Request.Form[txtTreatmentParagraph.UniqueID]; TblRow["TreatMentDelimit"] = bindTeratMentPrintvalue(); if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } if (_ieMode == "New") { return("Hip has been added..."); } else if (_ieMode == "Update") { return("Hip has been updated..."); } else if (_ieMode == "Delete") { return("Hip has been deleted..."); } else { return(""); } }
public string SaveUI(string ieID, string ieMode, bool bpIsChecked) { long _ieID = Convert.ToInt64(ieID); string _ieMode = ""; string sProvider = ConfigurationManager.ConnectionStrings["connString_V3"].ConnectionString; string SqlStr = ""; oSQLConn.ConnectionString = sProvider; oSQLConn.Open(); SqlStr = "Select * from tblbpHip WHERE PatientIE_ID = " + ieID; SqlDataAdapter sqlAdapt = new SqlDataAdapter(SqlStr, oSQLConn); SqlCommandBuilder sqlCmdBuilder = new SqlCommandBuilder(sqlAdapt); DataTable sqlTbl = new DataTable(); sqlAdapt.Fill(sqlTbl); DataRow TblRow; if (sqlTbl.Rows.Count == 0 && bpIsChecked == true) { _ieMode = "New"; } else if (sqlTbl.Rows.Count == 0 && bpIsChecked == false) { _ieMode = "None"; } else if (sqlTbl.Rows.Count > 0 && bpIsChecked == false) { _ieMode = "Delete"; } else { _ieMode = "Update"; } if (_ieMode == "New") { TblRow = sqlTbl.NewRow(); } else if (_ieMode == "Update" || _ieMode == "Delete") { TblRow = sqlTbl.Rows[0]; TblRow.AcceptChanges(); } else { TblRow = null; } if (_ieMode == "Update" || _ieMode == "New") { TblRow["PatientIE_ID"] = _ieID; //TblRow["ConstantLeft"] = chkContentLeft.Checked; //TblRow["IntermittentLeft"] = chkIntermittentLeft.Checked; //TblRow["ConstantRight"] = chkContentRight.Checked; //TblRow["IntermittentRight"] = chkIntermittentRight.Checked; //TblRow["WorseSittingLeft"] = chkWorseSittingLeft.Checked; //TblRow["WorseStandingLeft"] = chkWorseStandingLeft.Checked; //TblRow["WorseMovementLeft"] = chkWorseMovementLeft.Checked; //TblRow["WorseActivitiesLeft"] = chkWorseActivitiesLeft.Checked; //TblRow["WorseOtherLeft"] = txtWorseOtherLeft.Text.ToString(); //TblRow["WorseSittingRight"] = chkWorseSittingRight.Checked; //TblRow["WorseStandingRight"] = chkWorseStandingRight.Checked; //TblRow["WorseMovementRight"] = chkWorseMovementRight.Checked; //TblRow["WorseActivitiesRight"] = chkWorseActivitiesRight.Checked; //TblRow["WorseOtherRight"] = txtWorseOtherRight.Text.ToString(); //TblRow["GreaterTrochanterLeft"] = chkGreaterTrochanterLeft.Checked; //TblRow["PosteriorLeft"] = chkPosteriorLeft.Checked; //TblRow["IliotibialLeft"] = chkIliotibialLeft.Checked; //TblRow["GreaterTrochanterRight"] = chkGreaterTrochanterRight.Checked; //TblRow["PosteriorRight"] = chkPosteriorRight.Checked; //TblRow["IliotibialRight"] = chkIliotibialRight.Checked; TblRow["FlexRight"] = txtFlexRight.Text.ToString(); TblRow["IntRotationRight"] = txtIntRotationRight.Text.ToString(); TblRow["ExtRotationRight"] = txtExtRotationRight.Text.ToString(); TblRow["FlexLeft"] = txtFlexLeft.Text.ToString(); TblRow["IntRotationLeft"] = txtIntRotationLeft.Text.ToString(); TblRow["ExtRotationLeft"] = txtExtRotationLeft.Text.ToString(); TblRow["FlexNormal"] = txtFlexNormal.Text.ToString(); TblRow["IntRotationNormal"] = txtIntRotationNormal.Text.ToString(); TblRow["ExtRotationNormal"] = txtExtRotationNormal.Text.ToString(); TblRow["FreeFormA"] = txtFreeFormA.Text.ToString(); TblRow["FreeFormP"] = txtFreeFormP.Text.ToString(); TblRow["CCvalue"] = hdCCvalue.Value; string strname = "", strleft = "", strright = "", strnormal = ""; for (int i = 0; i < repROM.Items.Count; i++) { Label lblname = repROM.Items[i].FindControl("lblname") as Label; TextBox txtleft = repROM.Items[i].FindControl("txtleft") as TextBox; TextBox txtright = repROM.Items[i].FindControl("txtright") as TextBox; TextBox txtnormal = repROM.Items[i].FindControl("txtnormal") as TextBox; strname = strname + "," + lblname.Text; strleft = strleft + "," + txtleft.Text; strright = strright + "," + txtright.Text; strnormal = strnormal + "," + txtnormal.Text; } TblRow["LeftROM"] = strleft.Substring(1); TblRow["RightROM"] = strright.Substring(1); TblRow["NormalROM"] = strnormal.Substring(1); TblRow["NameROM"] = strname.Substring(1); TblRow["PEvalue"] = hdPEvalue.Value; if (_ieMode == "New") { TblRow["CreatedBy"] = "Admin"; TblRow["CreatedDate"] = DateTime.Now; sqlTbl.Rows.Add(TblRow); } sqlAdapt.Update(sqlTbl); } else if (_ieMode == "Delete") { TblRow.Delete(); sqlAdapt.Update(sqlTbl); } if (TblRow != null) { TblRow.Table.Dispose(); } sqlTbl.Dispose(); sqlCmdBuilder.Dispose(); sqlAdapt.Dispose(); oSQLConn.Close(); if (pageHDN.Value != null && pageHDN.Value != "") { Response.Redirect(pageHDN.Value.ToString()); } if (_ieMode == "New") { return("Hip has been added..."); } else if (_ieMode == "Update") { return("Hip has been updated..."); } else if (_ieMode == "Delete") { return("Hip has been deleted..."); } else { return(""); } }