Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindGrid();
         CustomerParam customer = new CustomerParam();
         sumid = KHInfo.GetKHCount().ToString();
         //Response.Write(sumid);
     }
 }
Ejemplo n.º 2
0
    //导入客户数据
    protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
    {
        int result = KHInfo.InportKHFromNC();

        if (result == -1)
        {
            this.PrintfError("NC数据库访问错误!");
            return;
        }
        if (result == 1)
        {
            this.PrintfError("数据库访问错误!");
            return;
        }
        KHInfo kh = new KHInfo();

        kh.KHID = "0";
        try
        {
            if (!kh.Exists())
            {
                kh.KHName   = "邢台钢铁股份有限公司";
                kh.KHLB     = "0";
                kh.KHAdress = "河北邢台";
                kh.Add();
                int khCount = KHInfo.GetKHCount();
                sumid = khCount.ToString();
                this.PrintfError("导入数据成功!");
                BindGrid();
            }
        }
        catch
        {
            this.PrintfError("数据访问错误!");
            return;
        }
    }