Exemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        FineOffice.Modules.OA_Flow model = new FineOffice.Modules.OA_Flow();
        model.FlowName        = txtFormName.Text.Trim();
        model.AllowAttachment = chkAllowAttachment.Checked;
        model.CreateDate      = DateTime.Now;
        if (this.CookiePersonnel != null)
        {
            model.Creator = this.CookiePersonnel.ID;
        }

        model.FlowDesc   = txtFlowDesc.Text.Trim();
        model.FlowNO     = txtFormNO.Text.Trim();
        model.IsFreedom  = chkIsFreedom.Checked;
        model.PinyinCode = txtPinyinCode.Text.Trim();
        model.Remark     = txtRemark.Text.Trim();
        if (ddlSort.SelectedValue.Length > 0)
        {
            model.SortID = int.Parse(ddlSort.SelectedValue);
        }
        model.Stop        = chkStop.Checked;
        model.Version     = txtVersion.Text.Trim();
        model.AllowRecall = chkAllowRecall.Checked;
        model.AllowRevoke = chkAllowRevoke.Checked;

        string[] departmentList = hiddenDepartment.Text.Split(',');
        foreach (string str in departmentList)
        {
            if (str.Length > 0)
            {
                FineOffice.Modules.OA_FlowAuthority auth = new FineOffice.Modules.OA_FlowAuthority();
                auth.DepartmentID = int.Parse(str);
                auth.FlowID       = model.ID;
                model.OA_FlowAuthorityList.Add(auth);
            }
        }

        string[] personnelList = hiddenPersonnel.Text.Split(',');
        foreach (string str in personnelList)
        {
            if (str.Length > 0)
            {
                FineOffice.Modules.OA_FlowAuthority auth = new FineOffice.Modules.OA_FlowAuthority();
                auth.PersonnelID = int.Parse(str);
                auth.FlowID      = model.ID;
                model.OA_FlowAuthorityList.Add(auth);
            }
        }
        try
        {
            flowBll.Add(model);
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("subwin_close"));
        }
        catch (Exception ex)
        {
            Alert.ShowInParent(ex.Message);
        }
    }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request["ID"] != null)
         {
             int id = int.Parse(Request["ID"].ToString());
             txtID.Text  = id.ToString();
             model       = flowBll.GetModel(d => d.ID == id);
             txtXML.Text = model.XML;
         }
     }
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            btnClose.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();
            if (Request["id"] != null)
            {
                int id = int.Parse(Request["id"]);
                FineOffice.Modules.OA_Flow model = flowBll.GetModel(f => f.ID == id);
                txtFlowID.Text   = model.ID.ToString();
                txtFlowName.Text = model.FlowName.ToString();

                dtpDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                dtpTime.Text = string.Format("{0:HH:mm}", DateTime.Now);
            }
        }
    }
