12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using QWPlatform.IService;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using PMS.EntityModels.SysManager;
- namespace PMS.DBService.SysManager
- {
- public class XTJSDBService : DataServiceBase
- {
- //实例化数据库
- public DataServiceBase dataservice = new DataServiceBase();
- /// <summary>
- /// 删除系统角色
- /// </summary>
- public void RoleDel(int id)
- {
- this.DeleteBulider.Delete("系统角色")
- .Where("ID", id).Execute();
- }
- /// <summary>
- /// 通过id查询系统角色信息
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public DataTable GetSystemRoleInfo(int id)
- {
- var dt = this.SelectBuilder.From("系统角色")
- .Columns("*").Where("ID", id)
- .Select();
- return dt;
- }
- /// <summary>
- /// 修改,新增系统角色
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public string SaveRoleInfo(XTJSModel model,int type_in)
- {
- // procedure B_系统角色_Edit
- //(
- //Id_in in 系统角色.ID % type,
- //Bz_in in 系统角色.备注 % type,
- //Mc_in in 系统角色.名称 % type,
- //Qy_in in 系统角色.启用 % type,
- //Xh_in in 系统角色.序号 % type,
- //MR_in in 系统角色.默认 % type,
- //GK_in in 系统角色.公开 % type,
- //类型_in in number, --新增 0 修改 1
- //Result_out out varchar2
- //);
- var result = this.ProcedureBuilder.Procedure("B_基础管理_系统角色.B_系统角色_Edit")
- .Paramter("Id_in", model.ID)
- .Paramter("Bz_in", model.BZ)
- .Paramter("Mc_in", model.MC)
- .Paramter("Qy_in", model.QY)
- .Paramter("Xh_in", model.XH)
- .Paramter("MR_in",model.MR)
- .Paramter("GK_in",model.GK)
- .Paramter("XMSQ_in", model.XMSQ)
- .Paramter("JGSQ_in", model.JGSQ)
- .Paramter("类型_in", type_in)
- .ParamterOut("Result_out", DbType.String, 400);
- result.Execute();
- return result.ParameterValue<string>("Result_out");
- }
- /// <summary>
- /// 获取最大序列号值
- /// </summary>
- /// <returns></returns>
- public string RoleXh()
- {
- string sql = "select 序号 from(select 序号 from 系统角色 order by 序号 desc) where rownum = 1 ";
- return this.SqlBuilder.SqlText(sql).Select<string>();
- }
- /// <summary>
- /// 判断输入的系统角色是否重复并提示
- /// </summary>
- /// <param name="name"></param>
- /// <returns></returns>
- public string RoleNameCheck(string name)
- {
- var result = this.ProcedureBuilder.Procedure("B_基础管理_系统角色.B_系统角色_RoleNameCheck")
- .Paramter("Name_in", name)
- .ParamterOut("Result_out", DbType.String, 400);
- result.Execute();
- return result.ParameterValue<string>("Result_out");
- }
- }
- }
|