未审核表单列表显示:

1.用户登录后,根据登录用户加载审核流程表中属于当前登录用户的未审核表单。
2.点击选中未审核表单跳转到指定审核流程页面

  if (Request.QueryString["taskid"] != null && Request.QueryString["listid"] != null)
{
contractid = Request.QueryString["taskid"].ToString();
tasklistid = Request.QueryString["listid"].ToString();
}
else
{
Response.Write("<script>window.history(-1)</script>");
}

防止匿名登录:
登录后将基本信息保存至Session["Userid"],
如果每个页面加载时候判断Session["Userid"],如果为空则跳转至指定登录页面。

   public BasePage()
{
this.Load += new EventHandler(BasePage_Load);
} void BasePage_Load(object sender, EventArgs e)
{
Session["Userid"] = "29";
if (Session["Userid"] == null)
{
Response.Redirect("~/Web/UserLogin.aspx");
}
}

用法:

 public partial class CRMContractEidt:BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
this.txtCreatTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
if (!IsPostBack)
{
pageinfo();
}
}
}

合同基础信息表:

 /// <summary>
/// 合同基础信息表
/// </summary>
/// <param name="id">编号</param>
/// <returns>ViewContactInfo</returns>
public ViewContactInfo getViewContactInfoByContactID2(string contactid,string listid)
{ SqlDataReader reader = SqlComm.GetDataReaderByCondition("BioCRMContract", "*", " ContractID=" + contactid);
ViewContactInfo contactinfo= new ViewContactInfo();
if (reader.Read()==true)
{ contactinfo.UserID = Convert.ToInt32(reader["UserID"].ToString());
contactinfo. AssessorAuditing = Convert.ToBoolean(reader["AssessorAuditing"].ToString());
contactinfo.ContractDesc = reader["ContractDesc"].ToString();
contactinfo.ContractID = Convert.ToInt32(reader["ContractID"].ToString());
contactinfo.ContractName = reader["ContractName"].ToString();
contactinfo.ContractNumber = reader["ContractNumber"].ToString();
contactinfo.ContractSum = Decimal.Parse(reader["ContractSum"].ToString());
contactinfo.ContractType = reader["ContractType"].ToString();
contactinfo.CreateTime = Convert.ToDateTime(reader["CreateTime"].ToString());
contactinfo.CustomerID = Convert.ToInt32(reader["CustomerID"].ToString());
contactinfo.DeleteState = Convert.ToBoolean(reader["DeleteState"].ToString());
contactinfo.EndTime = Convert.ToDateTime(reader["EndTime"].ToString());
contactinfo. EffectiveTime = Convert.ToDateTime(reader["EffectiveTime"].ToString());
contactinfo. ExecutiveState = reader["ExecutiveState"].ToString();
contactinfo.SignTime = Convert.ToDateTime(reader["SignTime"].ToString()); }
reader.Close();
return contactinfo; }

显示的前端代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CRMContractShow.aspx.cs" Inherits="BioErpWeb.CRMSystem.CRMContract.CRMContractShow" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" />
<script src="../../JS/CheckUserName.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="../../Scripts/validateExtender.js" type="text/javascript"></script>
<script src="../../Scripts/ValidateMessage_ZW.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.metadata.js" type="text/javascript"></script>
<script src="../../JS/CustomerName.js" type="text/javascript"></script>
<link href="../../Styles/InputStyle1.css" rel="stylesheet" type="text/css" />
<script src="../../JS/CheckDepartMent.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script>
<link href="../../Scripts/jquery-ui-1.7.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$("#form1").validate();
$("#txtCreatTime").datepicker({ dateFormat: 'yy-mm-dd' });
$("#txtSinTime").datepicker({ dateFormat: 'yy-mm-dd' });
$("#txtEffectiveTime").datepicker({ dateFormat: 'yy-mm-dd' });
$("#txtEndTime").datepicker({ dateFormat: 'yy-mm-dd' }) }); </script> <style type="text/css">
.style1
{
width: 73px;
}
</style> </head>
<body>
<form id="form1" runat="server"> <div>
<table class="maintable Inupttable" style=" width:900px;">
<tr>
<td colspan="8" class="titlebar">合同审核</td>
</tr>
<tr>
<td class="style1">合同名称</td><td class="style3"><asp:TextBox ID="txtName" CssClass="required" runat="server"></asp:TextBox></td>
<td class="style4">下次审批人</td><td><asp:TextBox ID="txtUser1" CssClass="{required:true,digits:true, min:1}" runat="server"></asp:TextBox>
 </td>
