work.aspx.cs
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:3k
源码类别:
OA系统
开发平台:
ASP/ASPX
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class web_pos_c_work : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- }
- protected void save(int state)
- {
- if (this.CheckValidate())
- {
- SqlConnection conn = dbConnection.getConnection();
- conn.Open();
- SqlTransaction tx = conn.BeginTransaction();
- string sql = "";
- try
- {
- int id = 1;
- SqlCommand cmd = new SqlCommand("select max(id) from OA_WORK_FORM", conn);
- cmd.Transaction = tx;
- try
- {
- id = Convert.ToInt32(cmd.ExecuteScalar().ToString()) + 1;
- }
- catch { }
- string total_result = "完成";
- if (state == 2)
- {
- total_result = "未送件";
- }
- sql = "insert into OA_WORK_FORM(id, form_id, " +
- "emp_name, department_id,department,emp_position,w_name," +
- " total_result, finish_date, is_del, apply_date, state) values (" +
- id + ", '" + TxtFormNo.Text + "','" + EmpId.Value + "', '" + DepartmentId.Value + "','" +
- TxtEmpName.Text+"','"+TxtPosition.Text+
- "0,'" + total_result + "','','N','" + TxtApplyDate.Text + "','" + state + "')";
- cmd = new SqlCommand(sql, conn);
- cmd.Transaction = tx;
- cmd.ExecuteNonQuery();
- int flow_id = 1;
- cmd = new SqlCommand("select max(id) from OA_pos_c_FORM_FLOW", conn);
- cmd.Transaction = tx;
- try
- {
- flow_id = Convert.ToInt32(cmd.ExecuteScalar().ToString()) + 1;
- }
- catch { }
- #region
- #endregion
- }
- catch (Exception ex)
- {
- Response.Write(ex.Message);
- try
- {
- tx.Rollback();
- }
- catch { }
- }
- conn.Close();
- }
- }
- }