public static Vacation GetbyId(string id) { a = new Vacation(); string sql = string.Format("select * from T_Vacation where Number='{0}'", id); dr = DBAcess.GetDataRow(sql); try { a.number = dr["Number"].ToString(); a.id = dr["ID"].ToString(); a.name = dr["name"].ToString(); a.type = dr["type"].ToString(); a.reason = dr["reason"].ToString(); a.daystart = dr["daystart"].ToString(); a.dayover = dr["dayover"].ToString(); a.applytime = dr["applytime"].ToString(); a.agreepeople = dr["agreepeople"].ToString(); a.condition = dr["condition"].ToString(); return(a); } catch { return(a); } }
public static Student GetbyId(string id) { a = new Student(); string sql = string.Format("select * from T_Student where id='{0}'", id); dr = DBAcess.GetDataRow(sql); try { a.Id = dr["ID"].ToString(); a.Name = dr["name"].ToString(); a.Sex = dr["sex"].ToString(); a.Political = dr["political"].ToString(); a.Pincodes = dr["pincodes"].ToString(); a.Grade = dr["grade"].ToString(); a.class1 = dr["class"].ToString(); a.Address = dr["address"].ToString(); a.Phone = dr["phone"].ToString(); a.Main = Convert.ToBoolean(dr["main"]); a.Imgurl = dr["img"].ToString(); return(a); } catch { //throw ei; // return null; return(a); } }
public static Student GetbyId(object id) { a = new Student(); string sql = string.Format("select * from T_Student where id='{0}'", id); dr = DBAcess.GetDataRow(sql); try { a.Id = dr["id"]; a.Name = dr["Name"].ToString(); a.Classes = dr["Classes"].ToString(); a.Major = dr["Major"].ToString(); a.College = dr["College"].ToString(); a.Grade = dr["grade"]; a.Sex = dr["Sex"].ToString(); a.Address = dr["Address"].ToString(); a.Pincodes = dr["pincodes"].ToString(); a.Imgurl = dr["Imgurl"].ToString(); a.DayRuxue = dr["Dayruxue"].ToString(); //a.Imgurl = dr["picture"].ToString(); a.Main = true; return(a); } catch { //throw ei; // return null; return(a); } }
public static Score getRow(int sid) { sc = new Score(); string sql = string.Format("select T_Score.cid,cname,score from T_Score,T_Course where sid='{0}'", sid); dr = DBAcess.GetDataRow(sql); try { sc.Cid = int.Parse(dr["cid"].ToString()); sc.Cname = dr["cname"].ToString(); sc.Scores = int.Parse(dr["score"].ToString()); return(sc); } catch { return(null); } }
public static Admin getRow(string id) { sc = new Admin(); string sql = string.Format("select * from T_Admin where id='{0}'", id); dr = DBAcess.GetDataRow(sql); try { sc.Id = dr["id"].ToString(); sc.Password = dr["password"].ToString(); sc.Privilege = int.Parse(dr["privilege"].ToString()); return(sc); } catch { return(null); } }