<td class="style7">合同负责人</td><td class="style6"><asp:TextBox ID="txtUser2" CssClass="{required:true,digits:true, min:1}" runat="server"></asp:TextBox>
 </td>
<td>所属部门</td><td>
<asp:TextBox ID="txtDepartMentID" CssClass="{required:true,digits:true, min:1}" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style1">签约客户</td><td class="style3"><asp:TextBox ID="txtCustomer" CssClass="{required:true,digits:true, min:1}" runat="server"></asp:TextBox>
 </td>
<td class="style4">签约金额</td><td><asp:TextBox ID="txtSum" CssClass="{required:true,number:true}" runat="server"></asp:TextBox>元(RMB)</td>
<td class="style7">合同创建时间</td><td class="style6"><asp:TextBox ID="txtCreatTime" CssClass="{required:true,dateISO:true}" runat="server"></asp:TextBox></td>
<td>计划签约时间</td><td><asp:TextBox ID="txtSinTime" CssClass="{required:true,dateISO:true}" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td class="style1">生效时间</td><td class="style3" ><asp:TextBox ID="txtEffectiveTime" CssClass="{required:true,dateISO:true}" runat="server"></asp:TextBox></td>
<td class="style4">截止</td><td colspan="5"><asp:TextBox ID="txtEndTime" CssClass="{required:true,dateISO:true}" runat="server"></asp:TextBox></td> </tr>
<tr>
<td class="style1">合同内容</td><td colspan="7">
<asp:TextBox ID="txtDesc" CssClass="required"
runat="server" Height="300px" Width="100%" Rows="10" TextMode="MultiLine"></asp:TextBox></td> </tr>
<tr>
<td class="style1">合同附件</td><td colspan="5">
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/Web/images/files.gif" Width="26px" Height="24px"
onclick="ImageButton1_Click"/>
(下载)</td>
<td>合同类型</td><td>
<asp:DropDownList ID="ddlType" runat="server">
<asp:ListItem>买卖合同</asp:ListItem>
<asp:ListItem>运输合同</asp:ListItem>
<asp:ListItem>技术合同</asp:ListItem>
<asp:ListItem>保管合同</asp:ListItem>
<asp:ListItem>仓储合同</asp:ListItem>
<asp:ListItem>委托合同</asp:ListItem>
</asp:DropDownList>
</td> </tr> <tr>
<td class="style1">历史意见</td><td colspan="7">
<asp:Label ID="lbHistory" Width="99%" runat="server"
Text=""></asp:Label> </td> </tr>
<tr>
<td class="style1">审批意见</td><td colspan="5">
<asp:TextBox ID="txtMind" Width="80%" runat="server"></asp:TextBox> </td>
<td>
<asp:Label ID="lbIsCheck" runat="server" Visible="false" Text="法律顾问意见"></asp:Label> </td><td>
<asp:CheckBox ID="cbIsCheck" Text="符合法律效应" Visible="false" BorderStyle="None" runat="server" /></td> </tr>
<tr>
<td colspan="8" class="bottomtd">
<asp:Button ID="btnSubmit" runat="server" Text="返回列表"
onclick="btnSubmit_Click" /> </td>
</tr> </table> </div>
</form>
</body>
</html>

后端的代码:

  public partial class CRMContractShow : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
