• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DBLayer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DBLayer的典型用法代码示例。如果您正苦于以下问题:C# DBLayer类的具体用法?C# DBLayer怎么用?C# DBLayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DBLayer类属于命名空间,在下文中一共展示了DBLayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
         }
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:28,代码来源:EditPageContent.aspx.cs


示例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();
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:26,代码来源:EditCategories.aspx.cs


示例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();
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:30,代码来源:EditPackages.aspx.cs


示例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;
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:26,代码来源:BookingMails.aspx.cs


示例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();

            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:25,代码来源:contactUs.aspx.cs


示例6: BindData

 private void BindData()
 {
     DBLayer db = new DBLayer();
     if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue))
         uiDataListPhotos.DataSource = db.GetAllProductByCatID(Convert.ToInt32(uiDropDownListCats.SelectedValue));
     uiDataListPhotos.DataBind();
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:7,代码来源:EditGallery.aspx.cs


示例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;
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:27,代码来源:EditHomeBlocks.aspx.cs


示例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>");
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:26,代码来源:Services.aspx.cs


示例9: UpdateFields

 public int UpdateFields(int fieldId)
 {
     int successStatusCode = 0;
     DBLayer dbLayerUpdateFieldTable = new DBLayer();
     successStatusCode = dbLayerUpdateFieldTable.GetUpdateFieldTable(fieldId);
     return successStatusCode;
 }
开发者ID:pradeepkiran,项目名称:Test,代码行数:7,代码来源:UpdateFieldTable.aspx.cs


示例10: LoadDDls

 private void LoadDDls()
 {
     DBLayer db = new DBLayer();
     uiDropDownListCats.DataSource = db.GetAllCats();
     uiDropDownListCats.DataTextField = "CategoryName";
     uiDropDownListCats.DataValueField = "ID";
     uiDropDownListCats.DataBind();
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:8,代码来源:EditGallery.aspx.cs


示例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());
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:8,代码来源:default.aspx.cs


示例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();
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:9,代码来源:EditProjects.aspx.cs


示例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();
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:9,代码来源:ProductMaster.Master.cs


示例14: GetExistingData

    public DataTable GetExistingData()
    {
        DataTable dtExistingData = new DataTable();
        DBLayer dbLayerExistingData = new DBLayer();

        dtExistingData = dbLayerExistingData.GetExistingData();

        return dtExistingData;
    }
开发者ID:pradeepkiran,项目名称:Test,代码行数:9,代码来源:DeleteAllUsers.aspx.cs


示例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();
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:10,代码来源:Gallery.aspx.cs


示例16: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            DBLayer db = new DBLayer();
            DataSet ds = new DataSet();
            ds = db.GetAllNews();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                uiLiteralTicker.Text += ds.Tables[0].Rows[i]["arContent"].ToString() + " | ";
            }

            uiLiteralTicker.Text = uiLiteralTicker.Text.Remove(uiLiteralTicker.Text.LastIndexOf("|"));
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:12,代码来源:Ticker.ascx.cs


示例17: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLayer db = new DBLayer();
         DataSet ds = new DataSet();
         ds = db.GetBlockContent(2);
         uiLiteralTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString();
         uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arBrief"].ToString());
         uiImageBlock.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString();
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:12,代码来源:About.ascx.cs


示例18: uiLinkButtonSubmit_Click

        protected void uiLinkButtonSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(Request.QueryString["TID"].ToString());
                DBLayer db = new DBLayer();
                DataSet ds = new DataSet();
                ds = db.GetTourismlistContent(id);

                MailMessage msg = new MailMessage();
                DataSet to = db.GetAllMails();
                foreach (DataRow item in to.Tables[0].Rows)
                {
                    msg.To.Add(item["Email"].ToString());
                }

                //msg.To.Add("[email protected]");
                msg.From = new MailAddress("[email protected]");
                //msg.From = new MailAddress("[email protected]");

                msg.Subject = " Email from booking page";
                msg.IsBodyHtml = true;
                msg.BodyEncoding = System.Text.Encoding.Unicode;

                msg.Body = " الإسم : " + uiDropDownListTitle.Text + " " + uiTextBoxName.Text;
                msg.Body += "<br/> البريد الإلكترونى : " + uiTextBoxEmail.Text;
                msg.Body += "<br/> الشارع : " + uiTextBoxStreet.Text;
                msg.Body += "<br/> المدينة : " + uiTextBoxCity.Text;
                msg.Body += "<br/> الرقم البريدى : " + uiTextBoxPostalCode.Text;
                msg.Body += "<br/> البلد : " + uiTextBoxCountry.Text;
                msg.Body += "<br/> التليفون : " + uiTextBoxTelephone.Text;
                msg.Body += "<br/> الموبايل : " + uiTextBoxMobile.Text;
                msg.Body += "<br/> إسم الرحلة : " + ds.Tables[0].Rows[0]["Title"].ToString();
                msg.Body += "<br/> تفاصيل  الرحلة : " + Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());

                msg.Body += "<br/> الرابط على الموقع : " + Request.Url;

                SmtpClient client = new SmtpClient("mail.obtravel-eg.com", 25);
                //SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
                //client.EnableSsl = true;
                client.UseDefaultCredentials = false;
                //client.EnableSsl = true;
                client.Credentials = new System.Net.NetworkCredential("[email protected]", "obtravelmail");
                //client.Credentials = new System.Net.NetworkCredential("[email protected]", "********");
                client.Send(msg);
                uiLabelMessage.Visible = true;
            }
            catch (Exception ex)
            {
                uiLabelMessage.Visible = true;
                uiLabelMessage.Text = ex.Message;
            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:53,代码来源:TourismList.aspx.cs


示例19: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DBLayer db = new DBLayer();
                DataSet ds = new DataSet();
                ds = db.GetPageContent(2);
                uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString());

            }
            RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m5\").addClass(\"selected\");</script>");
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:12,代码来源:ContactUs.aspx.cs


示例20: uiGridViewPages_RowCommand

        protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditPages")
            {
                DBLayer db = new DBLayer();
                CurrentPage = Convert.ToInt32(e.CommandArgument);
                DataSet ds = db.GetPageContent(CurrentPage);
                uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString();
                uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
                uiPanelViewPages.Visible = false;
                uiPanelEdit.Visible = true;

            }
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:14,代码来源:EditPages.aspx.cs



注:本文中的DBLayer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DBManager类代码示例发布时间:2022-05-24
下一篇:
C# DBHelper类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap