Пример #1
0
 private void RptBind(string _strWhere)
 {
     this.txtKeywords.Text = this.keywords;
     BLL.StoreMode bll = new BLL.StoreMode();
     this.rptList.DataSource = bll.GetList(0, _strWhere, "Id DESC");
     this.rptList.DataBind();
 }
Пример #2
0
        private void TreeBind(string strWhere)
        {
            BLL.Customer customerBLL = new BLL.Customer();
            DataTable    customerDT  = customerBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlCustomer.Items.Clear();
            this.ddlCustomer.Items.Add(new ListItem("所属客户", ""));
            foreach (DataRow dr in customerDT.Rows)
            {
                this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.StoreMode storeModeBLL = new BLL.StoreMode();
            DataTable     storeModeDT  = storeModeBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlStoreMode.Items.Clear();
            this.ddlStoreMode.Items.Add(new ListItem("存储方式", ""));
            foreach (DataRow dr in storeModeDT.Rows)
            {
                this.ddlStoreMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.HandlingMode handlingModeBLL = new BLL.HandlingMode();
            DataTable        handlingModeDT  = handlingModeBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlHandlingMode.Items.Clear();
            this.ddlHandlingMode.Items.Add(new ListItem("装卸方式", ""));
            foreach (DataRow dr in handlingModeDT.Rows)
            {
                this.ddlHandlingMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }
        }
Пример #3
0
 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("store_mode", DTEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0;
     int errorCount = 0;
     BLL.StoreMode bll = new BLL.StoreMode();
     //批量删除
     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)
         {
             if (bll.Delete(id))
             {
                 sucCount += 1;
             }
             else
             {
                 errorCount += 1;
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除存储方式成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
         Utils.CombUrlTxt("store_mode_list.aspx", "keywords={0}", txtKeywords.Text.Trim()));
 }
Пример #4
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("store_mode", DTEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount   = 0;
            int errorCount = 0;

            BLL.StoreMode bll = new BLL.StoreMode();
            //批量删除
            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)
                {
                    if (bll.Delete(id))
                    {
                        sucCount += 1;
                    }
                    else
                    {
                        errorCount += 1;
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除存储方式成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!",
                       Utils.CombUrlTxt("store_mode_list.aspx", "keywords={0}", txtKeywords.Text.Trim()));
        }
Пример #5
0
 private void ShowInfo(int _id)
 {
     BLL.StoreMode   bll   = new BLL.StoreMode();
     Model.StoreMode model = bll.GetModel(_id);
     txtName.Text   = model.Name;
     txtRemark.Text = model.Remark;
 }
Пример #6
0
 private void RptBind(string _strWhere)
 {
     this.txtKeywords.Text = this.keywords;
     BLL.StoreMode bll = new BLL.StoreMode();
     this.rptList.DataSource = bll.GetList(0, _strWhere, "Id DESC");
     this.rptList.DataBind();
 }
Пример #7
0
        private bool DoAdd()
        {
            bool result = false;
            Model.StoreMode model = new Model.StoreMode();
            BLL.StoreMode bll = new BLL.StoreMode();

            model.Name = txtName.Text;
            model.Remark = txtRemark.Text;
            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加存储方式:" + model.Name); //记录日志
                result = true;
            }
            return result;
        }
Пример #8
0
        private bool DoAdd()
        {
            bool result = false;

            Model.StoreMode model = new Model.StoreMode();
            BLL.StoreMode   bll   = new BLL.StoreMode();

            model.Name   = txtName.Text;
            model.Remark = txtRemark.Text;
            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加存储方式:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
Пример #9
0
        private bool DoEdit(int _id)
        {
            bool result = false;

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

            model.Name   = txtName.Text;
            model.Remark = txtRemark.Text;
            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改存储方式:" + model.Name); //记录日志
                result = true;
            }

            return(result);
        }
Пример #10
0
        private void TreeBind(string strWhere)
        {
            BLL.Customer customerBLL = new BLL.Customer();
            DataTable customerDT = customerBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlCustomer.Items.Clear();
            this.ddlCustomer.Items.Add(new ListItem("所属客户", ""));
            foreach (DataRow dr in customerDT.Rows)
            {
                this.ddlCustomer.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.StoreMode storeModeBLL = new BLL.StoreMode();
            DataTable storeModeDT = storeModeBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlStoreMode.Items.Clear();
            this.ddlStoreMode.Items.Add(new ListItem("存储方式", ""));
            foreach (DataRow dr in storeModeDT.Rows)
            {
                this.ddlStoreMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.HandlingMode handlingModeBLL = new BLL.HandlingMode();
            DataTable handlingModeDT = handlingModeBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlHandlingMode.Items.Clear();
            this.ddlHandlingMode.Items.Add(new ListItem("装卸方式", ""));
            foreach (DataRow dr in handlingModeDT.Rows)
            {
                this.ddlHandlingMode.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }

            BLL.Unit unitBLL = new BLL.Unit();
            DataTable unitDT = unitBLL.GetList(0, strWhere, "Id desc").Tables[0];

            this.ddlUnit.Items.Clear();
            this.ddlUnit.Items.Add(new ListItem("计量单位", ""));
            foreach (DataRow dr in unitDT.Rows)
            {
                this.ddlUnit.Items.Add(new ListItem(dr["Name"].ToString(), dr["Id"].ToString()));
            }
        }
Пример #11
0
        private bool DoEdit(int _id)
        {
            bool result = false;
            BLL.StoreMode bll = new BLL.StoreMode();
            Model.StoreMode model = bll.GetModel(_id);

            model.Name = txtName.Text;
            model.Remark = txtRemark.Text;
            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改存储方式:" + model.Name); //记录日志
                result = true;
            }

            return result;
        }
Пример #12
0
 private void ShowInfo(int _id)
 {
     BLL.StoreMode bll = new BLL.StoreMode();
     Model.StoreMode model = bll.GetModel(_id);
     txtName.Text = model.Name;
     txtRemark.Text = model.Remark;
 }