this.txtCreatTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
if (!IsPostBack)
{
pageinfo(); //遍历页面所有TextBox控件,设置为只读
TextBox txt = null;
foreach (Control c in Page.Controls)
{
if (c.GetType().Name == "HtmlForm")
{
foreach (Control c1 in c.Controls)
{
if (c1.GetType().Name == "TextBox")
{
txt = ((TextBox)c1);
txt.ReadOnly = true;
}
}
}
}
}
}
static byte[] filecontent = null; static string contractid = "";
static string tasklistid = "";
static string documentsid = "";
/// <summary>
/// 绑定页面信息
/// </summary>
protected void pageinfo()
{
contractid ="8";
tasklistid ="7"; #region 从合同信息表中绑定数据
CrmContractBLL cbll = new CrmContractBLL();
ViewContactInfo contactinfo = new ViewContactInfo();
contactinfo = cbll.getViewContactInfoByContactID2(contractid, tasklistid);
this.txtName.Text = contactinfo.ContractName;
this.txtUser2.Text = contactinfo.UserID.ToString();
this.txtSinTime.Text = Convert.ToDateTime(contactinfo.SignTime.ToString()).ToString("yyyy-MM-dd");
this.txtCreatTime.Text = Convert.ToDateTime(contactinfo.CreateTime.ToString()).ToString("yyyy-MM-dd");
this.txtCustomer.Text = contactinfo.CustomerID.ToString();
this.txtSum.Text = Convert.ToDecimal(contactinfo.ContractSum.ToString()).ToString("0.00");
this.txtEffectiveTime.Text = Convert.ToDateTime(contactinfo.EffectiveTime).ToString("yyyy-MM-dd");
this.txtDesc.Text = contactinfo.ContractDesc;
this.txtEndTime.Text = Convert.ToDateTime(contactinfo.EndTime).ToString("yyyy-MM-dd");
this.ddlType.SelectedItem.Text = contactinfo.ContractType.ToString(); this.cbIsCheck.Checked =bool.Parse(contactinfo.AssessorAuditing.ToString()); #endregion #region 从流程表中绑定数据
//1代表 合同管理表单
System.Data.DataTable dt = SqlComm.getTaskListRecordsByCondition(contractid, "1");
System.Data.DataRow[] dr0 = dt.Select(" listID=" + tasklistid); string historys = "";
for (int i = 1; i < dt.Rows.Count; i++)
{
historys+= dt.Rows[i]["Mind"].ToString() + " " + Convert.ToDateTime(dt.Rows[i]["SumitTime"].ToString()).ToString("yyyy-MM-dd")+"</br>"; }
if (historys.Length == 0)
{
historys = "暂无审核意见";
}
this.lbHistory.Text = historys; this.txtDepartMentID.Text = dr0[0].ItemArray[12].ToString();
this.txtUser1.Text = dr0[0].ItemArray[5].ToString();
#endregion filecontent = Comm.GetDownDocumet("BioCrmCorrelationDocument", "Content", " DocumentID=" + contactinfo.DocumentID);
documentsid = contactinfo.DocumentID.ToString(); if (SqlComm.getUserRightsByUserId(Session["Userid"].ToString()).Contains("45") || this.cbIsCheck.Checked==true)
{
this.lbIsCheck.Visible = true;
this.cbIsCheck.Visible = true;
}
else
{
this.lbIsCheck.Visible = false;
this.cbIsCheck.Visible = false; }
} /// <summary>
/// 下载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (filecontent == null)
{
ClientScript.RegisterStartupScript(this.GetType(), "test", "alert('没有要下载的文档')", true);
return;
} //创建弹出式Windows下载窗体
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(this.txtName.Text));
//把二进制数组写入Http输出流
Response.BinaryWrite(filecontent);
//想当前客户端缓冲区输出
Response.Flush();
//停止执行
Response.End();
}
}

合同审单执行:

业务逻辑代码:

  //判断当前登录用户是否是被提交人
