public static int 插入待办中心(AM_待办业务 ammodel) { StringBuilder dbsb = new StringBuilder(); dbsb.Append("INSERT INTO AM_待办业务 "); dbsb.Append("(流程状态,FlowID,事项名称,通知内容,发起人,发起时间,处理职务,处理方式,处理人,FlowName,Sort "); dbsb.Append(" ) VALUES( "); dbsb.Append(" @流程状态,@FlowID,@事项名称,@通知内容,@发起人,@发起时间,@处理职务,@处理方式,@处理人,@FlowName ,@Sort"); dbsb.Append(")"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", ammodel.流程状态), new SqlParameter("@FlowID", ammodel.FlowID), new SqlParameter("@事项名称", ammodel.事项名称), new SqlParameter("@通知内容", ammodel.通知内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@处理职务", ammodel.处理职务), new SqlParameter("@处理方式", ammodel.处理方式), new SqlParameter("@处理人", ammodel.处理人), new SqlParameter("@FlowName", ammodel.FlowName), new SqlParameter("@Sort", ammodel.Sort), }; return(Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara))); }
public static int 修改待办中心(AM_待办业务 ammodel) { //所需参数 “流程状态,处理职务,处理方式,处理人,通知内容,FlowID,FlowName” string sql = string.Format("UPDATE dbo.AM_待办业务 set 流程状态 = '{0}',处理职务='{1}',处理方式='{2}',处理人='{3}',Sort={4} , 通知内容='{5}' where FlowID = {6} and FlowName = '{7}'", ammodel.流程状态, ammodel.处理职务, ammodel.处理方式, ammodel.处理人, ammodel.Sort, ammodel.通知内容, ammodel.FlowID, ammodel.FlowName); return(DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString())); }
public int 操作资产借还流程(AM_资产借还流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { try { StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", ammodel.FlowID) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); if (model.Sort == 1)//同意借出 { string sql = string.Format("UPDATE AM_资产借还流程表 SET 是否同意 ='{0}' ,借出人操作时间 = '{1}' , 操作人 = '{2}',Sort=2 ,流程状态='已出借,待归还' where ID = {3}", model.是否同意, model.借出人操作时间, model.操作人, model.ID); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); string strid = model.资产ID; strid = strid.Substring(0, strid.Length - 1);//删除最后一个字符 string[] arr = strid.Split(','); List <string> worklist = new List <string>(); string workstr = ""; foreach (string item in arr) { workstr = string.Format(" UPDATE 办公设备信息表 SET 借用 = {0} where ID = {1}", 1, item); worklist.Add(workstr.ToString()); } DBHelper.ExecuteSqlTran(worklist); } else if (model.Sort == 2)//已归还待确认 { string sql = string.Format("UPDATE AM_资产借还流程表 SET 申请人是否归还 ='{0}' ,申请人归还时间 = '{1}' ,Sort=3 ,流程状态='已归还,待确认' where ID = {2}", model.申请人是否归还, model.申请人归还时间, model.ID); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); } else if (model.Sort == 3) //完成 { string sql = string.Format("UPDATE AM_资产借还流程表 SET 出借人确认归还 ='{0}' ,出借人确认时间 = '{1}' ,Sort=0 ,流程状态='完成' where ID = {2}", model.出借人确认归还, model.出借人确认时间, model.ID); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); } string sqlup = string.Format("UPDATE AM_待办业务 SET 流程状态='{0}',通知内容 ='{1}' ,处理方式='{2}',处理人='{3}',Sort='{4}' where FlowID = {5} and FlowName='{6}'", dbmodel.流程状态, dbmodel.通知内容, dbmodel.处理方式, dbmodel.处理人, dbmodel.Sort, dbmodel.FlowID, dbmodel.FlowName); return(DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sqlup.ToString())); } catch (Exception) { return(0); } }
protected void Button8_Click(object sender, EventArgs e) { if (完成时间.Text == "") { 完成时间.Text = 完成时间.EmptyText; } if (TextBox1.Text != "" && 完成时间.Text != "" && TextBox3.Text != "") { School资产报修BLL bll = new School资产报修BLL(); SchoolX_资产报修流程表 model = new SchoolX_资产报修流程表(); model.维修人电话 = TextBox1.Text; model.完工时间 = 完成时间.Text; model.故障原因 = TextBox3.Text; model.维修人员 = TextBox2.Text; model.流程状态 = "已完工,待反馈"; object a = Grid1.SelectedRow.DataKeys[0]; int id = Convert.ToInt32(a); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "发起人"; ammodel.发起人 = Session["姓名"].ToString(); ammodel.消息内容 = "您来自" + ammodel.发起人 + "的资产报修完成申请,请及时处理!"; ammodel.消息事项 = "资产报修"; ammodel.是否已读 = "否"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = bll.ren(id); dbmodel.流程状态 = model.流程状态; dbmodel.事项名称 = "资产报修"; dbmodel.发起人 = Session["姓名"].ToString(); dbmodel.通知内容 = "您来自" + dbmodel.发起人 + "的资产报修完成申请,请及时处理!"; dbmodel.FlowName = "资产报修"; dbmodel.Sort = 3; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); int xx = bll.添加完成信息(id, model, ammodel, dbmodel); if (xx > 0) { grid1_bind(); Alert.ShowInTop("提交成功!"); Window5.Hidden = true; 流程状态待派单.Hidden = true; } else { Alert.ShowInTop("提交错误!"); } } else { Alert.ShowInTop("请填写信息完整!"); return; } }
public int 报修结算(int id, SchoolX_资产报修流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { try { string sql = string.Format("UPDATE X_资产报修流程表 SET 完工时间='{0}',结果反馈='{1}',流程状态='{2}',Sort=4 where ID=" + id, model.完工时间, model.结果反馈, model.流程状态); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", id) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); StringBuilder dbsb = new StringBuilder(); dbsb.Append("update AM_待办业务 SET "); dbsb.Append("流程状态=@流程状态,事项名称=@事项名称,通知内容=@通知内容,发起人=@发起人,发起时间=@发起时间,处理方式=@处理方式,处理人=@处理人,FlowName=@FlowName,Sort=@Sort WHERE FlowID= " + id + " AND FlowName=@FlowName"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", dbmodel.流程状态), new SqlParameter("@事项名称", dbmodel.事项名称), new SqlParameter("@通知内容", dbmodel.通知内容), new SqlParameter("@发起人", dbmodel.发起人), new SqlParameter("@处理人", dbmodel.处理人), new SqlParameter("@发起时间", dbmodel.发起时间), new SqlParameter("@处理方式", dbmodel.处理方式), new SqlParameter("@FlowName", dbmodel.FlowName), new SqlParameter("@Sort", dbmodel.Sort) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); return(1); } catch { return(0); } }
protected void Button9_Click(object sender, EventArgs e) { OffSession(); string username = Session["姓名"].ToString(); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "结果反馈通知"; ammodel.通知职务 = "资产管理员"; ammodel.发起人 = username; ammodel.消息内容 = "您来自" + ammodel.发起人 + "的资产转移已完成!"; ammodel.消息事项 = "资产转移"; ammodel.是否已读 = "否"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "职务"; dbmodel.处理职务 = "资产管理员"; dbmodel.流程状态 = "已完成"; dbmodel.发起人 = ammodel.发起人; dbmodel.通知内容 = "您来自" + dbmodel.发起人 + "的资产转移已完成!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.Sort = 0; //执行修改 int id = Convert.ToInt16(xx.Text); if (id > 0) { int num = bll.修改数据(id, 查看归属部门变更为.Text, 查看存放地点变更为.Text, 查看负责人变更为.Text, ammodel, dbmodel); if (num > 0) { Alert.ShowInTop("转移成功!", "提示信息", MessageBoxIcon.Information); 新增资产转移查看详情.Hidden = true; DataSet ds = bll.首页_X_资产转移流程表("流程状态-全部"); DataTable dt = ds.Tables[0].Copy();//复制一份table DataTable source = dt; // 3.绑定到Grid Grid1.DataSource = dt;//DataTable Grid1.DataBind(); } } else { Alert.ShowInTop("未获取选择行!", "警告信息", MessageBoxIcon.Error); } // }
//处置申报待报废处理流程 public int 处置申报待报废处理流程(SchoolX_资产处置流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { try { StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", ammodel.FlowID) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); if (model.Sort == 1)//分管领导通过 { //string sql = string.Format("UPDATE X_资产处置流程表 SET 是否同意 ='{0}' ,分管领导通过时间 = '{1}' , 申请人 = '{2}',Sort=2 ,流程状态='分管领导已通过,待主管部门审核' where ID = {3}", model.是否同意, model.分管领导通过时间, model.申请人, model.ID); //DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); } else if (model.Sort == 2)//主管部门审核 { //string sql = string.Format("UPDATE X_资产处置流程表 SET 主管部门确认通过 ='{0}' ,主管部门通过时间 = '{1}' ,Sort=3 ,流程状态='主管部门已审核通过,待财政部门审核' where ID = {2}", model.主管部门确认通过, model.主管部门通过时间, model.ID); //DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); } else if (model.Sort == 3) //财政部门审核 { //string sql = string.Format("UPDATE X_资产处置流程表 SET 财务部门确认通过 ='是' ,财政部门通过时间 = '2020/2/4' ,Sort=0 ,流程状态='完成' where ID = {2}", model.财政部门确认通过, model.财政部门通过时间, model.ID); //DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); } string sqlup = string.Format("UPDATE AM_待办业务 SET 流程状态='{0}',通知内容 ='{1}' ,处理职务='{2}' where FlowID = {3} and 事项名称='{4}'", dbmodel.流程状态, dbmodel.通知内容, dbmodel.处理职务, dbmodel.FlowID, dbmodel.事项名称); return(DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sqlup.ToString())); } catch (Exception) { return(0); } }
protected void Button11_Click(object sender, EventArgs e) { object a = Grid1.SelectedRow.DataKeys[0]; int id = Convert.ToInt32(a); SchoolX_资产报修流程表 model = new SchoolX_资产报修流程表(); model.完工时间 = DatePicker2.Text; model.结果反馈 = 结果反馈.Text; model.流程状态 = "已完成"; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "结果反馈通知"; ammodel.通知职务 = "发起人"; ammodel.发起人 = Session["姓名"].ToString(); ammodel.消息事项 = "资产报修"; ammodel.是否已读 = "否"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = bll.ren(id); dbmodel.流程状态 = model.流程状态; dbmodel.事项名称 = "资产报修"; dbmodel.FlowName = dbmodel.事项名称; dbmodel.Sort = 0; dbmodel.发起人 = Session["姓名"].ToString(); dbmodel.通知内容 = "您来自" + dbmodel.处理人 + "的资产报修申请已完成!"; ammodel.消息内容 = "您来自" + dbmodel.处理人 + "的资产报修申请已完成!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); int xx = bll.报修结算(id, model, ammodel, dbmodel); if (xx > 0) { Alert.ShowInTop("提交成功!"); 流程状态待派单.Hidden = true; Window6.Hidden = true; grid1_bind(); return; } else { Alert.ShowInTop("提交错误!"); } }
public int 修改数据(int ID, string 归属部门变更为, string 存放地点变更为, string 负责人变更为, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", ID) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); StringBuilder dbsb = new StringBuilder(); dbsb.Append("update AM_待办业务 SET "); dbsb.Append("流程状态=@流程状态,通知内容=@通知内容,发起人=@发起人,发起时间=@发起时间,处理方式=@处理方式,处理职务=@处理职务,Sort=@Sort WHERE FlowID= " + ID + " AND FlowName='资产转移'"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", dbmodel.流程状态), new SqlParameter("@通知内容", dbmodel.通知内容), new SqlParameter("@发起人", dbmodel.发起人), new SqlParameter("@发起时间", dbmodel.发起时间), new SqlParameter("@处理方式", dbmodel.处理方式), new SqlParameter("@处理职务", dbmodel.处理职务), new SqlParameter("@Sort", dbmodel.Sort) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); string sql = string.Format("SELECT * FROM dbo.X_资产转移流程表 WHERE ID = {0}", ID); SqlDataReader read = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); string SID = ""; if (read.Read()) { SID = read["S_ID"].ToString(); } read.Close(); string[] condition = { "," }; string[] result = SID.Split(condition, StringSplitOptions.RemoveEmptyEntries); List <int> inlist = new List <int>(); foreach (string item in result) { inlist.Add(Convert.ToInt32(item)); } int upgsbm = 0; int upcfdd = 0; int upfzr = 0; string sqlx = string.Format("SELECT ID FROM dbo.一级部门表 where 名称='{0}'", 归属部门变更为); SqlDataReader readx = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sqlx.ToString()); while (readx.Read()) { upgsbm = Convert.ToInt32(readx["ID"]); } readx.Close(); string sqlup2 = string.Format("SELECT * from dbo.房间信息表 where 名称 = '{0}'", 存放地点变更为); SqlDataReader readup2 = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sqlup2.ToString()); while (readup2.Read()) { upcfdd = Convert.ToInt32(readup2["ID"]); } readup2.Close(); string sqlup3 = string.Format("SELECT * FROM 用户表 where 姓名 = '{0}'", 负责人变更为); SqlDataReader readup3 = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sqlup3.ToString()); while (readup3.Read()) { upfzr = Convert.ToInt32(readup3["ID"]); } readup3.Close(); List <string> cstrlist = new List <string>(); string csqls = ""; for (int i = 0; i < inlist.Count; i++) { csqls = string.Format(" UPDATE 办公设备信息表 SET 归属部门 = {0} ,位置 = {1}, 归属教师ID = {2} where ID = {3}", upgsbm, upcfdd, upfzr, inlist[i]); cstrlist.Add(csqls.ToString()); } string sqlflowstate = string.Format("UPDATE X_资产转移流程表 SET 流程状态='已完成' where ID = {0}", ID); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sqlflowstate.ToString()); return(DBHelper.ExecuteSqlTran(cstrlist)); }
public int 新增原值变动(SchoolX_原值变动流程表 model, List <School办公设备信息表> workmodel, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.新增原值变动(model, workmodel, ammodel, dbmodel)); }
public int upzczy(SchoolX_资产转移流程表 model, List <int> listid, List <SchoolX_资产转移改动信息表> listmodel, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { try { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO X_资产转移流程表 "); sb.Append(" (流程状态,单据编号,事项名称,申请人,申请日期,联系方式,存放地点变更为,归属部门变更为,负责人变更为,备注信息,S_ID,总数,总价,Sort "); sb.Append(" ) VALUES( "); sb.Append(" @流程状态,@单据编号,@事项名称,@申请人,@申请日期,@联系方式,@存放地点变更为,@归属部门变更为,@负责人变更为,@备注信息,@S_ID,@总数,@总价," + 1); sb.Append(")"); sb.Append(" SELECT "); sb.Append(" @@identity "); SqlParameter[] para = { new SqlParameter("@流程状态", model.流程状态), new SqlParameter("@单据编号", model.单据编号), new SqlParameter("@事项名称", model.事项名称), new SqlParameter("@申请人", model.申请人), new SqlParameter("@申请日期", model.申请日期), new SqlParameter("@联系方式", model.联系方式), new SqlParameter("@存放地点变更为", model.存放地点变更为), new SqlParameter("@归属部门变更为", model.归属部门变更为), new SqlParameter("@负责人变更为", model.负责人变更为), new SqlParameter("@备注信息", model.备注信息), new SqlParameter("@S_ID", model.S_ID), new SqlParameter("@总数", model.总数), new SqlParameter("@总价", model.总价), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", num) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); //DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); StringBuilder dbsb = new StringBuilder(); dbsb.Append("INSERT INTO AM_待办业务 "); dbsb.Append("(流程状态,FlowID,处理方式,通知内容,发起人,发起时间,FlowName,处理职务,Sort,事项名称 "); dbsb.Append(" ) VALUES( "); dbsb.Append(" @流程状态,@FlowID,@处理方式,@通知内容,@发起人,@发起时间,@FlowName,@处理职务,@Sort,@事项名称 "); dbsb.Append(")"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", dbmodel.流程状态), new SqlParameter("@FlowID", num), new SqlParameter("@处理方式", dbmodel.处理方式), new SqlParameter("@通知内容", dbmodel.通知内容), new SqlParameter("@发起人", dbmodel.发起人), new SqlParameter("@发起时间", dbmodel.发起时间), new SqlParameter("@处理职务", dbmodel.处理职务), new SqlParameter("@Sort", dbmodel.Sort), new SqlParameter("@事项名称", dbmodel.事项名称), new SqlParameter("@FlowName", dbmodel.FlowName) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); List <string> strlist = new List <string>(); string sqlzy = ""; for (int i = 0; i < listmodel.Count; i++) { sqlzy = string.Format("INSERT INTO [X_资产转移改动信息表] ([转移流程表ID],[办公设备信息表ID],[原存放地点],[原归属部门],[原负责人],[现存放地点],[现归属部门],[现负责人]) VALUES ({0},{1},'{2}','{3}','{4}','{5}','{6}','{7}')", num, listid[i], listmodel[i].原存放地点, listmodel[i].原归属部门, listmodel[i].原负责人, model.存放地点变更为, model.归属部门变更为, model.负责人变更为); strlist.Add(sqlzy); } int XX = DBHelper.ExecuteSqlTran(strlist); //int AA = XX; return(XX); //if (num > 0) //{ // int upgsbm = 0; // int upcfdd = 0; // int upfzr = 0; // string sql = string.Format("SELECT ID FROM dbo.一级部门表 where 名称='{0}'", model.归属部门变更为); // SqlDataReader read = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); // while (read.Read()) // { // upgsbm = Convert.ToInt32(read["ID"]); // } // read.Close(); // string sqlup2 = string.Format("SELECT * from dbo.房间信息表 where 名称 = '{0}'", model.存放地点变更为); // SqlDataReader readup2 = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sqlup2.ToString()); // while (readup2.Read()) // { // upcfdd = Convert.ToInt32(readup2["ID"]); // } // readup2.Close(); // string sqlup3 = string.Format("SELECT * FROM 用户表 where 姓名 = '{0}'", model.负责人变更为); // SqlDataReader readup3 = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, sqlup3.ToString()); // while (readup3.Read()) // { // upfzr = Convert.ToInt32(readup3["ID"]); // } // readup3.Close(); // List<string> cstrlist = new List<string>(); // string csqls = ""; // for (int i = 0; i < listid.Count; i++) // { // csqls = string.Format(" UPDATE 办公设备信息表 SET 归属部门 = {0} ,位置 = {1}, 归属教师ID = {2} where ID = {3}", upgsbm, upcfdd, upfzr, listid[i]); // cstrlist.Add(csqls.ToString()); // } // return DBHelper.ExecuteSqlTran(cstrlist); //} //else //{ // return 0; //} } catch (Exception) { return(0); //throw; } //return sql.upzczy(model, listid); }
protected void Button2_Click(object sender, EventArgs e) { AM_资产借还流程表 model = new AM_资产借还流程表(); if (Grid2.Rows.Count == 0) { Alert.ShowInTop("请先添加资产!", "提示信息", MessageBoxIcon.Warning); return; } model.Sort = 1; model.流程状态 = 流程状态.Text; model.发起人 = 借用人.Text; model.借出人 = 借出人.Text; model.借用人 = 借用人.Text; model.提交时间 = 提交时间.Text; if (预计归还时间.Text == null || 预计归还时间.Text == "") { Alert.ShowInTop("请输入归还时间!", "提示信息", MessageBoxIcon.Warning); return; } model.预计归还时间 = 预计归还时间.Text; model.单据编号 = 单据编号.Text; model.借出人 = 借出人.Text; model.借用时间 = 借用时间.Text; model.备注信息 = 备注信息.Text; int[] selections = Grid4.SelectedRowIndexArray; int 资产数量 = 0; foreach (int rowIndex in selections) { int ID = Convert.ToInt32(Grid4.DataKeys[rowIndex][0]); string xxx = Grid4.DataKeys[rowIndex][0].ToString(); model.资产ID += ID.ToString() + ","; 资产数量++; } model.资产数量 = 资产数量.ToString(); School资产借还交接BLL bll = new School资产借还交接BLL(); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = 借用人.Text; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "财务人员"; ammodel.消息内容 = "您来自" + 借用人.Text + "的资产借还申请通知!"; ammodel.消息事项 = "资产借还"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = model.借出人; dbmodel.Sort = 1; dbmodel.发起人 = 借用人.Text; dbmodel.流程状态 = 流程状态.Text; dbmodel.事项名称 = "资产借还"; dbmodel.通知内容 = "您来自" + 借用人.Text + "的资产借还申请,请及时处理!"; dbmodel.FlowName = "资产借还"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); if (bll.创建资产借还(model, ammodel, dbmodel) > 0) { Window1.Hidden = true; Alert.ShowInTop("创建成功!"); BindGrid(); } }
protected void btnok_Click(object sender, EventArgs e) { if (btnok.Text == "同意借出") { string processingtime = DateTime.Now.ToShortDateString(); //处理时间 string username = Session["姓名"].ToString(); //处理人 int flowid = Convert.ToInt32(FlowID.Text); string zcid = 资产ID.Text; AM_资产借还流程表 model = new AM_资产借还流程表(); model.ID = flowid; model.资产ID = zcid; model.借出人操作时间 = processingtime; model.是否同意 = "是"; model.操作人 = username; model.Sort = 1; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "发起人"; ammodel.消息内容 = "资产借还任务已全部完成!"; ammodel.消息事项 = "资产借还"; ammodel.发起人 = username;//处理人 ammodel.FlowID = flowid; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = model.借用人; dbmodel.发起人 = username; dbmodel.FlowID = flowid; dbmodel.流程状态 = "已出借,待归还"; dbmodel.事项名称 = "资产借还"; dbmodel.通知内容 = "您来自" + username + "的资产借还已同意,请及时处理!"; dbmodel.Sort = 2; dbmodel.FlowName = "资产借还"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); School资产借还交接BLL bll = new School资产借还交接BLL(); string sql = string.Format("UPDATE dbo.AM_待办业务 set 流程状态 = '{0}',处理职务='{1}',处理方式='{2}',处理人='{3}' where FlowID = {4} AND FlowName = '{5}'", ammodel.流程状态, ammodel.处理职务, ammodel.处理方式, ammodel.处理人, ammodel.FlowID, ammodel.FlowName); if (bll.操作资产借还流程(model, ammodel, dbmodel) > 0) { Alert alert = new Alert(); alert.Message = "处理成功"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Success; alert.Show(); Window3.Hidden = true; BindGrid(); return; } else { Alert alert = new Alert(); alert.Message = "处理失败"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Show(); return; } } else if (btnok.Text == "确认归还") { School资产借还交接BLL bll = new School资产借还交接BLL(); string processingtime = DateTime.Now.ToShortDateString(); //处理时间 string username = Session["姓名"].ToString(); //处理人 int flowid = Convert.ToInt32(FlowID.Text); string 出借人 = bll.查询出借人(flowid); AM_资产借还流程表 model = new AM_资产借还流程表(); model.ID = flowid; model.申请人是否归还 = "是"; model.申请人归还时间 = processingtime; model.Sort = 2; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "出借人"; ammodel.消息内容 = "资产借还流程" + username + "已归还,等待借出人确认。"; ammodel.消息事项 = "资产借还"; ammodel.发起人 = username;//处理人 ammodel.FlowID = flowid; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = 出借人; dbmodel.发起人 = username; dbmodel.流程状态 = "已归还,待确认"; dbmodel.事项名称 = "资产借还"; dbmodel.通知内容 = "您来自" + username + "的资产借还归还申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.FlowID = flowid; dbmodel.FlowName = "资产借还"; dbmodel.Sort = 3; if (bll.操作资产借还流程(model, ammodel, dbmodel) > 0) { Alert alert = new Alert(); alert.Message = "处理成功"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Success; alert.Show(); Window3.Hidden = true; BindGrid(); return; } else { Alert alert = new Alert(); alert.Message = "处理失败"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Show(); return; } } else if (btnok.Text == "已归还") { string processingtime = DateTime.Now.ToShortDateString(); //处理时间 string username = Session["姓名"].ToString(); //处理人 int flowid = Convert.ToInt32(FlowID.Text); AM_资产借还流程表 model = new AM_资产借还流程表(); model.ID = flowid; model.出借人确认归还 = "是"; model.出借人确认时间 = processingtime; model.Sort = 3; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "结果反馈通知"; ammodel.通知职务 = "发起人"; ammodel.消息内容 = "您来自" + username + "的资产借还已同意,请及时处理!"; ammodel.消息事项 = "资产借还"; ammodel.发起人 = username;//处理人 ammodel.FlowID = flowid; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = ""; dbmodel.处理人 = ""; dbmodel.发起人 = username; dbmodel.流程状态 = "完成"; dbmodel.事项名称 = "资产借还"; dbmodel.通知内容 = "您的资产借还流程已全部完成"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.FlowID = flowid; dbmodel.Sort = 0; dbmodel.FlowName = "资产借还"; School资产借还交接BLL bll = new School资产借还交接BLL(); if (bll.操作资产借还流程(model, ammodel, dbmodel) > 0) { Alert alert = new Alert(); alert.Message = "处理成功"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Success; alert.Show(); Window3.Hidden = true; BindGrid(); return; } else { Alert alert = new Alert(); alert.Message = "处理失败"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Show(); return; } } }
public int 添加资产报修表(SchoolX_资产报修流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.添加资产报修(model, ammodel, dbmodel)); }
public int 新增原值变动(SchoolX_原值变动流程表 model, List <School办公设备信息表> workmodel, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { string sql = string.Format("INSERT INTO X_原值变动流程表 (流程状态,单据编号,事项名称,申请人,申请日期,记账人,总数,总价,变动方式,变动原因,记账人意见,备注信息,资产ID,str变动金额,Sort)VALUES('{0}','{1}','{2}','{3}','{4}','{5}',{6},{7},'{8}','{9}','{10}','{11}','{12}','{13}','{14}')SELECT @@identity", model.流程状态, model.单据编号, model.事项名称, model.申请人, model.申请日期, model.记账人, model.总数, model.总价, model.变动方式, model.变动原因, model.记账人意见, model.备注, model.资产ID, model.str变动金额, 1); int result = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sql)); if (result > 0) { StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", result) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); StringBuilder dbsb = new StringBuilder(); dbsb.Append("INSERT INTO AM_待办业务 "); dbsb.Append("(流程状态,FlowID,事项名称,通知内容,发起人,发起时间,处理职务 "); dbsb.Append(" ) VALUES( "); dbsb.Append(" @流程状态,@FlowID,@事项名称,@通知内容,@发起人,@发起时间,@处理职务 "); dbsb.Append(")"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", dbmodel.流程状态), new SqlParameter("@FlowID", result), new SqlParameter("@事项名称", dbmodel.事项名称), new SqlParameter("@通知内容", dbmodel.通知内容), new SqlParameter("@发起人", dbmodel.发起人), new SqlParameter("@发起时间", dbmodel.发起时间), new SqlParameter("@处理职务", dbmodel.处理职务) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); List <string> worklist = new List <string>(); string workstr = ""; for (int i = 0; i < workmodel.Count; i++) { workstr = string.Format(" UPDATE 办公设备信息表 SET 变动金额 = {0} where ID = {1}", workmodel[i].变动金额, workmodel[i].ID); worklist.Add(workstr.ToString()); } return(DBHelper.ExecuteSqlTran(worklist)); } else { return(0); } }
public int 处置申报报废处理流程(SchoolX_资产处置流程表 model) { try { //分管领导通过 if (model.Sort == 1) { StringBuilder sb = new StringBuilder(); sb.Append("UPDATE X_资产处置流程表 SET 调入单位分管领导意见 =@调入单位分管领导意见 ,调入单位分管领导处理时间 = @调入单位分管领导处理时间 , 调入单位分管领导 = @调入单位分管领导,"); sb.Append(" Sort=2 ,流程状态='分管领导已通过,待主管部门审核' where ID = @ID"); SqlParameter[] para = { new SqlParameter("@调入单位分管领导意见", model.调入单位分管领导意见), new SqlParameter("@调入单位分管领导处理时间", model.调入单位分管领导处理时间), new SqlParameter("@调入单位分管领导", model.调入单位分管领导), //new SqlParameter("@原因说明",model.原因说明), new SqlParameter("@ID", model.ID), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.消息事项 = "资产处置"; ammodel.消息内容 = "您来自" + model.调入单位分管领导 + "的资产处置报废申请分管领导已通过!"; ammodel.发起人 = model.调入单位分管领导; ammodel.发起时间 = DateTime.Now; ammodel.通知类型 = "待办事项通知"; ammodel.是否已读 = "否"; ammodel.通知职务 = "主管部门"; ammodel.FlowID = model.ID; ammodel.FlowName = "资产处置-报废"; ammodel.处理职务 = "主管部门"; ammodel.处理方式 = "职务"; ammodel.处理人 = "主管部门"; ammodel.流程状态 = "分管领导已通过,待主管部门审核"; SchoolUtility.插入消息中心(ammodel); AM_待办业务 upmodel = new AM_待办业务(); upmodel.流程状态 = "分管领导已通过,待主管部门审核"; upmodel.通知内容 = "您来自" + model.调入单位分管领导 + "的资产处置报废申请分管领导已通过,请及时处理!"; upmodel.处理职务 = "主管部门"; upmodel.处理方式 = "职务"; upmodel.发起时间 = DateTime.Now.ToLongDateString(); upmodel.处理人 = "主管部门"; upmodel.Sort = 2; upmodel.FlowID = model.ID; upmodel.事项名称 = "资产处置-报废"; upmodel.FlowName = upmodel.事项名称; SchoolUtility.修改待办中心(upmodel); } //主管部门审核 else if (model.Sort == 2) { StringBuilder sb = new StringBuilder(); sb.Append("UPDATE X_资产处置流程表 SET 主管部门 =@主管部门 ,主管部门处理时间 = @主管部门处理时间 ,Sort=3 ,"); sb.Append("流程状态='主管部门已审核通过,待财政部门审核',主管部门意见=@主管部门意见 where ID = @ID"); SqlParameter[] para = { new SqlParameter("@主管部门", model.主管部门), new SqlParameter("@主管部门处理时间", model.主管部门处理时间), new SqlParameter("@主管部门意见", model.主管部门意见), new SqlParameter("@ID", model.ID), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.消息事项 = "资产处置"; ammodel.消息内容 = "您来自" + model.主管部门 + "的资产处置报废申请主管部门已通过!"; ammodel.发起人 = model.主管部门; ammodel.发起时间 = DateTime.Now; ammodel.通知类型 = "待办事项通知"; ammodel.是否已读 = "否"; ammodel.通知职务 = "财务人员"; ammodel.FlowID = model.ID; ammodel.FlowName = "资产处置-报废"; ammodel.处理职务 = "财务人员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "财务人员"; ammodel.流程状态 = "主管部门已通过,待财务部门审核"; SchoolUtility.插入消息中心(ammodel); AM_待办业务 upmodel = new AM_待办业务(); upmodel.处理职务 = "财务人员"; upmodel.处理方式 = "职务"; upmodel.处理人 = "财务人员"; upmodel.流程状态 = "主管部门已通过,待财务部门审核"; upmodel.事项名称 = "资产处置-报废"; upmodel.FlowID = model.ID; upmodel.Sort = 3; upmodel.FlowName = upmodel.事项名称; upmodel.通知内容 = "您来自" + model.主管部门 + "的资产处置报废申请主管部门已通过,请及时处理!"; upmodel.发起时间 = DateTime.Now.ToLongDateString(); SchoolUtility.修改待办中心(upmodel); } //财政部门审核 else if (model.Sort == 3) { StringBuilder sb = new StringBuilder(); sb.Append("UPDATE X_资产处置流程表 SET 财政部门意见 =@财政部门意见,财政部门处理时间 =@财政部门处理时间 ,财政部门=@财政部门 ,Sort=0 ,"); sb.Append("流程状态='完成' where ID = @ID"); SqlParameter[] para = { new SqlParameter("@财政部门意见", model.财政部门意见), new SqlParameter("@财政部门处理时间", model.财政部门处理时间), new SqlParameter("@财政部门", model.财政部门), new SqlParameter("@ID", model.ID), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.消息事项 = "资产处置"; ammodel.消息内容 = "您来自" + model.财政部门 + "的资产处置报废申请分管领导已通过!"; ammodel.发起人 = model.财政部门; ammodel.发起时间 = DateTime.Now; ammodel.通知类型 = "待办事项通知"; ammodel.是否已读 = "否"; ammodel.通知职务 = "财务部门"; ammodel.FlowID = model.ID; ammodel.FlowName = "资产处置-报废"; ammodel.处理职务 = "财务部门"; ammodel.处理方式 = "财务"; ammodel.处理人 = "财务人员"; ammodel.流程状态 = "您的资产处置流程已全部完成!"; SchoolUtility.插入消息中心(ammodel); AM_待办业务 upmodel = new AM_待办业务(); upmodel.处理职务 = "财务人员"; upmodel.处理方式 = "职务"; upmodel.处理人 = "财务人员"; upmodel.流程状态 = "完成"; upmodel.事项名称 = "资产处置-报废"; upmodel.FlowID = model.ID; upmodel.Sort = 0; upmodel.FlowName = upmodel.事项名称; upmodel.通知内容 = "您的资产处置流程已全部完成"; upmodel.发起时间 = DateTime.Now.ToLongDateString(); SchoolUtility.修改待办中心(upmodel); } //else if (model.Sort == 6) //{ // string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 财政部门意见 = '{0}' , 财政部门处理时间 = '{1}' ,财政部门='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.财政部门意见, model.财政部门处理时间, model.财政部门, model.Sort, model.流程状态, model.ID, model.FlowName); // int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); // AM_提醒通知 ammodel = new AM_提醒通知(); // ammodel.发起人 = model.主管部门; // ammodel.发起时间 = DateTime.Now; // ammodel.是否已读 = "否"; // ammodel.通知类型 = "待办事项通知"; // ammodel.通知职务 = "资产管理员"; // ammodel.消息内容 = "您来自" + model.主管部门 + "的资产处置-调拨处理通知!"; // ammodel.消息事项 = "资产处置-调拨"; // ammodel.FlowID = model.ID; // ammodel.处理职务 = "主管部门"; // ammodel.处理方式 = "职务"; // ammodel.处理人 = "主管部门"; // ammodel.FlowName = "资产处置-调拨"; // ammodel.流程状态 = model.流程状态; // ammodel.Sort = model.Sort; // SchoolUtility.插入消息中心(ammodel); // AM_待办业务 dbmodel = new AM_待办业务(); // dbmodel.流程状态 = model.流程状态; // dbmodel.处理职务 = "主管部门"; // dbmodel.处理方式 = "职务"; // dbmodel.处理人 = "主管部门"; // dbmodel.FlowName = model.FlowName; // dbmodel.FlowID = model.ID; // dbmodel.通知内容 = "您来自" + model.主管部门 + "的资产处置-调拨处理,请及时处理!"; // dbmodel.Sort = model.Sort; // SchoolUtility.修改待办中心(dbmodel); //} return(1); } catch (Exception) { return(0); } }
protected void btnok_Click(object sender, EventArgs e) { if (btnok.Text == "确认接收") { string processingtime = DateTime.Now.ToShortDateString(); //处理时间 string username = Session["姓名"].ToString(); //处理人 int flowid = Convert.ToInt32(FlowID.Text); string zcid = 资产ID.Text; AM_资产交接流程表 model = new AM_资产交接流程表(); model.ID = flowid; model.资产ID = zcid; model.Sort = 1; model.是否接收 = "是"; model.接收人 = username; model.流程状态 = "已接收,待确认"; model.接收人接收时间 = DateTime.Now.ToLongDateString(); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "管理员"; ammodel.消息内容 = "已接收,待管理员确认!"; ammodel.消息事项 = "资产交接"; ammodel.发起人 = username;//处理人 ammodel.FlowID = flowid; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "职务"; dbmodel.处理职务 = "资产管理员"; dbmodel.发起人 = username; dbmodel.FlowID = flowid; dbmodel.流程状态 = "已接收,待确认"; dbmodel.通知内容 = username + "的资产交接已接收,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.Sort = 2; School资产借还交接BLL bll = new School资产借还交接BLL(); if (bll.操作资产交接流程(model, ammodel, dbmodel) > 0) { Alert alert = new Alert(); alert.Message = "处理成功"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Success; alert.Show(); Window3.Hidden = true; BindGrid(); return; } else { Alert alert = new Alert(); alert.Message = "处理失败"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Show(); return; } } else if (btnok.Text == "确认通过") { string processingtime = DateTime.Now.ToShortDateString(); //处理时间 string username = Session["姓名"].ToString(); //处理人 int flowid = Convert.ToInt32(FlowID.Text); AM_资产交接流程表 model = new AM_资产交接流程表(); model.ID = flowid; model.管理员是否通过 = "是"; model.管理员通过时间 = processingtime; model.Sort = 2; model.管理员 = username; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "交付人"; ammodel.消息内容 = "您的资产交接流程已全部完成"; ammodel.消息事项 = "资产交接"; ammodel.发起人 = username;//处理人 ammodel.FlowID = flowid; AM_待办业务 dbmodel = new AM_待办业务(); School资产借还交接BLL bll = new School资产借还交接BLL(); dbmodel.处理人 = bll.查询接收人(flowid); dbmodel.处理职务 = "个人"; dbmodel.发起人 = username; dbmodel.流程状态 = "已完成"; dbmodel.事项名称 = "资产交接"; dbmodel.通知内容 = "您的资产交接流程已全部完成"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.Sort = 0; dbmodel.FlowID = flowid; if (bll.操作资产交接流程(model, ammodel, dbmodel) > 0) { Alert alert = new Alert(); alert.Message = "处理成功"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Success; alert.Show(); Window3.Hidden = true; BindGrid(); return; } else { Alert alert = new Alert(); alert.Message = "处理失败"; alert.Title = "提示信息"; alert.MessageBoxIcon = MessageBoxIcon.Error; alert.Show(); return; } } }
public int 添加资产报修(SchoolX_资产报修流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { int sort = 1; try { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO X_资产报修流程表 "); sb.Append(" (流程状态,报修单号,报修人,报修时间,报修地址,故障描述,设备ID,故障照片,Sort,报修人电话"); sb.Append(" ) VALUES( "); sb.Append(" @流程状态,@报修单号,@报修人,@报修时间,@报修地址,@故障描述,@设备ID,@故障照片,@sort,@报修人电话"); sb.Append(")"); sb.Append(" SELECT "); sb.Append(" @@identity "); SqlParameter[] para = { new SqlParameter("@流程状态", model.流程状态), new SqlParameter("@报修单号", model.报修单号), new SqlParameter("@报修人", model.报修人), new SqlParameter("@报修时间", model.报修时间), new SqlParameter("@报修地址", model.报修地址), new SqlParameter("@故障描述", model.故障描述), new SqlParameter("@设备ID", model.设备ID), new SqlParameter("@故障照片", model.故障照片), new SqlParameter("@sort", sort), new SqlParameter("@报修人电话", model.报修人电话), }; int result = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); if (result > 0) { StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", result) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); //DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); StringBuilder dbsb = new StringBuilder(); dbsb.Append("INSERT INTO AM_待办业务 "); dbsb.Append("(流程状态,FlowID,事项名称,通知内容,发起人,发起时间,处理职务,处理方式,FlowName,Sort "); dbsb.Append(" ) VALUES( "); dbsb.Append(" @流程状态,@FlowID,@事项名称,@通知内容,@发起人,@发起时间,@处理职务,@处理方式,@FlowName,@Sort "); dbsb.Append(")"); SqlParameter[] dbpara = { new SqlParameter("@流程状态", dbmodel.流程状态), new SqlParameter("@FlowID", result), new SqlParameter("@事项名称", dbmodel.事项名称), new SqlParameter("@通知内容", dbmodel.通知内容), new SqlParameter("@发起人", dbmodel.发起人), new SqlParameter("@发起时间", dbmodel.发起时间), new SqlParameter("@处理职务", dbmodel.处理职务), new SqlParameter("@处理方式", dbmodel.处理方式), new SqlParameter("@FlowName", dbmodel.FlowName), new SqlParameter("@Sort", dbmodel.Sort) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); return(result); } else { return(0); } } catch (Exception) { return(0); //throw; } }
public int 创建资产交接(AM_资产交接流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.创建资产交接(model, ammodel, dbmodel)); }
public int 操作购置验收流程(SchoolX_购置验收流程表 model, AM_提醒通知 ammodel) { string sql = string.Format("UPDATE X_购置验收流程表 SET 是否同意 ='{0}' ,操作时间 = '{1}' , 操作人 = '{2}',Sort=0 ,流程状态='完成',记账人='{3}' where ID = {4}", model.是否同意, model.操作时间, model.操作人, model.记账人, model.ID); string sqlzc = string.Format("UPDATE 办公设备信息表 SET 是否通过审批='{0}' where X_ID={1}", model.是否同意, model.ID); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = "完成"; dbmodel.通知内容 = "您来自" + model.操作人 + "的购置验收结果通知!"; dbmodel.处理职务 = "财政人员"; dbmodel.处理方式 = "职务"; //dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理人 = "财政人员"; dbmodel.Sort = 0; dbmodel.FlowID = model.ID; dbmodel.事项名称 = "购置验收"; dbmodel.FlowName = dbmodel.事项名称; SchoolUtility.修改待办中心(dbmodel); //StringBuilder dbsb = new StringBuilder(); //dbsb.Append("update AM_待办业务 SET "); //dbsb.Append("流程状态=@流程状态,通知内容=@通知内容,处理人=@处理人,发起时间=@发起时间,处理方式=@处理方式,处理职务=@处理职务,Sort=@Sort WHERE FlowID= " + model.ID + " AND FlowName='资产转移'"); //SqlParameter[] dbpara = { // new SqlParameter("@流程状态",dbmodel.流程状态), // new SqlParameter("@通知内容",dbmodel.通知内容), // new SqlParameter("@处理人",dbmodel.处理人), // new SqlParameter("@发起时间",dbmodel.发起时间), // new SqlParameter("@处理方式",dbmodel.处理方式), // new SqlParameter("@处理职务",dbmodel.处理职务), // new SqlParameter("@Sort",dbmodel.Sort) // }; //DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, dbsb.ToString(), dbpara); StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", ammodel.发起时间), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", ammodel.FlowID) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sqlzc.ToString()); return(DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString())); }
public int 插入X_购置验收流程表(SchoolX_购置验收流程表 model, List <School办公设备信息表> listmodel, AM_提醒通知 ammodel) { try { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO X_购置验收流程表 "); sb.Append(" (流程状态,单据编号,事项名称,备注信息,数量合计,金额合计,申请人,制单日期,供应商,供应商联系方式,合同编号,发票号 "); sb.Append(",取得方式,购置日期,Sort"); sb.Append(" ) VALUES( "); sb.Append(" @流程状态,@单据编号,@事项名称,@备注信息,@数量合计,@金额合计,@申请人,@制单日期,@供应商,@供应商联系方式,@合同编号,@发票号 "); sb.Append(",@取得方式,@购置日期,@Sort"); sb.Append(")"); sb.Append(" SELECT "); sb.Append(" @@identity "); SqlParameter[] para = { new SqlParameter("@流程状态", model.流程状态), new SqlParameter("@单据编号", model.单据编号), new SqlParameter("@事项名称", model.事项名称), new SqlParameter("@备注信息", model.备注信息), new SqlParameter("@数量合计", model.数量合计), new SqlParameter("@金额合计", model.金额合计), new SqlParameter("@申请人", model.申请人), new SqlParameter("@制单日期", model.制单日期), new SqlParameter("@供应商", model.供应商), new SqlParameter("@供应商联系方式", model.供应商联系方式), new SqlParameter("@合同编号", model.合同编号), new SqlParameter("@发票号", model.发票号), new SqlParameter("@取得方式", model.取得方式), new SqlParameter("@购置日期", model.购置日期), new SqlParameter("@Sort", 1), //new SqlParameter("@Sort",model), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); StringBuilder sbtz = new StringBuilder(); sbtz.Append("INSERT INTO AM_提醒通知 "); sbtz.Append("(消息事项,消息内容,发起人,发起时间,通知类型,是否已读,通知职务,FlowID "); sbtz.Append(" ) VALUES( "); sbtz.Append(" @消息事项,@消息内容,@发起人,@发起时间,@通知类型,@是否已读,@通知职务,@FlowID "); sbtz.Append(")"); SqlParameter[] paratz = { new SqlParameter("@消息事项", ammodel.消息事项), new SqlParameter("@消息内容", ammodel.消息内容), new SqlParameter("@发起人", ammodel.发起人), new SqlParameter("@发起时间", model.购置日期), new SqlParameter("@通知类型", ammodel.通知类型), new SqlParameter("@是否已读", ammodel.是否已读), new SqlParameter("@通知职务", ammodel.通知职务), new SqlParameter("@FlowID", num) }; DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sbtz.ToString(), paratz); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理职务 = "财务人员"; dbmodel.发起人 = model.申请人; dbmodel.FlowID = num; dbmodel.流程状态 = model.流程状态; dbmodel.事项名称 = "购置验收"; dbmodel.通知内容 = "您来自" + model.申请人 + "的购置验收/入库-申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理方式 = "职务"; dbmodel.处理人 = "财务人员"; dbmodel.FlowName = "购置验收"; dbmodel.Sort = 1; SchoolUtility.插入待办中心(dbmodel); List <string> cstrlist = new List <string>(); string csqls = ""; string csssqls = ""; if (num > 0) { try { for (int i = 0; i < listmodel.Count; i++) { string part = listmodel[i].str归属部门; csssqls = string.Format(" SELECT * FROM dbo.一级部门表 WHERE 名称= '" + part + "'"); SqlDataReader read = DBHelper.ExecuteReader(DBHelper.ConnectionString, CommandType.Text, csssqls.ToString()); List <School办公设备信息表> list = new List <School办公设备信息表>(); int 归属部门_ID = 0; while (read.Read()) { School办公设备信息表 model_a = new School办公设备信息表(); model_a.ID = Convert.ToInt32(read["ID"].ToString()); 归属部门_ID = model_a.ID; } //int 归属部门_ID = model_a.ID; csqls = string.Format("INSERT INTO 办公设备信息表 (编号,类型,名称,型号,使用方向,数量,价格,归属部门,负责人,存放地点,使用状态,X_ID,是否通过审批,购置日期,二级类别名称,三级类别名称) VALUES('{0}','{1}','{2}','{3}','{4}',{5},{6},{7},'{8}','{9}','{10}',{11},'{12}','{13}','{14}','{15}')", listmodel[i].编号, listmodel[i].一级类别名称, listmodel[i].称, listmodel[i].型号, listmodel[i].使用方向, listmodel[i].数量, listmodel[i].价格, 归属部门_ID, listmodel[i].负责人, listmodel[i].存放地点, listmodel[i].资产状态, num, "否", model.购置日期, listmodel[i].二级类别名称, listmodel[i].级类别名称); cstrlist.Add(csqls.ToString()); } int copyunitcount = DBHelper.ExecuteSqlTran(cstrlist); return(copyunitcount); } catch (Exception) { return(-1);//转换数字出错 throw; } } else { return(0); } } catch (Exception ex) { return(0); //throw; } }
public int 处置申报待报废处理流程(SchoolX_资产处置流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.处置申报待报废处理流程(model, ammodel, dbmodel)); }
public int 创建处置申报资产报废(SchoolX_资产处置流程表 model) { StringBuilder sb = new StringBuilder(); sb.Append("INSERT INTO X_资产处置流程表 "); sb.Append(" (Sort,FlowName,单据编号,流程状态,申请人,事项名称,申报日期,申报单位,SID,总数,总价,职务,原因说明,主管部门 ,主管部门处理时间,主管部门意见,电话,调入单位分管领导,调入单位分管领导处理时间,调入单位分管领导意见,财政部门,财政部门处理时间,财政部门意见"); sb.Append(" ) VALUES( "); sb.Append(" @Sort,@FlowName,@单据编号,@流程状态,@申请人,@事项名称,@申报日期,@申报单位,@SID,@总数,@总价,@职务,@原因说明,@主管部门 ,@主管部门处理时间,@主管部门意见,@电话,@调入单位分管领导,@调入单位分管领导处理时间,@调入单位分管领导意见,@财政部门,@财政部门处理时间,@财政部门意见"); sb.Append(")"); sb.Append(" SELECT "); sb.Append(" @@identity "); SqlParameter[] para = { new SqlParameter("@Sort", model.Sort), new SqlParameter("@FlowName", model.FlowName), new SqlParameter("@单据编号", model.单据编号), new SqlParameter("@流程状态", model.流程状态), new SqlParameter("@申请人", model.申请人), new SqlParameter("事项名称", model.事项名称), new SqlParameter("@申报日期", model.申报日期), new SqlParameter("@申报单位", model.申报单位), new SqlParameter("@SID", model.SID), new SqlParameter("@总数", model.总数), new SqlParameter("@总价", model.总价), new SqlParameter("@职务", model.职务), new SqlParameter("@原因说明", model.原因说明), new SqlParameter("@主管部门", model.主管部门), new SqlParameter("@主管部门处理时间", model.主管部门处理时间), new SqlParameter("@主管部门意见", model.主管部门意见), new SqlParameter("@电话", model.电话), new SqlParameter("@调入单位分管领导", model.调入单位分管领导), new SqlParameter("@调入单位分管领导处理时间", model.调入单位分管领导处理时间), new SqlParameter("@调入单位分管领导意见", model.调入单位分管领导意见), new SqlParameter("@财政部门", model.财政部门), new SqlParameter("@财政部门处理时间", model.财政部门处理时间), new SqlParameter("@财政部门意见", model.财政部门意见), }; int num = Convert.ToInt32(DBHelper.ExecuteScalar(DBHelper.ConnectionString, CommandType.Text, sb.ToString(), para)); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.申请人; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "分管领导"; ammodel.消息内容 = "您来自" + model.申请人 + "的资产处置-调拨申请通知!"; ammodel.消息事项 = "资产处置-报废"; ammodel.FlowID = num; ammodel.处理职务 = "分管领导"; ammodel.处理方式 = "职务"; ammodel.处理人 = "分管领导"; ammodel.FlowName = "资产处置"; ammodel.流程状态 = model.流程状态; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理职务 = "分管领导"; dbmodel.发起人 = model.申请人; dbmodel.FlowID = num; dbmodel.流程状态 = model.流程状态; dbmodel.事项名称 = "资产处置-报废"; dbmodel.通知内容 = "您来自" + model.申请人 + "的资产处置-报废申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理方式 = "职务"; dbmodel.处理人 = "分管领导"; dbmodel.FlowName = "资产处置-报废"; dbmodel.Sort = model.Sort; SchoolUtility.插入待办中心(dbmodel); return(num); }
protected void Button1_Click(object sender, EventArgs e) { //获取原存放地 string sid = ""; List <int> inlist = new List <int>(); int 总数 = 0; int 总价 = 0; //获取grid3选中行数据 int[] selections = Grid3.SelectedRowIndexArray; List <SchoolX_资产转移改动信息表> listmodel = new List <SchoolX_资产转移改动信息表>(); foreach (int rowIndex in selections) { SchoolX_资产转移改动信息表 modelx = new SchoolX_资产转移改动信息表(); int ID = Convert.ToInt32(Grid3.DataKeys[rowIndex][0]); modelx.原存放地点 = Grid3.DataKeys[rowIndex][1].ToString(); modelx.原归属部门 = Grid3.DataKeys[rowIndex][2].ToString(); modelx.原负责人 = Grid3.DataKeys[rowIndex][3].ToString(); sid += ID.ToString() + ","; inlist.Add(ID); listmodel.Add(modelx); //sb.AppendFormat("行号:{0} 用户名:{1}<br />", rowIndex + 1, Grid1.DataKeys[rowIndex][1]); } List <School办公设备信息表> listdata = bll.资产转移确定设备(inlist); foreach (School办公设备信息表 itemjj in listdata) { 总数 += itemjj.数量; 总价 += Convert.ToInt32(itemjj.价格); } SchoolX_资产转移流程表 model = new SchoolX_资产转移流程表(); model.流程状态 = 流程状态.Text; model.单据编号 = 单据编号.Text; model.事项名称 = 事项名称.Text; model.申请人 = 申请人.Text; model.申请日期 = 申请日期.Text; model.联系方式 = 联系方式.Text; model.存放地点变更为 = 存放地点变更为.SelectedItem.Text; model.归属部门变更为 = 归属部门变更为.SelectedItem.Text; model.负责人变更为 = 负责人变更为.SelectedItem.Text; model.备注信息 = 备注.Text; model.S_ID = sid; model.总数 = 总数; model.总价 = 总价; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.发起人 = model.申请人; ammodel.消息内容 = "您来自" + ammodel.发起人 + "的资产交接申请,请及时处理!"; ammodel.消息事项 = "资产转移"; ammodel.是否已读 = "否"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "职务"; dbmodel.处理职务 = "资产管理员"; dbmodel.流程状态 = 流程状态.Text; dbmodel.事项名称 = model.事项名称; dbmodel.FlowName = "资产转移"; dbmodel.发起人 = model.申请人; dbmodel.通知内容 = "您来自" + dbmodel.发起人 + "的资产交接申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.Sort = 1; if (model.存放地点变更为 == "" || model.存放地点变更为 == null || model.归属部门变更为 == "" || model.归属部门变更为 == null || model.负责人变更为 == "" || model.负责人变更为 == "请选择") { Alert.ShowInTop("请将信息填写完整!", "提示信息", MessageBoxIcon.Warning); return; } else { int result = bll.upzczy(model, inlist, listmodel, ammodel, dbmodel); if (result > 0) { Alert.ShowInTop("提交成功!", "提示信息", MessageBoxIcon.Information); Window1.Hidden = true; DataSet ds = bll.首页_X_资产转移流程表("流程状态-全部"); DataTable dt = ds.Tables[0].Copy();//复制一份table DataTable source = dt; // 3.绑定到Grid Grid1.DataSource = dt;//DataTable Grid1.DataBind(); return; } } }
public int upzczy(SchoolX_资产转移流程表 model, List <int> listid, List <SchoolX_资产转移改动信息表> listmodel, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.upzczy(model, listid, listmodel, ammodel, dbmodel)); }
public int 调拨流程处理(SchoolX_资产处置流程表 model) { if (model.Sort == 2)//分管领导处理 { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 调出单位分管领导意见 = '{0}' , 调出单位分管领导 = '{1}' ,调出单位分管领导处理时间='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.调出单位分管领导意见, model.调出单位分管领导, model.调出单位分管领导处理时间, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.调出单位分管领导; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.消息内容 = "您来自" + model.调出单位分管领导 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "资产管理员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "资产管理员"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.通知内容 = "您来自" + model.调出单位分管领导 + "的资产处置-调拨处理,请及时处理!"; dbmodel.处理职务 = "资产管理员"; dbmodel.处理方式 = "职务"; //dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理人 = "资产管理员"; dbmodel.Sort = model.Sort; dbmodel.FlowID = model.ID; dbmodel.事项名称 = "资产处置-调拨"; dbmodel.FlowName = dbmodel.事项名称; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 3) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 调入单位管理员意见 = '{0}' , 调入单位管理员 = '{1}' ,调入单位管理员处理时间='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.调入单位管理员意见, model.调入单位管理员, model.调入单位管理员处理时间, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.调入单位管理员; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.消息内容 = "您来自" + model.调入单位管理员 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "分管领导"; ammodel.处理方式 = "职务"; ammodel.处理人 = "分管领导"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.通知内容 = "您来自" + model.调入单位管理员 + "的资产处置-调拨处理,请及时处理!"; dbmodel.处理职务 = "分管领导"; dbmodel.处理方式 = "职务"; //dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理人 = "分管领导"; dbmodel.Sort = model.Sort; dbmodel.FlowID = model.ID; dbmodel.事项名称 = "资产处置-调拨"; dbmodel.FlowName = dbmodel.事项名称; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 4) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 调入单位分管领导意见 = '{0}' , 调入单位分管领导 = '{1}' ,调入单位分管领导处理时间='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.调入单位分管领导意见, model.调入单位分管领导, model.调入单位分管领导处理时间, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.调入单位分管领导; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.消息内容 = "您来自" + model.调入单位分管领导 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "主管部门"; ammodel.处理方式 = "职务"; ammodel.处理人 = "主管部门"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.通知内容 = "您来自" + model.调入单位分管领导 + "的资产处置-调拨处理,请及时处理!"; dbmodel.处理职务 = "主管部门"; dbmodel.处理方式 = "职务"; //dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理人 = "主管部门"; dbmodel.Sort = model.Sort; dbmodel.FlowID = model.ID; dbmodel.事项名称 = "资产处置-调拨"; dbmodel.FlowName = model.FlowName; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 5) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 主管部门意见 = '{0}' , 主管部门处理时间 = '{1}' ,主管部门='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.主管部门意见, model.主管部门处理时间, model.主管部门, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.主管部门; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "主管部门"; ammodel.消息内容 = "您来自" + model.主管部门 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "财务人员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "财务人员"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.通知内容 = "您来自" + model.主管部门 + "的资产处置-调拨处理,请及时处理!"; dbmodel.处理职务 = "财务人员"; dbmodel.处理方式 = "职务"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.处理人 = "财务人员"; dbmodel.Sort = model.Sort; dbmodel.FlowID = model.ID; dbmodel.事项名称 = "资产处置-调拨"; dbmodel.FlowName = model.FlowName; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 6) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 财政部门意见 = '{0}' , 财政部门处理时间 = '{1}' ,财政部门='{2}' ,Sort = {3} ,流程状态='{4}' where ID = {5} and FlowName='{6}'", model.财政部门意见, model.财政部门处理时间, model.财政部门, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.财政部门; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "财政部门"; ammodel.消息内容 = "您来自" + model.财政部门 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "资产管理员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "资产管理员"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); /* * AM_待办业务 upmodel = new AM_待办业务(); * 1 upmodel.流程状态 = "分管领导已通过,待主管部门审核"; * 1 upmodel.通知内容 = "您来自" + model.调入单位分管领导 + "的资产处置报废申请分管领导已通过,请及时处理!"; * 1 upmodel.处理职务 = "主管部门"; * 1 upmodel.处理方式 = "职务"; * upmodel.发起时间 = DateTime.Now.ToLongDateString(); * 1 upmodel.处理人 = "主管部门"; * 1 upmodel.Sort = 2; * 1 upmodel.FlowID = model.ID; * upmodel.事项名称 = "资产处置-报废"; * 1 upmodel.FlowName = upmodel.事项名称; * SchoolUtility.修改待办中心(upmodel); */ AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.处理职务 = "资产管理员"; dbmodel.处理方式 = "职务"; dbmodel.处理人 = "资产管理员"; dbmodel.FlowName = model.FlowName; dbmodel.FlowID = model.ID; dbmodel.通知内容 = "您来自" + model.财政部门 + "的资产处置-调拨处理,请及时处理!"; dbmodel.Sort = model.Sort; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 7) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 调出单位管理员处理时间 = '{0}' ,调出单位管理员='{1}' ,Sort = {2} ,流程状态='{3}' where ID = {4} and FlowName='{5}'", model.调出单位管理员处理时间, model.调出单位管理员, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.调出单位管理员; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.消息内容 = "您来自" + model.调出单位管理员 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "资产管理员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "资产管理员"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.处理职务 = "资产管理员"; dbmodel.处理方式 = "职务"; dbmodel.处理人 = "资产管理员"; dbmodel.FlowName = model.FlowName; dbmodel.FlowID = model.ID; dbmodel.通知内容 = "您来自" + model.调出单位管理员 + "的资产处置-调拨处理,请及时处理!"; dbmodel.Sort = model.Sort; SchoolUtility.修改待办中心(dbmodel); return(result); } else if (model.Sort == 0) { string sql = string.Format("UPDATE dbo.X_资产处置流程表 set 调入单位管理员确认处理时间 = '{0}' ,调入单位管理员确认='{1}' ,Sort = {2} ,流程状态='{3}' where ID = {4} and FlowName='{5}'", model.调入单位管理员确认处理时间, model.调入单位管理员确认, model.Sort, model.流程状态, model.ID, model.FlowName); int result = DBHelper.ExecuteNonQuery(DBHelper.ConnectionString, CommandType.Text, sql.ToString()); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = model.调入单位管理员确认; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "资产管理员"; ammodel.消息内容 = "您来自" + model.调入单位管理员确认 + "的资产处置-调拨处理通知!"; ammodel.消息事项 = "资产处置-调拨"; ammodel.FlowID = model.ID; ammodel.处理职务 = "调入单位管理员"; ammodel.处理方式 = "职务"; ammodel.处理人 = "调入单位管理员"; ammodel.FlowName = "资产处置-调拨"; ammodel.流程状态 = model.流程状态; ammodel.Sort = model.Sort; SchoolUtility.插入消息中心(ammodel); AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.流程状态 = model.流程状态; dbmodel.处理职务 = "调入单位管理员"; dbmodel.处理方式 = "职务"; dbmodel.处理人 = "调入单位管理员"; dbmodel.FlowName = model.FlowName; dbmodel.FlowID = model.ID; dbmodel.通知内容 = "您来自" + model.调入单位管理员确认 + "的资产处置-调拨处理,请及时处理!"; dbmodel.Sort = model.Sort; SchoolUtility.修改待办中心(dbmodel); return(result); } else { return(0); } }
public int 报修结算(int id, SchoolX_资产报修流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.报修结算(id, model, ammodel, dbmodel)); }
protected void Button1_Click(object sender, EventArgs e) { if (Grid2.GetMergedData().Count == 0) { Alert.ShowInTop("请选择!", "提示信息", MessageBoxIcon.Warning); return; } SchoolX_原值变动流程表 model = new SchoolX_原值变动流程表(); model.流程状态 = 流程状态.Text; model.单据编号 = 单据编号.Text; model.事项名称 = 事项名称.Text; model.申请人 = 申请人.Text; model.申请日期 = 申请日期.Text; model.记账人 = 记账人.Text; model.变动方式 = 变动方式.SelectedText; model.变动原因 = 变动原因.Text; model.记账人意见 = 记账人意见.Text; model.备注 = 备注.Text; double dj = 0; List <School办公设备信息表> listbg = new List <School办公设备信息表>(); string sbid = ""; string bdje = ""; JArray mergedData = Grid2.GetMergedData(); foreach (JObject mergedRow in mergedData) { JObject values = mergedRow.Value <JObject>("values"); School办公设备信息表 bgmo = new School办公设备信息表(); bgmo.ID = (Convert.ToInt32(values.Value <string>("ID"))); sbid += values.Value <string>("ID").ToString() + ","; try { dj += Convert.ToDouble(values.Value <string>("价格")); bgmo.变动金额 = (Convert.ToDouble(values.Value <string>("变动金额"))); if (bgmo.变动金额 < 1) { Alert.ShowInTop("请输入变动金额!", "提示信息", MessageBoxIcon.Warning); return; } bdje += values.Value <string>("变动金额").ToString() + ","; } catch (Exception) { //没填写 Alert.ShowInTop("请填写变动金额!", "提示信息", MessageBoxIcon.Warning); return; } listbg.Add(bgmo); } model.str变动金额 = bdje; model.资产ID = sbid; model.总价 = dj; model.总数 = Grid2.GetMergedData().Count; this.Label4.Text = "数量合计:" + Grid2.GetMergedData().Count + "---金额合计:" + dj + "元"; AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起人 = 申请人.Text; ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "财务人员"; ammodel.消息内容 = "您来自" + 申请人.Text + "的原值变动申请通知!"; ammodel.消息事项 = "购置验收"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理职务 = "财务人员"; dbmodel.发起人 = 申请人.Text; dbmodel.流程状态 = 流程状态.Text; dbmodel.事项名称 = "购置验收"; dbmodel.通知内容 = "您来自" + 申请人.Text + "的原值变动申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); //插入数据库 if (bll.新增原值变动(model, listbg, ammodel, dbmodel) > 0) { Window1.Hidden = true; Alert.ShowInTop("创建成功!"); //return; BindGrid(); } }
public int 操作资产交接流程(AM_资产交接流程表 model, AM_提醒通知 ammodel, AM_待办业务 dbmodel) { return(sql.操作资产交接流程(model, ammodel, dbmodel)); }
protected void Button2_Click(object sender, EventArgs e) { AM_资产交接流程表 model = new AM_资产交接流程表(); if (Grid2.Rows.Count == 0) { Alert.ShowInTop("请先添加资产!", "提示信息", MessageBoxIcon.Warning); return; } if (接收人List.SelectedText == "" || 接收人List.SelectedText == null) { Alert.ShowInTop("请先添加接收人!", "提示信息", MessageBoxIcon.Warning); return; } model.Sort = 1; model.流程状态 = 流程状态.Text; model.接收人 = 接收人List.SelectedText; model.备注信息 = 备注信息.Text; OffSession(); model.交付人 = Session["姓名"].ToString(); model.发起人 = Session["姓名"].ToString(); model.单据编号 = 单据编号.Text; DateTime dt = Convert.ToDateTime(提交时间.SelectedDate); string sd = 提交时间.Text; model.提交时间 = 提交时间.Text; DateTime dd = Convert.ToDateTime(完成时间.SelectedDate); model.完成时间 = 完成时间.Text; model.接收人 = 接收人List.SelectedText; int[] selections = Grid4.SelectedRowIndexArray; int i = 0; foreach (int rowIndex in selections) { int ID = Convert.ToInt32(Grid4.DataKeys[rowIndex][0]); string xxx = Grid4.DataKeys[rowIndex][0].ToString(); model.资产ID += ID.ToString() + ","; i++; } model.资产数量 = i.ToString();; School资产借还交接BLL bll = new School资产借还交接BLL(); AM_提醒通知 ammodel = new AM_提醒通知(); ammodel.发起时间 = DateTime.Now; ammodel.是否已读 = "否"; ammodel.通知类型 = "待办事项通知"; ammodel.通知职务 = "财务人员"; ammodel.发起人 = Session["姓名"].ToString(); ammodel.消息内容 = "您来自" + ammodel.发起人 + "的资产交接申请,请及时处理!"; ammodel.消息事项 = "资产交接"; ammodel.是否已读 = "否"; AM_待办业务 dbmodel = new AM_待办业务(); dbmodel.处理方式 = "个人"; dbmodel.处理人 = model.接收人; dbmodel.流程状态 = 流程状态.Text; dbmodel.事项名称 = "资产交接"; dbmodel.FlowName = "资产交接"; dbmodel.发起人 = Session["姓名"].ToString(); dbmodel.通知内容 = "您来自" + dbmodel.发起人 + "的资产交接申请,请及时处理!"; dbmodel.发起时间 = DateTime.Now.ToLongDateString(); dbmodel.Sort = 1; if (bll.创建资产交接(model, ammodel, dbmodel) > 0) { Window1.Hidden = true; Alert.ShowInTop("创建成功!"); } BindGrid(); }