|
|
@@ -48,5 +48,117 @@ namespace RMYY_CallCenter_Api.Dal
|
|
48
|
48
|
return Convert.ToInt32(obj);
|
|
49
|
49
|
}
|
|
50
|
50
|
}
|
|
|
51
|
+ /// <summary>
|
|
|
52
|
+ /// 更新一条数据
|
|
|
53
|
+ /// </summary>
|
|
|
54
|
+ public bool Update(RMYY_CallCenter_Api.Model.T_Sys_Login_Logs model)
|
|
|
55
|
+ {
|
|
|
56
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
57
|
+ strSql.Append("update T_Sys_Login_Logs set ");
|
|
|
58
|
+ strSql.Append("T_username=@T_username,");
|
|
|
59
|
+ strSql.Append("T_usercode=@T_usercode,");
|
|
|
60
|
+ strSql.Append("T_result=@T_result,");
|
|
|
61
|
+ strSql.Append("T_login_ip=@T_login_ip,");
|
|
|
62
|
+ strSql.Append("T_channel=@T_channel,");
|
|
|
63
|
+ strSql.Append("T_time=@T_time,");
|
|
|
64
|
+ strSql.Append("T_LoginOutDate=@T_LoginOutDate");
|
|
|
65
|
+ strSql.Append(" where T_id=@T_id");
|
|
|
66
|
+ SqlParameter[] parameters = {
|
|
|
67
|
+ new SqlParameter("@T_username", SqlDbType.NVarChar,100),
|
|
|
68
|
+ new SqlParameter("@T_usercode", SqlDbType.NVarChar,100),
|
|
|
69
|
+ new SqlParameter("@T_result", SqlDbType.NVarChar,100),
|
|
|
70
|
+ new SqlParameter("@T_login_ip", SqlDbType.NVarChar,100),
|
|
|
71
|
+ new SqlParameter("@T_channel", SqlDbType.Int,4),
|
|
|
72
|
+ new SqlParameter("@T_time", SqlDbType.DateTime),
|
|
|
73
|
+ new SqlParameter("@T_LoginOutDate", SqlDbType.DateTime),
|
|
|
74
|
+ new SqlParameter("@T_id", SqlDbType.Int,4)};
|
|
|
75
|
+ parameters[0].Value = model.T_username;
|
|
|
76
|
+ parameters[1].Value = model.T_usercode;
|
|
|
77
|
+ parameters[2].Value = model.T_result;
|
|
|
78
|
+ parameters[3].Value = model.T_login_ip;
|
|
|
79
|
+ parameters[4].Value = model.T_channel;
|
|
|
80
|
+ parameters[5].Value = model.T_time;
|
|
|
81
|
+ parameters[6].Value = model.T_LoginOutDate;
|
|
|
82
|
+ parameters[7].Value = model.T_id;
|
|
|
83
|
+
|
|
|
84
|
+ int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
|
|
|
85
|
+ if (rows > 0)
|
|
|
86
|
+ {
|
|
|
87
|
+ return true;
|
|
|
88
|
+ }
|
|
|
89
|
+ else
|
|
|
90
|
+ {
|
|
|
91
|
+ return false;
|
|
|
92
|
+ }
|
|
|
93
|
+ }
|
|
|
94
|
+ /// <summary>
|
|
|
95
|
+ /// 根据工单编号得到一个最新对象实体
|
|
|
96
|
+ /// </summary>
|
|
|
97
|
+ public RMYY_CallCenter_Api.Model.T_Sys_Login_Logs GetModel(string T_usercode)
|
|
|
98
|
+ {
|
|
|
99
|
+
|
|
|
100
|
+ StringBuilder strSql = new StringBuilder();
|
|
|
101
|
+ strSql.Append("select top 1 * from T_Sys_Login_Logs WITH(NOLOCK) ");
|
|
|
102
|
+ strSql.Append(" where T_usercode=@T_usercode and F_IsDelete=0 ");
|
|
|
103
|
+ strSql.Append(" order by T_time desc");
|
|
|
104
|
+ SqlParameter[] parameters = {
|
|
|
105
|
+ new SqlParameter("@T_usercode", SqlDbType.NVarChar,50)
|
|
|
106
|
+ };
|
|
|
107
|
+ parameters[0].Value = T_usercode;
|
|
|
108
|
+
|
|
|
109
|
+ DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
|
|
|
110
|
+ if (ds.Tables[0].Rows.Count > 0)
|
|
|
111
|
+ {
|
|
|
112
|
+ return DataRowToModel(ds.Tables[0].Rows[0]); ;
|
|
|
113
|
+ }
|
|
|
114
|
+ else
|
|
|
115
|
+ {
|
|
|
116
|
+ return null;
|
|
|
117
|
+ }
|
|
|
118
|
+ }
|
|
|
119
|
+ /// <summary>
|
|
|
120
|
+ /// 得到一个对象实体
|
|
|
121
|
+ /// </summary>
|
|
|
122
|
+ public RMYY_CallCenter_Api.Model.T_Sys_Login_Logs DataRowToModel(DataRow row)
|
|
|
123
|
+ {
|
|
|
124
|
+ RMYY_CallCenter_Api.Model.T_Sys_Login_Logs model = new RMYY_CallCenter_Api.Model.T_Sys_Login_Logs();
|
|
|
125
|
+ if (row != null)
|
|
|
126
|
+ {
|
|
|
127
|
+ if (row["T_id"] != null && row["T_id"].ToString() != "")
|
|
|
128
|
+ {
|
|
|
129
|
+ model.T_id = row["T_id"].ToString();
|
|
|
130
|
+ }
|
|
|
131
|
+ if (row["T_username"] != null)
|
|
|
132
|
+ {
|
|
|
133
|
+ model.T_username = row["T_username"].ToString();
|
|
|
134
|
+ }
|
|
|
135
|
+ if (row["T_usercode"] != null)
|
|
|
136
|
+ {
|
|
|
137
|
+ model.T_usercode = row["T_usercode"].ToString();
|
|
|
138
|
+ }
|
|
|
139
|
+ if (row["T_result"] != null)
|
|
|
140
|
+ {
|
|
|
141
|
+ model.T_result = row["T_result"].ToString();
|
|
|
142
|
+ }
|
|
|
143
|
+ if (row["T_login_ip"] != null)
|
|
|
144
|
+ {
|
|
|
145
|
+ model.T_login_ip = row["T_login_ip"].ToString();
|
|
|
146
|
+ }
|
|
|
147
|
+ if (row["T_channel"] != null && row["T_channel"].ToString() != "")
|
|
|
148
|
+ {
|
|
|
149
|
+ model.T_channel = int.Parse(row["T_channel"].ToString());
|
|
|
150
|
+ }
|
|
|
151
|
+ if (row["T_time"] != null && row["T_time"].ToString() != "")
|
|
|
152
|
+ {
|
|
|
153
|
+ model.T_time = DateTime.Parse(row["T_time"].ToString());
|
|
|
154
|
+ }
|
|
|
155
|
+ if (row["T_LoginOutDate"] != null && row["T_LoginOutDate"].ToString() != "")
|
|
|
156
|
+ {
|
|
|
157
|
+ model.T_LoginOutDate = DateTime.Parse(row["T_LoginOutDate"].ToString());
|
|
|
158
|
+ }
|
|
|
159
|
+ }
|
|
|
160
|
+ return model;
|
|
|
161
|
+ }
|
|
|
162
|
+
|
|
51
|
163
|
}
|
|
52
|
164
|
}
|