コード例 #1
0
    /// <summary>
    /// 更新按钮
    ///Distination of Document file haxn't been Implement
    /// </summary>
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        TextBox tbx         = (TextBox)(this.FormView1.Row.FindControl("FileTemplateNameTextBox"));
        TextBox tbxSortCode = (TextBox)(this.FormView1.Row.FindControl("SortCodeTextBox"));

        ddl = (DropDownList)(this.FormView1.Row.FindControl("SortDropDownList"));
        string              fileTemplateName = tbx.Text;
        string              sortCode         = tbxSortCode.Text;
        FileTemplateBFL     ftBFL            = new FileTemplateBFL();
        FileTemplateTypeBFL fttBFL           = new FileTemplateTypeBFL();

        if (fileTemplateName.Equals(String.Empty))
        {
            return;
        }
        else
        {
            FileTemplateModel ftModel = new FileTemplateModel();
            if (ddl.SelectedIndex > 0) //index<0 没有被选择或者DoroDownList没有显示.
            {
                int index = ddl.SelectedIndex;
                int code  = fttBFL.GetCodeByIndex(ViewState["Code"].ToString(), index);
                ftModel.FileTemplateTypeCode = code;
            }
            ftModel.Code             = Convert.ToInt32(Page.Request.QueryString["code"]);
            ftModel.FileTemplateName = fileTemplateName;
            ftModel.SortCode         = sortCode;
            ftBFL.Update(ftModel);
        }
        Response.Redirect("FileTemplateVersionList.aspx?code=" + Request.QueryString["code"]);
    }
コード例 #2
0
ファイル: FileTemplate.aspx.cs プロジェクト: riyuexing/rms
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = -1;
        FileTemplateTypeBFL BFL = new FileTemplateTypeBFL();
        XmlDocument         doc = BFL.GetFileTemplateTypeDataSource(0, "模版管理");

        this.XmlDataSource1.Data = doc.InnerXml;
    }
コード例 #3
0
    protected void FormView1_DataBound(object sender, EventArgs e)
    {
        int    code = Int32.Parse(Page.Request.QueryString["code"]);
        int    parentCode;
        int    typeCode;
        bool   needEdit;
        string text;

        string[] nameAndcode;

        FileTemplateTypeBFL fttBFL = new FileTemplateTypeBFL();

        text              = fttBFL.GetParentPath(code, out parentCode, out typeCode);
        nameAndcode       = fttBFL.GetNodeBrother(parentCode, typeCode, out needEdit);
        ViewState["Code"] = nameAndcode[0];
        if (needEdit.Equals(false))
        {
            lblSortName      = (Label)(this.FormView1.Row.FindControl("lblSortName"));
            lblSortName.Text = text;
            if (this.FormView1.CurrentMode == FormViewMode.Edit)
            {
                ddl         = (DropDownList)(this.FormView1.Row.FindControl("SortDropDownList"));
                ddl.Visible = false;
            }
        }
        else
        {
            if (this.FormView1.CurrentMode == FormViewMode.ReadOnly)
            {
                lblSortName      = (Label)(this.FormView1.Row.FindControl("lblSortName"));
                lblSortName.Text = text;
                if (!user.HasRight("380102"))
                {
                    Button btEdit = (Button)(this.FormView1.Row.FindControl("EditButton"));
                    btEdit.Visible = false;
                }
                if (!user.HasRight("380201"))
                {
                    Button btAdd = (Button)(this.FormView1.Row.FindControl("btnAdd"));
                    btAdd.Visible = false;
                }
            }
            else//EditMode
            {
                ddl         = (DropDownList)(this.FormView1.Row.FindControl("SortDropDownList"));
                lblSortName = (Label)(this.FormView1.Row.FindControl("lblSortName"));
                if (text.Contains(">"))
                {
                    int index = text.LastIndexOf('>');
                    lblSortName.Text = text.Substring(0, index + 1);
                }
                ddl.DataSource = fttBFL.SpiltStringToArray(nameAndcode[1]);
                ddl.DataBind();
            }
        }
    }
