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 ChangePassword(string userid, string password, string password1) { string ret = "0"; try { string sqlPassword = "******" + userid + "'"; DataTable dtPassword = op.ExecuteDataTable(sqlPassword, CommandType.Text, null); string Password = dtPassword.Rows[0]["Password"].ToString(); if (Password == password) { string sql = string.Format("update Users set Password='******' where UserID='" + userid + "' and Password='******'"); op.ExecuteNonQuery(sql, CommandType.Text, null); ret = "1"; } } catch { } return(ret); }