コード例 #1
0
 public string GetName(object id)
 {
     Hi.Model.SYS_Industry type = new Hi.BLL.SYS_Industry().GetModel(Convert.ToInt16(id));
     if (type != null)
     {
         return(type.InduName);
     }
     return("");
 }
コード例 #2
0
ファイル: Tree_IndusTryPage.aspx.cs プロジェクト: kkwkk/ybyzt
    public void TreeData()
    {
        List <Hi.Model.SYS_Industry> list = new Hi.BLL.SYS_Industry().GetList(null, "   isnull(dr,0)=0  and IsEnabled=1 ", "sortindex");

        foreach (Hi.Model.SYS_Industry item in list)
        {
            chidString += "{ id :" + item.ID + ",pId: 0,name:\"" + item.InduName + "\"},";
        }
    }
コード例 #3
0
 protected void btn_Del(object sender, EventArgs e)
 {
     Hi.Model.SYS_Industry industry = new Hi.BLL.SYS_Industry().GetModel(KeyID);
     if (industry != null)
     {
         industry.dr         = 1;
         industry.ts         = DateTime.Now;
         industry.modifyuser = UserID;
         if (new Hi.BLL.SYS_Industry().Update(industry))
         {
             //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='IndustryList.aspx'; }");
             Response.Redirect("IndustryList.aspx");
         }
     }
 }
コード例 #4
0
    public void DataBinds()
    {
        if (KeyID != 0)
        {
            Hi.Model.SYS_Industry industry = new Hi.BLL.SYS_Industry().GetModel(KeyID);

            lblname.InnerText  = industry.InduName;
            lblsort.InnerText  = industry.SortIndex;
            lblstate.InnerText = industry.IsEnabled == 1 ? "启用" : "禁用";
        }
        else
        {
            Response.Write("行业分类不存在。");
            Response.End();
        }
    }
コード例 #5
0
 public void Databind()
 {
     if (KeyID != 0)
     {
         Hi.Model.SYS_Industry industry = new Hi.BLL.SYS_Industry().GetModel(KeyID);
         try
         {
             txtInduName.Value = industry.InduName;
             txtSort.Value     = industry.SortIndex;
             int status = industry.IsEnabled;
             this.rdoStatus1.Checked = (status != 1);
             this.rdoStatus0.Checked = (status == 1);
         }
         catch (Exception ex)
         {
         }
     }
 }
コード例 #6
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Hi.Model.SYS_Industry industry = null;

        if (string.IsNullOrEmpty(txtInduName.Value.Trim()))
        {
            JScript.AlertMsg(this, "行业分类名称不能为空!");
            return;
        }
        if (KeyID != 0)
        {
            industry           = new Hi.BLL.SYS_Industry().GetModel(KeyID);
            industry.InduName  = Common.NoHTML(txtInduName.Value.Trim());
            industry.SortIndex = Common.NoHTML(txtSort.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                industry.IsEnabled = 0;
            }
            else
            {
                industry.IsEnabled = 1;
            }

            industry.InduCode   = "0";
            industry.ts         = DateTime.Now;
            industry.modifyuser = UserID;

            if (new Hi.BLL.SYS_Industry().Update(industry))
            {
                //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='IndustryInfo.aspx?KeyID=" + KeyID + "'; }");
                Response.Redirect("IndustryInfo.aspx?KeyID=" + KeyID);
            }
        }
        else
        {
            industry          = new Hi.Model.SYS_Industry();
            industry.InduName = Common.NoHTML(txtInduName.Value.Trim());

            industry.SortIndex = Common.NoHTML(txtSort.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                industry.IsEnabled = 0;
            }
            else
            {
                industry.IsEnabled = 1;
            }

            //标准参数
            industry.CreateDate   = DateTime.Now;
            industry.CreateUserID = UserID;
            industry.ts           = DateTime.Now;
            industry.modifyuser   = UserID;
            int newuserid = 0;
            newuserid = new Hi.BLL.SYS_Industry().Add(industry);
            if (newuserid > 0)
            {
                Response.Redirect("IndustryInfo.aspx?KeyID=" + newuserid);
            }
        }
    }