本文整理汇总了C#中DBLayer类的典型用法代码示例。如果您正苦于以下问题:C# DBLayer类的具体用法?C# DBLayer怎么用?C# DBLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DBLayer类属于命名空间,在下文中一共展示了DBLayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["CurrentUser"] == null)
{
Response.Redirect("Login.aspx");
}
if (CurrentPage != 0)
{
//BindData();
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetPageContent(CurrentPage);
if (ds.Tables[0].Rows.Count > 0)
{
uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
}
uiPanelCurrentPages.Visible = false;
uiPanelCurrent.Visible = true;
}
else
{
Response.Redirect("AdminCP.aspx");
}
}
}
示例2: uiGridViewCats_RowCommand
protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditCat")
{
int id = Convert.ToInt32(e.CommandArgument.ToString());
CurrentCat = id;
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetCategoryContent(id);
if (ds.Tables[0].Rows.Count > 0)
{
uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString();
uiTextBoxArTitle.Text = ds.Tables[0].Rows[0]["CategoryArName"].ToString();
}
uiPanelCurrentPages.Visible = false;
uiPanelCurrent.Visible = true;
}
else if (e.CommandName == "DeleteCat")
{
int id = Convert.ToInt32(e.CommandArgument.ToString());
CurrentCat = id;
DBLayer db = new DBLayer();
db.DeleteCategory(id);
BindData();
}
}
示例3: uiLinkButtonUpdate_Click
protected void uiLinkButtonUpdate_Click(object sender, EventArgs e)
{
DBLayer db = new DBLayer();
string imagepath = "";
if (uiFileUploadImage.HasFile)
{
uiFileUploadImage.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName));
imagepath = ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName;
}
// update
if (CurrentPackage != 0)
{
DataSet ds = new DataSet();
ds = db.GetPackageContent(CurrentPackage);
string temp = ds.Tables[0].Rows[0]["arImagepath"].ToString();
if (temp != imagepath && string.IsNullOrEmpty(imagepath))
db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, temp, Convert.ToInt32(uiTextBoxOrder.Text));
else
db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text));
}
else // add new
{
db.AddArabicPackageContent(uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text));
}
uiPanelViewPackages.Visible = true;
uiPanelEditPackage.Visible = false;
ClearFields();
CurrentPackage = 0;
BindData();
}
示例4: uiGridViewNews_RowCommand
protected void uiGridViewNews_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Editmails")
{
int id = Convert.ToInt32(e.CommandArgument.ToString());
CurrentMail = id;
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetNewsContent(id);
if (ds.Tables[0].Rows.Count > 0)
{
uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Email"].ToString();
uiTextBoxPosition.Text = ds.Tables[0].Rows[0]["Position"].ToString();
}
uiPanelCurrentNews.Visible = false;
uiPanelCurrent.Visible = true;
}
else if (e.CommandName == "Deletemails")
{
DBLayer db = new DBLayer();
db.DeleteBookingMails(Convert.ToInt32(e.CommandArgument.ToString()));
BindData();
uiPanelCurrentNews.Visible = true;
uiPanelCurrent.Visible = false;
}
}
示例5: uiGridViewContacts_RowCommand
protected void uiGridViewContacts_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditContact")
{
DBLayer db = new DBLayer();
CurrentContact = Convert.ToInt32(e.CommandArgument);
DataSet ds = db.GetContactContent(CurrentContact);
uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
uiTextBoxLatitude.Text = ds.Tables[0].Rows[0]["Latitude"].ToString();
uiTextBoxLongitude.Text = ds.Tables[0].Rows[0]["Longitude"].ToString();
uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
uiTextBoxMail.Text = ds.Tables[0].Rows[0]["email"].ToString();
uiPanelViewContact.Visible = false;
uiPanelEdit.Visible = true;
}
else if (e.CommandName == "DeleteContact")
{
DBLayer db = new DBLayer();
db.DeleteContact(Convert.ToInt32(e.CommandArgument));
CurrentContact = 0;
BindData();
}
}
示例6: BindData
private void BindData()
{
DBLayer db = new DBLayer();
if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue))
uiDataListPhotos.DataSource = db.GetAllProductByCatID(Convert.ToInt32(uiDropDownListCats.SelectedValue));
uiDataListPhotos.DataBind();
}
示例7: uiGridViewBlocks_RowCommand
protected void uiGridViewBlocks_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditBlock")
{
int id = Convert.ToInt32(e.CommandArgument.ToString());
CurrentBlock = id;
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetBlockContent(id);
if (ds.Tables[0].Rows.Count > 0)
{
uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
uiFCKeditor.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Brief"].ToString());
if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Imagepath"].ToString()))
{
uiImageCurrent.ImageUrl = ds.Tables[0].Rows[0]["Imagepath"].ToString();
uiImageCurrent.Visible = true;
}
else
{
uiImageCurrent.Visible = false;
}
}
uiPanelCurrentBlocks.Visible = false;
uiPanelCurrent.Visible = true;
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["SID"] != null && !string.IsNullOrEmpty(Request.QueryString["SID"]))
{
uiPanelAllServices.Visible = false;
uiPanelViewService.Visible = true;
int id = Convert.ToInt32(Request.QueryString["SID"].ToString());
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetServicesContent(id);
uiImageService.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString();
uiLabelTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
uiLiteralBrief.Text = ds.Tables[0].Rows[0]["arBrief"].ToString();
uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());
}
else
{
uiPanelAllServices.Visible = true;
uiPanelViewService.Visible = false;
BindData();
}
}
RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m4\").addClass(\"selected\");</script>");
}
示例9: UpdateFields
public int UpdateFields(int fieldId)
{
int successStatusCode = 0;
DBLayer dbLayerUpdateFieldTable = new DBLayer();
successStatusCode = dbLayerUpdateFieldTable.GetUpdateFieldTable(fieldId);
return successStatusCode;
}
示例10: LoadDDls
private void LoadDDls()
{
DBLayer db = new DBLayer();
uiDropDownListCats.DataSource = db.GetAllCats();
uiDropDownListCats.DataTextField = "CategoryName";
uiDropDownListCats.DataValueField = "ID";
uiDropDownListCats.DataBind();
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetPageContent(2);
uiLabelTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
}
示例12: uiDataListProductMedia_ItemCommand
protected void uiDataListProductMedia_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
DBLayer db = new DBLayer();
db.Deleteitem(Convert.ToInt32(e.CommandArgument));
LoadProjectPhotos();
}
}
示例13: BindProducts
private void BindProducts()
{
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetAllProductByCatID(Convert.ToInt32(Request.QueryString["cid"].ToString()));
uiRepeaterProducts.DataSource = ds;
uiRepeaterProducts.DataBind();
}
示例14: GetExistingData
public DataTable GetExistingData()
{
DataTable dtExistingData = new DataTable();
DBLayer dbLayerExistingData = new DBLayer();
dtExistingData = dbLayerExistingData.GetExistingData();
return dtExistingData;
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DBLayer db = new DBLayer();
uiRepeaterCats.DataSource = db.GetAllCats();
uiRepeaterCats.DataBind();
uiRepeaterGallery.DataSource = db.GetAllProducts();
uiRepeaterGallery.DataBind();
}