Exemplo n.º 1
0
    protected void updateUser_Click(object sender, EventArgs e)
    {
        CompanyAdapter ca      = new CompanyAdapter();
        T_Customers    company = new T_Customers();

        company.CompanyName = txtCompany.Text.Trim();
        if (string.IsNullOrEmpty(company.CompanyName))
        {
            Label1.Text = "公司名称不能为空";
            return;
        }
        company.Address          = txtAddress.Text.Trim();
        company.Tel              = txtTel.Text.Trim();
        company.Jingban          = txtJingban.Text.Trim();
        company.Fadingdaibiaoren = txtFadingdaibiaoren.Text.Trim();
        company.Dailiren         = txtDailiren.Text.Trim();
        if (!string.IsNullOrEmpty(HiddenField1.Value))
        {
            company.Id = Int32.Parse(HiddenField1.Value);
            try
            {
                ca.Save(company);
                Label1.Text = "保存成功";
                init();
                show();
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
        }
        else
        {
            try
            {
                ca.insert(company);
                Label1.Text = "新增成功";
                init();
                show();
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message;
            }
        }
    }
Exemplo n.º 2
0
    protected void ddlGongFang_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl         = sender as DropDownList;
        string       companyName = ddl.SelectedItem.Text.Trim();

        if (companyName == "请选择" || string.IsNullOrEmpty(companyName))
        {
            return;
        }
        TextBox14.Text = companyName;

        int            id       = Int32.Parse(ddl.SelectedValue);
        CompanyAdapter ca       = new CompanyAdapter();
        T_Customers    gongfang = ca.getCompanyInfoById(id);

        TextBox5.Text = gongfang.Jingban;
        TextBox6.Text = gongfang.Tel;

        TextBox9.Text  = gongfang.Fadingdaibiaoren;
        TextBox11.Text = gongfang.Dailiren;
    }
Exemplo n.º 3
0
    protected void ddlModel_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl         = sender as DropDownList;
        string       companyName = ddl.SelectedItem.Text.Trim();

        if (companyName == "请选择" || string.IsNullOrEmpty(companyName))
        {
            return;
        }
        TextBox12.Text = txtModel.Text = TextBox15.Text = companyName;

        int            id     = Int32.Parse(ddl.SelectedValue);
        CompanyAdapter ca     = new CompanyAdapter();
        T_Customers    xufang = ca.getXuFangInfoById(id);

        TextBox4.Text = xufang.Address;
        TextBox3.Text = xufang.Jingban;
        TextBox2.Text = xufang.Tel;

        TextBox8.Text  = xufang.Fadingdaibiaoren;
        TextBox10.Text = xufang.Dailiren;
    }
Exemplo n.º 4
0
 public void insert(T_Customers item)
 {
     Manager.insert(item);
 }
Exemplo n.º 5
0
 public void Save(T_Customers item)
 {
     Manager.Save(item);
 }