if (dr0[0].ItemArray[5].ToString() == Session["Userid"].ToString())
{
//45法律资质审核权限
if (SqlComm.getUserRightsByUserId(Session["Userid"].ToString()).Contains("45"))
{
this.lbIsCheck.Visible = true;
this.cbIsCheck.Visible = true;
this.btnRun.Visible = true;
}
else
{
this.lbIsCheck.Visible = false;
this.cbIsCheck.Visible = false;
this.btnRun.Visible = false; } }
//如果当前登录用户是合同负责人(第一次提交合同申请的用户)
if (dr0[0].ItemArray[10].ToString() == Session["Userid"].ToString())
{
this.FileUpload1.Visible = true;
}else
{
this.FileUpload1.Visible = false;
}
 /// <summary>
/// 下载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (filecontent == null)
{
ClientScript.RegisterStartupScript(this.GetType(), "test", "alert('没有要下载的文档')", true);
return;
}
//创建弹出式Windows下载窗体
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(this.txtName.Text));
//把二进制数组写入Http输出流
Response.BinaryWrite(filecontent);
//想当前客户端缓冲区输出
Response.Flush();
//停止执行
Response.End();
} protected void btnRun_Click(object sender, EventArgs e)
{
CrmContractBLL conbll = new CrmContractBLL();
BioCRMContract contract = new BioCRMContract();
TaskListRecord tasklistRecord = null;
BioCrmCorrelationDocument document = null;
//获取合同相关信息
contract.ContractID = int.Parse(contractid);
contract.UserID = int.Parse(this.txtUser2.Text);
contract.ContractName = this.txtName.Text;
contract.CustomerID = int.Parse(this.txtCustomer.Text);
contract.ContractSum = decimal.Parse(this.txtSum.Text);
contract.ContractType = this.ddlType.SelectedValue;
contract.EndTime = Convert.ToDateTime(this.txtEndTime.Text);
contract.EffectiveTime = Convert.ToDateTime(this.txtEffectiveTime.Text);
contract.SignTime = Convert.ToDateTime(this.txtSinTime.Text);
contract.ContractDesc = this.txtDesc.Text;
contract.ExecutiveState = "待审核"; if (this.cbIsCheck.Visible == true)
{
contract.AssessorAuditing = cbIsCheck.Checked;
} contract.CreateTime = Convert.ToDateTime(this.txtCreatTime.Text); int count = conbll.BioCRMContractaUpdate(contract); //文档基本信息
if (this.FileUpload1.HasFile)
{
document = new BioCrmCorrelationDocument()
{
DocumentID = int.Parse(documentsid.ToString()),
Subject = this.txtName.Text,
Content = this.FileUpload1.FileBytes,
DocumentSize = this.FileUpload1.FileContent.Length,
Type = this.FileUpload1.PostedFile.ContentType,
ExetendName = System.IO.Path.GetExtension(this.FileUpload1.FileName),
DocumentLevel = "绝密",
Name = this.FileUpload1.FileName,
Remark = "合同附件文档",
UserID = int.Parse(this.txtUser2.Text),
UploadTime = DateTime.Now
};
BioCrmCorrelationDocumentBLL documentbll = new BioCrmCorrelationDocumentBLL(); documentbll.BioCrmCorrelationDocumentUpdate(document); } tasklistRecord = new TaskListRecord()
{
Accepter = int.Parse(this.txtUser2.Text),
Transmitter = int.Parse(Session["Userid"].ToString()),
AuditingSate =2,
DepartMentId = int.Parse(this.txtDepartMentID.Text),
FirstAccepter = int.Parse(this.hf_FirstAccepter.Value),
FirstSumitTime = Convert.ToDateTime(this.hf_FirstDateTime.Value),
FirstTransmitter = int.Parse(this.hf_FirstTransmitter.Value),
Mind = this.txtMind.Text,
Pass = 1,
Subject = this.txtName.Text,
SumitTime = DateTime.Now,
TaskID = int.Parse(contractid),
TaskTableID = 1
}; //向流程表添加一条新的记录
if (SqlComm.TaskListRecordAdd(tasklistRecord) != 0)
{
SqlComm.UpdateTableByCondition("dbo.TaskListRecord", " AuditingSate=1", " ListID=" + tasklistid);
ClientScript.RegisterStartupScript(this.GetType(), "test", "alert('合同申请提交成功,下次审批人员编号:" + this.txtUser1.Text + "')", true);
}
}

