public int AddData(int x, int y, int width, int height, double size) { string cmdText = "insert into RegUnitInfo(size,GlobalPosX,GlobalPosY,Width,Height) Values('" + size + "','" + x + "','" + y + "','" + width + "','" + height + "')"; op.ExecuteNonQuery(cmdText, CommandType.Text, null); DataTable dataTable = op.ExecuteDataTable("select id,size,GlobalPosX,GlobalPosY,Width,Height from RegUnitInfo", CommandType.Text, null); CtcVo ctcVo = new CtcVo(); ctcVo.index = dataTable.Rows[dataTable.Rows.Count - 1]["id"].ToString(); ctcVo.GlobalPosX = x; ctcVo.GlobalPosY = y; ctcVo.Width = width; ctcVo.Height = height; ctcVo.Size = Math.Round(size, 2).ToString(); listvo.Add(ctcVo); DgList.ItemsSource = null; DgList.ItemsSource = listvo; return(int.Parse(ctcVo.index)); }
public string GetConsultationInfo(string StarPage, string EndPage) { string sql = string.Format("select * from(" + "select ROW_NUMBER() OVER (order by ConsultStatusID desc) as RowNumber," + " b.*,d.*" + " from Consultation a left join cases b on a.ConsultID=b.ConsultID" + " left join Diagnosis c on c.ConsultID=a.ConsultID" + " left join Hospital d on a.HisID=d.HisID" + " left join Users e on e.UserID=d.UserID" + " where 1=1 {2}) T where RowNumber between {0} and {1}", StarPage, EndPage, ""); DataTable dt = op.ExecuteDataTable(sql, CommandType.Text, null); return(JsonConvert.SerializeObject(dt)); }
public string GetCaseInfo(string ConsultID, string UserID) { string sql = string.Format("select b.*,d.*,ConsultTime,c.Diagnosis,c.Diagnosis_Remark,c.RecheckReturn," + "(select count(1) from Slide where ConsultID=" + ConsultID + " ) as slidecount, " + "(select count(1) from Annex where ConsultID=" + ConsultID + " ) as annexcount," + "(select Diagnosis from Draft where ConsultID=" + ConsultID + " ) as DraftDiagnosis," + "(select Diagnosis_Remark from Draft where ConsultID=" + ConsultID + " ) as DraftDiagnosis_Remark," + "(select 1 from Collect where ConsultID=" + ConsultID + " and UserID=" + UserID + " ) as IsCollect," + "(select Reason from Invite where ConsultID=" + ConsultID + " and ToExpID=" + UserID + " ) as InviteReason," + "(select Diagnosis from Invite where ConsultID=" + ConsultID + " and ToExpID=" + UserID + " ) as DiagnosisReason " + " from Consultation a left join cases b on a.ConsultID=b.ConsultID" + " left join Diagnosis c on c.ConsultID=a.ConsultID" + " left join Hospital d on a.HisID=d.HisID" + " left join Users e on e.UserID=d.UserID where a.ConsultID=" + ConsultID); DataTable dt = op.ExecuteDataTable(sql, CommandType.Text, null); return(JsonConvert.SerializeObject(dt)); }