WebUI/Admin/Conctrl/AddCar.ascx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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 H.BLL;
using H.Model;

public partial class Admin_Conctrl_AddCar : System.Web.UI.UserControl
{
    int id;
    protected void Page_Load(object sender, EventArgs e)
    {
        id = Convert.ToInt32(Request.QueryString["id"]);
        if (!IsPostBack)
        {
            DropDownList1.DataSource = CarTypeMananger.Get();
            DropDownList1.DataBind();
            DropDownList2.DataSource = CarLoadMananger.GetAll(0, 100);
            DropDownList2.DataBind();
        }
        if(id!=0)
        {
            Car c = CarMananger.GetByID(id);
            if (!IsPostBack)
            {
                TextBox4.Text = c.Haoma;
                TextBox2.Text = c.Pingpai;
                TextBox3.Text = c.Changjia;
                TextBox1.Text = c.Zuoweinum.ToString();
                TextBox5.Text = c.BuyTime.ToShortDateString();
                DropDownList1.Items.FindByValue(c.Type.Id.ToString()).Selected = true;
                DropDownList2.Items.FindByValue(c.Load.Id.ToString()).Selected = true;
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Car c = new Car();
        c.Changjia = TextBox3.Text;
        c.Haoma = TextBox4.Text;
        int loadID = Convert.ToInt32(DropDownList2.SelectedValue);
        c.Pingpai = TextBox2.Text;
        int type = Convert.ToInt32(DropDownList1.SelectedValue);
        c.Zuoweinum = Convert.ToInt32(TextBox1.Text);
        c.BuyTime = Convert.ToDateTime(TextBox5.Text);
        c.Id = id;
        try
        {
            if (id == 0)
                CarMananger.Add(c,type,loadID);
            else
                CarMananger.Edit(c, type, loadID);
后面还有 9 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。