ERP合同管理二(三十)的更多相关文章

  1. bp(net core)+easyui+efcore实现仓储管理系统——入库管理之二(三十八)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  2. ERP产品采购申请管理(三十八)

    BLL层代码: public class BioPurchaseBLL { /// <summary> /// 购进申请添加 /// </summary> /// <pa ...

  3. ERP合同管理流程查询(三十一)

    根据任务表编号,及相关表单编号获取当前流程表的编号: CREATE FUNCTION [dbo].[FN_GetDynamicId] ( @tasktableid INT, @taskid INT ) ...

  4. ERP合同管理(二十七)

    需要实现的基本业务: 相关的用例图: 相关业务的封装: 相关的约定: 合同信息添加业务流程: 添加的存储过程 SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON GO ...

  5. ERP采购申请管理(三十九)

    获取当前表单在流程中的状态: /// <summary> /// 获取当前表单在流程表中的状态 /// </summary> /// <param name=" ...

  6. bp(net core)+easyui+efcore实现仓储管理系统——入库管理之三存储过程(三十九)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  7. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之六(四十二)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  8. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之十二(四十八)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

  9. abp(net core)+easyui+efcore实现仓储管理系统——入库管理之四(四十)

    abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+ ...

随机推荐

  1. JVM总结(四):JVM类加载机制

    这一节我们来总结一下JVM类加载机制.具体目录如下: 类加载的过程 类加载过程概括 说说引用 详解类加载全过程: 加载 验证 准备 解析 初始化 虚拟机把描述类的数据从Class文件加载到内存,并对数 ...

  2. Node remains in conflict,svn冲突解决办法

    修改问价svn 提交后其他客户端svn update更新时出现以下问题 Updating '.':Skipped 'Hi3559_Stream' -- Node remains in conflict ...

  3. Neural Networks and Deep Learning(week4)Building your Deep Neural Network: Step by Step

    Building your Deep Neural Network: Step by Step 你将使用下面函数来构建一个深层神经网络来实现图像分类. 使用像relu这的非线性单元来改进你的模型 构建 ...

  4. Python基础(正则、序列化、常用模块和面向对象)-day06

    写在前面 上课第六天,打卡: 天地不仁,以万物为刍狗: 一.正则 - 正则就是用一些具有特殊含义的符号组合到一起(称为正则表达式)来描述字符或者字符串的方法: - 在线正则工具:http://tool ...

  5. JXL导出Excel(只支持xls版本)——(一)

    注意: 导出的后缀是xls可以直接打开,如果导出的后缀是xlsx打开报错,需要手动将名字改为xls才可以打开.也就是JXL不可以导出xlsx的excel. Jar包

  6. oracle怎么给表和列加注释

    oracle添加注释的语法为: comment on column 字段名 is  '注释名' 举例: 创建表: CREATE TABLE t1{ id varchar2(32) primary ke ...

  7. Struts S2-052漏洞利用

    昨天在FreeBuf上看到[9月6日更新]漏洞预警 | 高危Struts REST插件远程代码执行漏洞(S2-052) 然而一直复现不了,今天又试了下竟然成功了. 由于水表查的较严,就不冒险搞别人的服 ...

  8. 【C++】获取URL中主机域名

    // ConsoleApplication1.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <windows.h& ...

  9. Linux Samba服务主配文件smb.conf中文详解【转】

    转自:https://blog.csdn.net/maotianwang/article/details/52524732 从网上找到描述比较详细的smb.conf中文解释: 服务名:smb 配置目录 ...

  10. redhat换用centos源

    解除原有源rpm -aq|grep yum|xargs rpm -e --nodepsrpm -aq|grep python-iniparse|xargs rpm -e --nodeps rpm -q ...