コード例 #4
0
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        int code = Int32.Parse(Request.QueryString["code"]);
        FileTemplateTypeBFL fttBFL = new FileTemplateTypeBFL();

        if (fttBFL.HasChild(code))
        {
            Response.Write("<script>window.alert('该节点含有子节点不能被删除,删除子节点后再进行操作!');</script>");
            return;
        }
        FileTemplateTypeModel fttModel = new FileTemplateTypeModel();

        fttModel.Code = code;
        fttBFL.DeleteNodeAndTemplate(fttModel);
        Response.Write("<script>opener.parent.location.reload();window.close();</script>");
        Response.End();
    }
コード例 #5
0
    protected void UpdateButton_Click(object sender, EventArgs e)
    {
        TextBox tb = (TextBox)(this.FormView1.Row.FindControl("FileTemplateTypeNameTextBox"));

        if (tb.Text.Trim().Equals(String.Empty))
        {
            return;
        }
        int code = Int32.Parse(Request.QueryString["code"]);
        FileTemplateTypeModel fttModel = new FileTemplateTypeModel();

        fttModel.Code = code;
        fttModel.FileTemplateTypeName = tb.Text;
        FileTemplateTypeBFL fttBFL = new FileTemplateTypeBFL();

        fttBFL.Update(fttModel);
        Response.Write("<script>opener.parent.location.reload();window.close()</script>");
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.ParentCode = Request["ParentCode"];
        FileTemplateTypeBFL BFL = new FileTemplateTypeBFL();
        XmlDocument         doc = BFL.GetFileTemplateTypeDataSource(0, "模版管理");

        this.XmlDataSource1.Data = doc.InnerXml;
        string ChooseType = Request["ChooseType"];

        if (ChooseType != "" && ChooseType != null)
        {
            this.ChooseButton.Visible = true;
            this.CloseButton.Visible  = true;
        }
        else
        {
            this.TreeView1.ShowCheckBoxes = TreeNodeTypes.None;
        }
    }
コード例 #7
0
    public void btAdd_Click(object sender, EventArgs e)
    {
        int nodeValue = Int32.Parse(Request.QueryString["NodeValue"]);
        FileTemplateTypeModel fttModel = new FileTemplateTypeModel();
        FileTemplateTypeBFL   fttBFL   = new FileTemplateTypeBFL();

        fttModel = fttBFL.GetFileTemplateType(nodeValue);
        FileTemplateBFL   ftBFL   = new FileTemplateBFL();
        FileTemplateModel ftModel = new FileTemplateModel();

        ftModel.FileTemplateName     = this.tboxName.Text.Trim();
        ftModel.SortCode             = this.tboxSort.Text.Trim();
        ftModel.FileTemplateTypeCode = nodeValue;
        int code = ftBFL.Insert(ftModel);

        Response.Write("<script>opener.parent.location.reload();location.href('FileTemplateVersionList.aspx?Code=" + code.ToString() + "');</script>");
        //
        //this.AddButton.Visible = false;
        //this.tboxName.Enabled = false;
        //this.tboxSort.Enabled = false;
    }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int nodeValue = Int32.Parse(Request.QueryString["NodeValue"]);
        FileTemplateTypeModel fttModel = new FileTemplateTypeModel();
        FileTemplateTypeBFL   fttBFL   = new FileTemplateTypeBFL();

        fttModel = fttBFL.GetFileTemplateType(nodeValue);
        int parentCode = 0;

        parentCode = fttModel.ParentCode;
        string Text = fttModel.FileTemplateTypeName;

        while (parentCode != 0)
        {
            fttModel   = new FileTemplateTypeModel();
            fttModel   = fttBFL.GetFileTemplateType(parentCode);
            parentCode = fttModel.ParentCode;
            Text       = fttModel.FileTemplateTypeName + " --> " + Text;
        }
        this.lblSortName.Text = Text;
    }
