- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
public static object get_pack_print(int packid)
{
OracleConnection conn = connect();
conn.Open();
string json = "";
string sql1 = "select id, num, k01.fio||' '||k01.fnam||' '||k01.fot fio, k02.fio||' '||k02.fnam||' '||k02.fot fior, s01.s_name_s sno, s02.s_name_s snor " +
"from ertd_card ec, HCM_K01@DBLKIPR k01, HCM_K01@DBLKIPR k02, HCM_S01@DBLKIPR s01, HCM_S01@DBLKIPR s02 " +
"where " +
"EC.PACKID=" + packid +
" and k01.tnr = ec.tnr " +
"and k02.tnr = ec.tnrr " +
"and s01.s_no = ec.sno " +
"and s02.s_no = ec.snor " +
"and ec.del= 0";
try
{
OracleCommand cmd = new OracleCommand(sql1, conn);
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();
do
{
if (string.IsNullOrEmpty(json))
{
json += "{\"data\":[{\"id\":\"" + dr["id"].ToString() + "\",\"num\":\"" + dr["num"].ToString() + "\",\"sno\":\"" + dr["sno"].ToString() + "\",\"snor\":\"" + dr["snor"].ToString() +
"\",\"fio\":\"" + dr["fio"].ToString() +
"\",\"fior\":\"" + dr["fior"].ToString() + "\"}";
}
else
{
json += ",{\"id\":\"" + dr["id"].ToString() + "\",\"num\":\"" + dr["num"].ToString() + "\",\"sno\":\"" + dr["sno"].ToString() + "\",\"snor\":\"" + dr["snor"].ToString() +
"\",\"fio\":\"" + dr["fio"].ToString() +
"\",\"fior\":\"" + dr["fior"].ToString() + "\"}";
}
}
while (dr.Read());
json += "]}";
conn.Close();
return new System.Web.Script.Serialization.JavaScriptSerializer().DeserializeObject(json);
}
catch (Exception ex)
{
conn.Close();
return null;
}
}
да просто стиль у него такой. Суровый.
+= "}"