Exemplo n.º 4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string xml = txtXML.Text.Trim();

        model     = flowBll.GetModel(f => f.ID == int.Parse(txtID.Text));
        model.XML = xml;

        if (xml.Length > 0)
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(xml);
            ChangeTrackingList <FineOffice.Modules.OA_FlowProcess> list = new ChangeTrackingList <FineOffice.Modules.OA_FlowProcess>();

            XmlNodeList processNodes = xmlDoc.SelectNodes("/process");
            int         flowID       = int.Parse(processNodes[0].Attributes["ID"].Value);

            XmlNodeList startNodes = xmlDoc.SelectNodes("/process/start");

            //开始节点
            if (startNodes.Count > 0)
            {
                FineOffice.Modules.OA_FlowProcess process = new FineOffice.Modules.OA_FlowProcess();
                process.ID          = startNodes[0].Attributes["id"].Value;
                process.ProcessName = startNodes[0].Attributes["name"].Value;
                process.Remark      = startNodes[0].Attributes["Remark"].Value;
                process.IsStart     = true;
                process.IsEnd       = false;
                process.FlowID      = flowID;

                XmlNodeList   toNodes = xmlDoc.SelectNodes("/process/start/transition");
                StringBuilder next    = new StringBuilder();
                foreach (XmlNode node in toNodes)
                {
                    next.Append(node.Attributes["to"].Value);
                    next.Append(",");
                }
                process.Next = next.ToString();
                list.Add(process);
            }

            XmlNodeList endNodes = xmlDoc.SelectNodes("/process/end");
            foreach (XmlNode node in endNodes)
            {
                FineOffice.Modules.OA_FlowProcess process = new FineOffice.Modules.OA_FlowProcess();
                process.ID          = node.Attributes["id"].Value;
                process.ProcessName = node.Attributes["name"].Value;
                process.Remark      = node.Attributes["Remark"].Value;
                process.IsEnd       = true;
                process.IsStart     = false;
                process.FlowID      = flowID;
                list.Add(process);
            }

            XmlNodeList taskNodes = xmlDoc.SelectNodes("/process/task");
            foreach (XmlNode node in taskNodes)
            {
                FineOffice.Modules.OA_FlowProcess process = new FineOffice.Modules.OA_FlowProcess();
                process.ID          = node.Attributes["id"].Value;
                process.ProcessName = node.Attributes["name"].Value;
                process.Remark      = node.Attributes["Remark"].Value;
                process.FlowID      = flowID;
                process.IsEnd       = false;
                process.IsStart     = false;

                XmlNodeList   toNodes = xmlDoc.SelectNodes("/process/task/transition");
                StringBuilder next    = new StringBuilder();
                foreach (XmlNode toNode in toNodes)
                {
                    next.Append(toNode.Attributes["to"].Value);
                    next.Append(",");
                }
                process.Next = next.ToString();
                list.Add(process);
            }
            model.OA_FlowProcessList = list;
        }
        try
        {
            flowBll.UpdateProcess(model);
            FineUI.Alert.ShowInParent("已保存到服务器!");
        }
        catch (Exception ex)
        {
            FineUI.Alert.ShowInParent(ex.Message);
        }
    }
Exemplo n.º 5
0
    private void InitModule()
    {
        if (Request["ID"] == null)
        {
            return;
        }

        int id = int.Parse(Request["ID"].ToString());

        txtID.Text = id.ToString();
        FineOffice.Modules.OA_Flow model = flowBll.GetModel(d => d.ID == id);
        chkAllowAttachment.Checked = model.AllowAttachment.Value;

        txtFormName.Text       = model.FlowName;
        txtFlowDesc.Text       = model.FlowDesc;
        txtFormNO.Text         = model.FlowNO;
        chkIsFreedom.Checked   = model.IsFreedom.Value;
        chkAllowRecall.Checked = model.AllowRecall.Value;
        chkAllowRevoke.Checked = model.AllowRevoke.Value;

        txtPinyinCode.Text = model.PinyinCode;
        txtRemark.Text     = model.Remark;
        if (model.SortID != null)
        {
            ddlSort.SelectedValue = model.SortID.ToString();
        }
        chkStop.Checked = model.Stop.Value;

        StringBuilder departmentName = new StringBuilder();
        StringBuilder departmentID   = new StringBuilder();

        StringBuilder personnelName = new StringBuilder();
        StringBuilder personnelID   = new StringBuilder();

        foreach (FineOffice.Modules.OA_FlowAuthority authority in model.OA_FlowAuthorityList)
        {
            if (authority.PersonnelID != null)
            {
                personnelID.Append(authority.PersonnelID);
                personnelID.Append(",");

                personnelName.Append(authority.PersonnelName);
                personnelName.Append(",");
            }
            if (authority.DepartmentID != null)
            {
                departmentID.Append(authority.DepartmentID);
                departmentID.Append(",");

                departmentName.Append(authority.DepartmentName);
                departmentName.Append(",");
            }
        }

        txtDepartment.Text    = departmentName.ToString();
        hiddenDepartment.Text = departmentID.ToString();

        txtPersonnel.Text    = personnelName.ToString();
        hiddenPersonnel.Text = personnelID.ToString();

        btnPersonnel.OnClientClick  = OnClientClick4Personnel();
        btnDepartment.OnClientClick = OnClientClick4Department();

        txtVersion.Text = model.Version;
    }