コード例 #9
0
    protected void AddButton_Click(object sender, EventArgs e)
    {
        TextBox tb = (TextBox)(this.FormView1.Row.FindControl("FileTemplateTypeNameTextBox"));

        if (tb.Text.Trim().Equals(String.Empty))
        {
            return;
        }
        parentCode = Int32.Parse(Request.QueryString["Parentcode"]);
        fullPath   = Request.QueryString["FullPath"];
        deep       = Int32.Parse(Request.QueryString["Deep"]);
        FileTemplateTypeModel fttModel = new FileTemplateTypeModel();

        fttModel.FullID               = fullPath;
        fttModel.ParentCode           = parentCode;
        fttModel.Deep                 = deep + 1;
        fttModel.FileTemplateTypeName = tb.Text;
        FileTemplateTypeBFL fttBFL = new FileTemplateTypeBFL();

        fttBFL.Insert(fttModel);
        this.FormView1.ChangeMode(FormViewMode.ReadOnly);
        Response.Write("<script>opener.parent.location.reload();window.close();</script>");
    }
コード例 #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string tempStr = "";

        if (this.TreeView1.CheckedNodes.Count > 0)
        {
            foreach (TreeNode tn in this.TreeView1.CheckedNodes)
            {
                if (tn.Value != "0")
                {
                    tempStr += tn.Value + ",";
                }
            }
            tempStr = tempStr.Remove(tempStr.Length - 1, 1);
        }
        if (tempStr == "")
        {
            Response.Write("<script>alert('请选择模板类型');</script>");
        }
        else
        {
            FileTemplateTypeBFL BFL = new FileTemplateTypeBFL();
            XmlDocument         doc = BFL.GetFileTemplateTypeDataSourcePart(tempStr, 0, "部分模板管理");
            if (this.ParentCode != "" && this.ParentCode != null)
            {
                DocumentDirectoryBFL DDBFL = new DocumentDirectoryBFL();
                string DepartmentCode      = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DepartmentCode;
                string DirectoryNodeCode   = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).DirectoryNodeCode;

                string FullID = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).FullID;
                int    Deep   = DDBFL.GetDocumentDirectory(int.Parse(this.ParentCode)).Deep;
                DDBFL.Insert(doc, int.Parse(this.ParentCode), doc.DocumentElement.ChildNodes, DepartmentCode, FullID, Deep, DirectoryNodeCode);
                Response.Write("<script>opener.parent.location.reload();window.close();</script>");
            }
        }
    }
コード例 #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     formType = Request.QueryString["FormType"];
     if (formType != null)
     {
         if (formType.Equals("Add"))
         {
             this.FormView1.ChangeMode(FormViewMode.Insert);
         }
         parentCode = Int32.Parse(Request.QueryString["Parentcode"]);
         fullPath   = Request.QueryString["FullPath"];
         deep       = Int32.Parse(Request.QueryString["Deep"]);
     }
     else
     {
         FileTemplateTypeBFL   fttBFL   = new FileTemplateTypeBFL();
         FileTemplateTypeModel fttModel = new FileTemplateTypeModel();
         fttModel = fttBFL.GetFileTemplateType(Int32.Parse(Request.QueryString["code"]));
         deep     = fttModel.Deep;
         fullPath = fttModel.FullID;
     }
     text = "模版类别";
     if (deep != 0 && fullPath != null)
     {
         string[] path = fullPath.Split('/');
         for (int i = 1; i < path.Length; i++)
         {
             FileTemplateTypeBFL   fttBFL   = new FileTemplateTypeBFL();
             FileTemplateTypeModel fttModel = new FileTemplateTypeModel();
             fttModel = fttBFL.GetFileTemplateType(Int32.Parse(path[i]));
             text    += "-->" + fttModel.FileTemplateTypeName;
         }
     }
     lblPath      = (Label)(FormView1.Row.FindControl("lblPath"));
     lblPath.Text = text;
 }