Ejemplo n.º 1
0
        private void ShowInfo(int _id)
        {
            BLL.car_use_recordbll    bll   = new BLL.car_use_recordbll();
            Model.car_use_recordinfo model = bll.GetModel(_id);

            txtCode.Text                 = model.Code;
            txtUse_Time.Text             = model.Use_Time;
            ddlDept_Code.SelectedValue   = model.Department.Dept_Code;
            ddlUser_Code.SelectedValue   = model.User.user_name;
            ddlCar_Number.SelectedValue  = model.Car.Car_Number;
            ddlDriver_Code.SelectedValue = model.Driver.Driver_Code;
            txtStart_Address.Text        = model.Start_Address;
            txtMileage_First.Text        = model.Mileage_First.ToString();
            txtUser_Number.Text          = model.User_Number.ToString();
            txtUContent.Text             = model.UContent;
            txtEnd_Address.Text          = model.End_Address;
            txtReturn_Time.Text          = model.Return_Time;
            txtConnecter.Text            = model.Connecter;
            txtTel.Text = model.Tel;
            if (model.OnCity == 1)
            {
                Range1.Checked = true; Range2.Checked = false;
            }
            else if (model.OnCity == 0)
            {
                Range1.Checked = false; Range2.Checked = true;
            }
        }
Ejemplo n.º 2
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));
            }
        }
Ejemplo n.º 3
0
        private void RptBind(string _strWhere, string _orderby)
        {
            this.page             = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.car_use_recordbll bll = new BLL.car_use_recordbll();
            DataTable             tb  = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount).Tables[0];

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

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("car_use_record_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);
        }
Ejemplo n.º 4
0
        protected void btnCheckOut_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("users", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            BLL.car_use_recordbll bll = new BLL.car_use_recordbll();
            bool bupdate = true;

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    DTcms.Model.car_use_recordinfo record = bll.GetModel(id);
                    if (record.Status <= 3)
                    {
                        string strupdate = "Status=3,Checker_Code='" + admin_info.user_name + "',Check_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss") + "'";
                        bll.UpdateField(id, strupdate);
                    }
                    else
                    {
                        bupdate = false;
                    }
                }
            }
            if (bupdate)
            {
                JscriptMsg("批量审核成功啦!", Utils.CombUrlTxt("car_use_record_list.aspx", "group_id={0}&keywords={1}",
                                                        this.group_id.ToString(), this.keywords), "Success");
            }
            else
            {
                JscriptMsg("这些数据不能批量审核!", Utils.CombUrlTxt("car_use_record_list.aspx", "group_id={0}&keywords={1}",
                                                           this.group_id.ToString(), this.keywords), "Success");
            }
        }
        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_return_recordbll().Exists(this.id))
                //{
                //    JscriptMsg("信息不存在或已被删除!", "back", "Error");
                //    return;
                //}
            }
            if (!Page.IsPostBack)
            {
                //BLL.carbll carbll = new BLL.carbll();
                //DataTable cartb = carbll.GetList(1000, "", " id").Tables[0];
                //this.ddlCar_Number.Items.Clear();
                //foreach (DataRow dr in cartb.Rows)
                //{
                //    this.ddlCar_Number.Items.Add(new ListItem(dr["Car_Name"].ToString(), dr["Car_Number"].ToString()));
                //}
                BLL.car_use_recordbll carusebll = new BLL.car_use_recordbll();
                DataTable             carusetb  = carusebll.GetList(1000, " Status in(4)", " id").Tables[0];
                this.ddlCar_Number.Items.Clear();
                this.ddlCar_Number.Items.Add(new ListItem("请选择车牌...", ""));
                this.ddlSource_Code.Items.Clear();
                this.ddlSource_Code.Items.Add(new ListItem("请选择单号...", ""));
                foreach (DataRow dr in carusetb.Rows)
                {
                    this.ddlCar_Number.Items.Add(new ListItem(dr["Car_Number"].ToString(), dr["Car_Number"].ToString()));
                    this.ddlSource_Code.Items.Add(new ListItem(dr["Code"].ToString(), dr["Code"].ToString()));
                }
                txtCode.Text = System.DateTime.Now.ToString("yyyyMMddHHmmsss");
                if (action == DTEnums.ActionEnum.Edit.ToString()) //修改
                {
                    ShowInfo(this.id);
                }
            }
        }
Ejemplo n.º 6
0
        private void AfterStatus()
        {
            string strid     = StringTrim(Request.Form["id"]);
            int    id        = Convert.ToInt32(strid);
            string strstatus = StringTrim(Request.Form["status"]);

            ChkAdminLevel("users", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            BLL.car_use_recordbll          bll    = new BLL.car_use_recordbll();
            DTcms.Model.car_use_recordinfo record = bll.GetModel(id);
            int iresult = 0;

            if (record.Status < 2)
            {
                string strupdate = "Status=2,Checker_Code='" + admin_info.user_name + "',Check_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss") + "'";
                iresult = bll.UpdateField(id, strupdate);
            }
            else if (record.Status == 2)
            {
                string strupdate = "Status=4,Update_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss") + "'";
                iresult = bll.UpdateField(id, strupdate);
                BLL.carbll cbll = new BLL.carbll();
                cbll.UpdateField(record.Car.Car_Number, "Status=1");
            }
            //else if (record.Status == 4)
            //{
            //    string strupdate = "Status=5,Update_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss") + "'";
            //    iresult = bll.UpdateField(id, strupdate);
            //    BLL.carbll cbll = new BLL.carbll();
            //    cbll.UpdateField(record.Car.Car_Number, "Status=0");
            //}
            if (iresult > 0)
            {
                //JscriptMsg("车辆状态修改成功!", Utils.CombUrlTxt("car_use_record_list.aspx", "group_id={0}&keywords={1}",
                //    this.group_id.ToString(), this.keywords), "Success");
            }
            ResultView view = new ResultView();

            view.putData("result", iresult);
            outResult(view);
        }
Ejemplo n.º 7
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            BLL.car_use_recordbll    bll   = new BLL.car_use_recordbll();
            Model.car_use_recordinfo model = bll.GetModel(_id);

            model.Code                 = txtCode.Text.Trim();
            model.Use_Time             = txtUse_Time.Text.Trim();
            model.Department.Dept_Code = ddlDept_Code.SelectedValue;
            model.User.user_name       = ddlUser_Code.SelectedValue;
            model.Car.Car_Number       = ddlCar_Number.SelectedValue;
            model.Driver.Driver_Code   = ddlDriver_Code.SelectedValue;
            model.Start_Address        = txtStart_Address.Text.Trim();
            string s = txtMileage_First.Text.Trim();

            model.Mileage_First = Convert.ToInt32(s == "" ? "0" : s);
            s = txtUser_Number.Text.Trim();
            model.User_Number = Convert.ToInt32(s == "" ? "0" : s);
            model.UContent    = txtUContent.Text.Trim();
            model.End_Address = txtEnd_Address.Text.Trim();
            model.Return_Time = txtReturn_Time.Text.Trim();
            model.Connecter   = txtConnecter.Text.Trim();
            model.Tel         = txtTel.Text.Trim();
            if (Range1.Checked)
            {
                model.OnCity = 1;
            }
            else if (Range2.Checked)
            {
                model.OnCity = 0;
            }

            if (!bll.Update(model))
            {
                result = false;
            }
            return(result);
        }