예제 #1
0
        private void BindCar_Number(string strwhere)
        {
            BLL.carbll carbll = new BLL.carbll();
            DataTable  cartb  = carbll.GetList(1000, strwhere, " id").Tables[0];

            BLL.car_use_recordbll carusebll = new BLL.car_use_recordbll();
            DataTable             carusedtb = carusebll.GetList(1000, " Status not in(5)", " id").Tables[0];

            this.ddlCar_Number.Items.Clear();
            this.ddlCar_Number.Items.Add(new ListItem("请选择车牌...", ""));
            foreach (DataRow dr in cartb.Rows)
            {
                bool   add        = true;
                string car_number = dr["Car_Number"].ToString();
                foreach (DataRow ro in carusedtb.Rows)
                {
                    string carnumber = ro["Car_Number"].ToString();
                    if (carnumber == car_number)
                    {
                        add = false; break;
                    }
                }
                if (!add)
                {
                    continue;
                }
                this.ddlCar_Number.Items.Add(new ListItem(car_number, car_number));
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string _action = DTRequest.GetQueryString("action");

            if (!string.IsNullOrEmpty(_action) && _action == DTEnums.ActionEnum.Edit.ToString())
            {
                this.action = DTEnums.ActionEnum.Edit.ToString();//修改类型
                this.id     = DTRequest.GetQueryInt("id");
                if (this.id == 0)
                {
                    JscriptMsg("传输参数不正确!", "back", "Error");
                    return;
                }
                if (!new BLL.car_repair_recordbll().Exists(this.id))
                {
                    JscriptMsg("信息不存在或已被删除!", "back", "Error");
                    return;
                }
            }
            if (!Page.IsPostBack)
            {
                txtCode.Text = DateTime.Now.ToString("yyyyMMddHHmmsss");
                BLL.carbll bll = new BLL.carbll();
                DataTable  tb  = bll.GetList(1000, " 1=1 and Status in(0,1)", " id").Tables[0];
                this.ddlCar_Number.Items.Clear();
                foreach (DataRow dr in tb.Rows)
                {
                    this.ddlCar_Number.Items.Add(new ListItem(dr["Car_Number"].ToString(), dr["Car_Number"].ToString()));
                }
                BLL.car_maintenance_itembll bll1 = new BLL.car_maintenance_itembll();
                DataTable tb1 = bll1.GetList(1000, " 1=1 ", " id").Tables[0];
                this.ddlMaintenance_Item.Items.Clear();
                foreach (DataRow dr in tb1.Rows)
                {
                    this.ddlMaintenance_Item.Items.Add(new ListItem(dr["Maintenance_Item_Name"].ToString(), dr["Code"].ToString()));
                }
                BLL.car_repair_plantbll bll2 = new BLL.car_repair_plantbll();
                DataTable tb2 = bll2.GetList(1000, " 1=1 ", " id").Tables[0];
                this.ddlRepair_Plant.Items.Clear();
                foreach (DataRow dr in tb2.Rows)
                {
                    this.ddlRepair_Plant.Items.Add(new ListItem(dr["Repair_Plant_Name"].ToString(), dr["Code"].ToString()));
                }
                BLL.car_driverbll bll3 = new BLL.car_driverbll();
                DataTable         tb3  = bll3.GetList(1000, " 1=1 ", " id").Tables[0];
                this.ddlDriver_Code.Items.Clear();
                foreach (DataRow dr in tb3.Rows)
                {
                    this.ddlDriver_Code.Items.Add(new ListItem(dr["Driver_Name"].ToString(), dr["Driver_Code"].ToString()));
                }
                if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
                {
                    ShowInfo(this.id);
                }
            }
        }
예제 #3
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page             = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.carbll bll = new BLL.carbll();
            DataTable  tb  = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount).Tables[0];

            tb.Columns.Add("StatusText");
            for (int i = 0; i < tb.Rows.Count; i++)
            {
                int status = Convert.ToInt32(tb.Rows[i]["Status"] + "");
                tb.Rows[i]["StatusText"] = GetStatusText(status);
            }
            this.rptList.DataSource = tb;
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("car_list.aspx", "group_id={0}&keywords={1}&page={2}",
                                              this.group_id.ToString(), this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }