protected void btnSave_Click(object sender, EventArgs e) { FineOffice.Modules.OA_FlowRunData model = new FineOffice.Modules.OA_FlowRunData(); model.Title = txtTitle.Text.Trim(); model.Remark = txtRemark.Text.Trim(); model.UpdateTime = DateTime.Now; model.CreateTime = DateTime.Now; model.RunProcessID = int.Parse(hiddenRunProcess.Text); if (ddlForm.SelectedValue.Length > 0) { FineOffice.Modules.OA_Form form = formBll.GetModel(m => m.ID == int.Parse(ddlForm.SelectedValue)); model.FormData = form.FormData; model.FormID = form.ID; model.XType = form.XType; } try { model = runDataBll.Add(model); if (chkEdit.Checked) { string tabID = string.Format("{0:HHmmssffff}", DateTime.Now); PageContext.RegisterStartupScript("openTab('_FrmEditForm" + tabID + "','表单编辑-" + model.Title + "','WorkRun/FrmEditForm.aspx?ID=" + model.ID + "');"); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("refreshRunData")); } catch (Exception ex) { Alert.ShowInParent(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string ID = Request["ID"]; model = runDataBll.GetModel(f => f.ID == int.Parse(ID)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hiddenFlowForm.Text = Request["ID"]; FineOffice.Modules.OA_FlowRunData model = runDataBll.GetModel(d => d.ID == int.Parse(hiddenFlowForm.Text)); lblFormName.Text = model.FormName; txtRemark.Text = model.Remark; txtTitle.Text = model.Title; btnClose.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference(); } }
protected void btnDownForm_Click(object sender, EventArgs e) { int id = int.Parse(formGrid.DataKeys[formGrid.SelectedRowIndex][0].ToString()); FineOffice.Modules.OA_FlowRunData model = runDataBll.GetModel(d => d.ID == id); byte[] formData = SharpZipLib.DeCompress(model.FormData); this.Response.Clear(); this.Response.Buffer = true; this.Response.Charset = "utf-8"; this.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(model.Title + "." + model.XType)); this.Response.AddHeader("Content-Length", formData.Length.ToString()); this.Response.ContentType = "application/msword"; this.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); this.Response.OutputStream.Write(formData, 0, formData.Length); this.Response.Flush(); }
protected void btnDownForm_Click(object sender, EventArgs e) { int id = int.Parse(workFormGrid.DataKeys[workFormGrid.SelectedRowIndex][0].ToString()); FineOffice.Modules.OA_FlowRunData model = flowRunDataBll.GetModel(d => d.ID == id); byte[] attachmentData = SharpZipLib.DeCompress(model.FormData); FineOffice.Web.FileTypeHelper typeHelper = new FineOffice.Web.FileTypeHelper(); Response.Clear(); Response.Buffer = true; Response.Charset = "utf-8"; Response.AddHeader("Content-Disposition", "attachment; filename=" + typeHelper.ToHexString(model.FormName + "." + model.XType)); Response.AddHeader("Content-Length", attachmentData.Length.ToString()); Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8"); Response.OutputStream.Write(attachmentData, 0, attachmentData.Length); Response.Flush(); }
protected void btnSave_Click(object sender, EventArgs e) { FineOffice.Modules.OA_FlowRunData model = runDataBll.GetModel(d => d.ID == int.Parse(hiddenFlowForm.Text)); model.Title = txtTitle.Text.Trim(); model.Remark = txtRemark.Text.Trim(); model.UpdateTime = DateTime.Now; try { model = runDataBll.Update(model); } catch (Exception ex) { Alert.Show(ex.Message); } if (chkEdit.Checked) { string tabID = string.Format("{0:HHmmssffff}", DateTime.Now); PageContext.RegisterStartupScript("openTab('_FrmEditForm" + tabID + "','编辑表单-" + model.Title + "','WorkRun/FrmEditForm.aspx?ID=" + model.ID + "');"); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("refreshRunData")); }