public DataTable GetDataTable(string[] Element) { DataTable newDT = new DataTable("DataTable"); string sSql = string.Format("select {3} * from {0} where 1=1 {1} {2}", Element[0], Element[1], Element[2], Element[3]); DataSet sDs = new MyDataOp().CreateDataSet(sSql); if (sDs.Tables[0].Rows.Count > 0) { newDT = sDs.Tables[0]; } return(newDT); }
public string GetUserGuid(string username, string password) { string guid = string.Empty; //string sSql = "select id,UserID,t_R_UserInfo.RoleID,Name,PWDModifyTime,LevelID,ReadRight,WriteRight,RefreshRight,id from t_R_UserInfo inner join t_R_Role on t_R_Role.RoleID=t_R_UserInfo.RoleID where UserID='" + txt_UserName.Text.Trim() + "' and PWD='" + txt_Pwd.Text.Trim() + "'"; string sSql = string.Format("select GUID from [User] where UserName = '******' and PassWord = '******'", username, password); DataSet sDs = new MyDataOp().CreateDataSet(sSql); if (sDs.Tables[0].Rows.Count == 1) { guid = sDs.Tables[0].Rows[0][0].ToString(); } return(guid); }
public bool blBeWrite(string pagename, string userguid) { bool blSuccess = false; string sSql = string.Format("select btUserMenuWrite from View_Ac_UserRole where vUserGuid = '{0}' and vMenuFile like '%{1}%'", userguid, pagename); DataSet sDs = new MyDataOp().CreateDataSet(sSql); if (sDs != null && sDs.Tables[0].Rows.Count > 0) { if (sDs.Tables[0].Rows[0][0].ToString() == "True") { blSuccess = true; } } return(blSuccess); }