private void RptBind(string _strWhere, string _orderby)
        {
            this.page             = DTRequest.GetQueryInt("page", 1);
            this.txtKeywords.Text = this.keywords;
            BLL.car_other_costbll bll = new BLL.car_other_costbll();
            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_other_cost_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);
        }
예제 #2
0
        private void ShowInfo(int _id)
        {
            BLL.car_other_costbll    bll   = new BLL.car_other_costbll();
            Model.car_other_costinfo model = bll.GetModel(_id);

            txtCode.Text   = model.Code;
            txtTittle.Text = model.Tittle;
            ddlCar_Number.SelectedValue = model.Car.Car_Number;
            txtCost.Text = model.Cost.ToString();
            ddlType_Code.SelectedValue = model.Type_Code;
        }
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("users", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     BLL.car_other_costbll bll = new BLL.car_other_costbll();
     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)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("car_other_cost_list.aspx", "group_id={0}&keywords={1}",
                                             this.group_id.ToString(), this.keywords), "Success");
 }
        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_other_costbll          bll    = new BLL.car_other_costbll();
            DTcms.Model.car_other_costinfo record = bll.GetModel(id);
            int    iresult   = 0;
            string strupdate = "Status=1,Checker_Code='" + admin_info.user_name + "',Check_Time='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:sss") + "'";

            iresult = bll.UpdateField(id, strupdate);
            ResultView view = new ResultView();

            view.putData("result", iresult);
            outResult(view);
        }
예제 #5
0
        private bool DoAdd()
        {
            bool result = true;

            Model.car_other_costinfo model = new Model.car_other_costinfo();
            BLL.car_other_costbll    bll   = new BLL.car_other_costbll();
            model.Code           = txtCode.Text.Trim();
            model.Tittle         = txtTittle.Text;
            model.Car            = new Model.carinfo();
            model.Car.Car_Number = ddlCar_Number.SelectedValue;
            string s = txtCost.Text;

            model.Cost      = decimal.Parse(s == "" ? "0" : s);
            model.Type_Code = ddlType_Code.SelectedValue;

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return(result);
        }
예제 #6
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            BLL.car_other_costbll    bll   = new BLL.car_other_costbll();
            Model.car_other_costinfo model = bll.GetModel(_id);

            model.Code           = txtCode.Text.Trim();
            model.Tittle         = txtTittle.Text;
            model.Car            = new Model.carinfo();
            model.Car.Car_Number = ddlCar_Number.SelectedValue;
            string s = txtCost.Text;

            model.Cost      = decimal.Parse(s == "" ? "0" : s);
            model.Type_Code = ddlType_Code.SelectedValue;

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