Пример #1
0
    protected string GetDocType(object DocTypeID)
    {
        string result;

        try
        {
            int num = Convert.ToInt32(DocTypeID);
            if (num == 0)
            {
                result = "默认分类";
            }
            else
            {
                IList all = Docs_DocType.Init().GetAll("id=" + num, null);
                if (all != null)
                {
                    Docs_DocTypeInfo docs_DocTypeInfo = all[0] as Docs_DocTypeInfo;
                    result = docs_DocTypeInfo.TypeName;
                }
                else
                {
                    result = "";
                }
            }
        }
        catch
        {
            result = "默认分类";
        }
        return(result);
    }
Пример #2
0
        public void Delete(int id)
        {
            Docs_DocTypeInfo docs_DocTypeInfo = new Docs_DocTypeInfo();

            docs_DocTypeInfo.id = id;
            this.control.DeleteEntity(docs_DocTypeInfo);
        }
Пример #3
0
    private void Show(string id)
    {
        Docs_DocTypeInfo byId = Docs_DocType.Init().GetById(Convert.ToInt32(id));

        this.ViewState["ni"] = byId;
        this.TypeName.Value  = byId.TypeName;
        this.Notes.Value     = byId.Notes;
    }
Пример #4
0
 //protected Repeater rpt;
 //protected Button bt5;
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         IList all = Docs_DocType.Init().GetAll("uid=" + this.Uid, null);
         this.doctype.Items.Add(new ListItem("默认分类", "0"));
         foreach (object current in all)
         {
             Docs_DocTypeInfo docs_DocTypeInfo = current as Docs_DocTypeInfo;
             this.doctype.Items.Add(new ListItem(docs_DocTypeInfo.TypeName, string.Concat(docs_DocTypeInfo.id)));
         }
     }
     if (!base.IsPostBack && !string.IsNullOrEmpty(base.Request.QueryString["did"]))
     {
         this.Show(base.Request.QueryString["did"]);
     }
 }
Пример #5
0
    protected void Save_Btn(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(base.Request.QueryString["tid"]))
        {
            Docs_DocTypeInfo docs_DocTypeInfo = this.ViewState["ni"] as Docs_DocTypeInfo;
            docs_DocTypeInfo.Notes    = this.Notes.Value;
            docs_DocTypeInfo.TypeName = this.TypeName.Value;
            docs_DocTypeInfo.Uid      = Convert.ToInt32(this.Uid);
            Docs_DocType.Init().Update(docs_DocTypeInfo);
        }
        else
        {
            Docs_DocTypeInfo docs_DocTypeInfo = new Docs_DocTypeInfo();
            docs_DocTypeInfo.TypeName = this.TypeName.Value;
            docs_DocTypeInfo.Notes    = this.Notes.Value;
            docs_DocTypeInfo.Uid      = Convert.ToInt32(this.Uid);
            Docs_DocType.Init().Add(docs_DocTypeInfo);
        }
        string str = HttpContext.Current.Server.HtmlEncode("您好!文档分类保存成功!");

        base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=../Manage/doc/DocType_List.aspx&tip=" + str);
    }
Пример #6
0
 public void Update(Docs_DocTypeInfo com)
 {
     Docs_DocType.dal.Update(com);
 }
Пример #7
0
 public void Add(Docs_DocTypeInfo com)
 {
     Docs_DocType.dal.Add(com);
 }
Пример #8
0
 public void Update(Docs_DocTypeInfo Docs_DocType_)
 {
     this.control.UpdateEntity(Docs_DocType_, Docs_DocType_.id);
 }
Пример #9
0
 public void Add(Docs_DocTypeInfo Docs_DocType_)
 {
     this.control.AddEntity(Docs_DocType_);
 }