private bool DoEdit(int _id)
    {
        bool result = false;

        ax_depot_category model = new ax_depot_category();

        if (model.Exists(txttitle.Text.Trim(), _id))
        {
            JscriptMsg(this.Page, "您输入的发货仓库名称已经存在,请检查!", "", "Error");
            return(false);
        }
        model.GetModel(_id);

        model.title   = txttitle.Text.Trim();
        model.sort_id = int.Parse(txtSortId.Text.Trim());
        model.remark  = txtremark.Text.Trim();

        if (model.Update())
        {
            AddAdminLog("修改", "修改发货仓库:" + txttitle.Text); //记录日志
            result = true;
        }

        return(result);
    }
Exemple #2
0
 // 单个删除
 protected void lbtnDelCa_Click(object sender, EventArgs e)
 {
     //检查权限
     if (ChkAdminLevel(this.Page, 27, "Delete"))
     {
         // 当前点击的按钮
         LinkButton        lb   = (LinkButton)sender;
         int               caId = int.Parse(lb.CommandArgument);
         ax_depot_category bll  = new ax_depot_category();
         bll.GetModel(caId);
         string    title = bll.title;
         ax_orders bllpp = new ax_orders();
         if (!bllpp.ExistsBM(caId))//查找是否存在该仓库已经有发货记录
         {
             bll.Delete(caId);
             AddAdminLog("删除", "删除发货仓库:" + title + ""); //记录日志
             JscriptMsg(this.Page, " 成功删除发货仓库:" + title + "", Utils.CombUrlTxt("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
         }
         else
         {
             JscriptMsg(this.Page, "该仓库已经有发货记录,不能删除!", "", "Error");
             return;
         }
     }
 }
    private void ShowInfo(int _id)
    {
        ax_depot_category model = new ax_depot_category();

        model.GetModel(_id);

        txttitle.Text  = model.title;
        txtSortId.Text = model.sort_id.ToString();
        txtremark.Text = model.remark;
    }