public FriendLinkCategoryInfo GetDataById(int fc_id) { FriendLinkCategoryInfo info = new FriendLinkCategoryInfo(); IDataReader reader = db.GetDataByID(fc_id).CreateDataReader(); if (reader.Read()) { info = FriendLinkCategoryInfo.Populate(reader); } return(info); }
public List <FriendLinkCategoryInfo> GetDataByLid(int lid) { List <FriendLinkCategoryInfo> infos = new List <FriendLinkCategoryInfo>(); IDataReader reader = db.GetDataByLid(lid).CreateDataReader(); while (reader.Read()) { infos.Add(FriendLinkCategoryInfo.Populate(reader)); } return(infos); }
public void Bind() { if (id != 0) { if (Tools.TryParseMethod(id.ToString()) > 0) { info = fcBLL.GetDataById(Tools.GetInt32SafeFromQueryString(this.Page, "id", 0)); txtName.Text = info.fc_title; lbCreate.Text = info.fc_CreateDate.ToShortDateString(); //rbShow.SelectedValue = info.fc_show.ToString().ToLower(); } } }
protected void Button1_Click(object sender, EventArgs e) { info = fcBLL.GetDataById(Tools.GetInt32SafeFromQueryString(this.Page, "id", 0)); info.fc_title = txtName.Text; //info.fc_show = bool.Parse(rbShow.SelectedValue); if (fcBLL.Update(info) > 0) { Response.Redirect("List.aspx?header=" + Getmessage("30014")); } else { ShowMessage("修改失敗"); } }
protected void Button1_Click(object sender, EventArgs e) { if (txtName.Text.Trim() != string.Empty) { FriendLinkCategoryInfo info = new FriendLinkCategoryInfo(); info.fc_title = txtName.Text.Trim(); info.fc_CreateDate = DateTime.Now; info.l_id = lid; //info.fc_show = bool.Parse(rbShow.SelectedValue); if (fcBLL.Insert(info) > 0) { Response.Redirect("List.aspx?header=職稱:" + Getmessage("30009")); } } else { ShowMessage("請輸入標題"); } }
public int Update(FriendLinkCategoryInfo info) { return(db.Update(info.fc_title, info.fc_CreateDate, info.fc_show, info.l_id, info.fc_id)); }
public int Insert(FriendLinkCategoryInfo info) { return(db.Insert(info.fc_title, info.fc_CreateDate, info.fc_show, info.l_id)); }