⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basiccustomer.aspx.cs

📁 java 最出色的报表工具代码,愿分享....
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Com.EEShou.Www.TreeControl;
using Infragistics.WebUI.UltraWebGrid;
using System.Threading;
using System.Globalization;
public partial class Admin_Frameset_BasicMrg_BasicCustomer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BasicCustomer bc = new BasicCustomer();
            this.WebGridCustomer.DataSource = bc.getDs("select * from Customer");
            this.WebGridCustomer.DataBind();
            WebGridCustomer.DisplayLayout.SelectTypeRowDefault = SelectType.Single;
            WebGridCustomer.DisplayLayout.SelectedRows.Add(WebGridCustomer.Rows[0]);
            WebGridCustomer.DisplayLayout.SelectTypeColDefault = SelectType.Single;
            WebGridCustomer.DisplayLayout.AllowUpdateDefault = AllowUpdate.Yes;
            WebGridCustomer.DisplayLayout.AllowColSizingDefault = AllowSizing.Free;
            WebGridCustomer.DisplayLayout.TableLayout = TableLayout.Fixed;
        }
    }

    public void bind()
    {
        try
        {
          
            BasicCustomer bc = new BasicCustomer();
            this.WebGridCustomer.DataSource = bc.getDs("select * from Customer");
            this.WebGridCustomer.DataBind();
           

        }
        catch (Exception e)
        {

            Response.Write("加载GridView时出错!");
        }
    
    
    }

   
    protected void lkModify_Click(object sender, EventArgs e)
    {
        this.WebMod.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
        BasicCustomer cd = new BasicCustomer();
        cd.LoadData(Convert.ToInt32(this.WebGridCustomer.DisplayLayout.SelectedRows[0].Cells[0].Value.ToString()));
            this.cCusName.Text = cd.CusName;
            this.cCusAddress.Text = cd.CusAddress;
            this.cCusEmail.Text = cd.CusEmail;
            this.cCusPerson.Text = cd.CusPerson;
            this.cCusPhone.Text = cd.CusPhone;
            this.cCusFax.Text = cd.CusFax;
      
    }
    protected void lkAdd_Click(object sender, EventArgs e)
    {
        this.WebWindowAdd.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
    }
    protected void lkDel_Click(object sender, EventArgs e)
    {
        dBox.Title = "删除时,提示对话框";
        dBox.DialogType = EDialogBoxType.Confirm;
        dBox.ShowDialog("您确定要删除吗?", true);
 
    }
    protected void dBox_OnSelect(object sender, EventArgs e)
    {
        if (dBox.DialogType != EDialogBoxType.Prompt)
        {
            if (dBox.ClickType == EClickType.Cancel)
            {
                return;
            }
            else if (dBox.ClickType == EClickType.Confirm)
            {
                if (dBox.DialogType != EDialogBoxType.Alert)
                {
                    BasicCustomer bc = new BasicCustomer();
                    Boolean flag = bc.delInfo(Convert.ToInt32(this.WebGridCustomer.DisplayLayout.SelectedRows[0].Cells[0].Value.ToString()));
                    if (flag)
                    {
                        bind();
                    }
                    else
                    {
                        Response.Write("<script>alert('出现异常')</script>");

                    }
                }
            }
        }
        else
        {
            dBox.DialogType = EDialogBoxType.Alert;
            dBox.ShowDialog("欢迎您:" + dBox.PromptText, false);
        }
    }
    protected void WebGridCustomer_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
    {
        e.Layout.Bands[0].DataKeyField = "ccuscode";
        e.Layout.Pager.AllowPaging = true;
        e.Layout.Pager.PageSize = 10;
    }
    protected void WebGridCustomer_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
    {
        this.WebGridCustomer.DisplayLayout.Pager.CurrentPageIndex = e.NewPageIndex;
        bind();

    }
    //修改客户信息
    protected void WebConfirm_Click(object sender, EventArgs e)
    {
        BasicCustomer bc = new BasicCustomer();
        bc.CusName = this.cCusName.Text.Trim();
        bc.CusAddress = this.cCusAddress.Text.Trim();
        bc.CusEmail = this.cCusEmail.Text.Trim();
        bc.CusPerson = this.cCusPerson.Text.Trim();
        bc.CusPhone = this.cCusPhone.Text.Trim();
        bc.CusFax = this.cCusFax.Text.Trim();
        Boolean flag = bc.UpdateInfo(Convert.ToInt32(this.WebGridCustomer.DisplayLayout.SelectedRows[0].Cells[0].Value.ToString()));

        if (flag)
        {
            bind();
            this.WebMod.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden;
        }
    }
    protected void WebClose_Click(object sender, EventArgs e)
    {
        this.WebMod.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden;
    }
    protected void CloseAdd_Click(object sender, EventArgs e)
    {
        this.WebWindowAdd.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden;
    }
    protected void AddSave_Click(object sender, EventArgs e)
    {
        BasicCustomer bc = new BasicCustomer();
        bc.CusName = this.gsname.Text.Trim();
        bc.CusAddress = this.AddrAdd.Text.Trim();
        bc.CusEmail = this.EmailAdd.Text.Trim();
        bc.CusPerson = this.lxrAdd.Text.Trim();
        bc.CusPhone = this.telAdd.Text.Trim();
        bc.CusFax = this.faxAdd.Text.Trim();
        Boolean flag = bc.AddInfo();

        if (flag)
        {

            bind();
            this.gsname.Text = "";
            this.AddrAdd.Text = "";
            this.EmailAdd.Text = "";
            this.lxrAdd.Text = "";
            this.telAdd.Text = "";
            this.faxAdd.Text = "";
           
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -