You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
5.8 KiB
Plaintext

using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using BP.DA;
using BP.Sys;
using BP.Web;
using BP.Port;
using BP.En;
using BP.WF;
using BP.WF.Template;
using BP.Difference;
using System.Collections;
namespace BP.WF.HttpHandler
{
/// <summary>
/// 页面功能实体
/// </summary>
public class CCMobilePortal_SaaS : BP.WF.HttpHandler.DirectoryPageBase
{
/// <summary>
/// 构造函数
/// </summary>
public CCMobilePortal_SaaS()
{
BP.Web.WebUser.SheBei = "Mobile";
}
#region 界面 .
public string Home_Init()
{
Hashtable ht = new Hashtable();
ht.Add("UserNo", BP.Web.WebUser.No);
ht.Add("UserName", BP.Web.WebUser.Name);
//系统名称.
ht.Add("SysName", SystemConfig.SysName);
ht.Add("CustomerName", SystemConfig.CustomerName);
ht.Add("Todolist_EmpWorks", BP.WF.Dev2Interface.Todolist_EmpWorks);
ht.Add("Todolist_Runing", BP.WF.Dev2Interface.Todolist_Runing);
ht.Add("Todolist_Complete", BP.WF.Dev2Interface.Todolist_Complete);
ht.Add("Todolist_CCWorks", BP.WF.Dev2Interface.Todolist_CCWorks);
ht.Add("Todolist_HuiQian", BP.WF.Dev2Interface.Todolist_HuiQian); //会签数量.
ht.Add("Todolist_Drafts", BP.WF.Dev2Interface.Todolist_Draft); //会签数量.
return BP.Tools.Json.ToJsonEntityModel(ht);
}
/// <summary>
/// 获取当前用户 待处理,已处理,抄送给的消息
/// </summary>
/// <returns></returns>
public string GetGenerWorks()
{
DataSet ds = new DataSet();
//待办列表
DataTable dt = BP.WF.Dev2Interface.DB_GenerEmpWorksOfDataTable(WebUser.No, 0);
dt.TableName = "Todolist";
ds.Tables.Add(dt);
//获取审批过未完成的
dt = new DataTable();
dt = BP.WF.Dev2Interface.DB_GenerRuning(WebUser.No);
dt.TableName = "Running";
ds.Tables.Add(dt);
//获取完成的
dt = new DataTable();
dt = BP.WF.Dev2Interface.DB_GenerRuning(WebUser.No);
dt.TableName = "Complte";
ds.Tables.Add(dt);
//获取抄送当前登陆人的列表
dt = new DataTable();
dt = BP.WF.Dev2Interface.DB_CCList();
dt.TableName = "CC";
ds.Tables.Add(dt);
//返回json格式
return BP.Tools.Json.DataSetToJson(ds);
}
/// <summary>
/// 获取用户下的组织
/// </summary>
/// <returns></returns>
public string User_OrgNos()
{
string userId = this.GetRequestVal("UserID");
if (DataType.IsNullOrEmpty(userId) == true)
return "err@请输入用户的登录账号";
string sql = " SELECT A.OrgNo as No,B.Name,B.OrgSta From Port_Emp A ,Port_Org B Where A.OrgNo=B.No AND UserID=" + SystemConfig.AppCenterDBVarStr + "UserID";
Paras ps = new Paras();
ps.Add("UserID", userId);
DataTable dt = DBAccess.RunSQLReturnTable(sql, ps);
if (dt.Rows.Count == 0)
return "err@账号输入错误或者该用户已经被禁用";
return BP.Tools.Json.ToJson(dt);
}
public string User_ChangeOrg()
{
string userId = this.GetRequestVal("UserID");
if (DataType.IsNullOrEmpty(userId) == true)
return "err@请输入用户的登录账号";
if (DataType.IsNullOrEmpty(this.OrgNo) == true)
return "err@组织编号不能为空";
BP.WF.Dev2Interface.Port_Login(userId, this.OrgNo);
return "切换成功";
}
public string Home_Near()
{
string sql = "";
int top = GetRequestValInt("Top");
if (top == 0) top = 8;
switch (BP.Difference.SystemConfig.AppCenterDBType)
{
case DBType.MSSQL:
sql = " SELECT TOP " + top + " FK_Flow,FlowName,F.Icon FROM WF_GenerWorkFlow G ,WF_Flow F WHERE F.No=G.FK_Flow AND Starter='" + WebUser.No + "' GROUP BY FK_Flow,FlowName,ICON ORDER By Max(SendDT) DESC";
break;
case DBType.MySQL:
case DBType.PostgreSQL:
case DBType.UX:
sql = " SELECT DISTINCT FK_Flow,FlowName,F.Icon FROM WF_GenerWorkFlow G ,WF_Flow F WHERE F.No=G.FK_Flow AND Starter='" + WebUser.No + "' Order By SendDT limit " + top;
break;
case DBType.Oracle:
case DBType.DM:
case DBType.KingBaseR3:
case DBType.KingBaseR6:
sql = " SELECT * From (SELECT DISTINCT FK_Flow as \"FK_Flow\",FlowName as \"FlowName\",F.Icon ,max(SendDT) SendDT FROM WF_GenerWorkFlow G ,WF_Flow F WHERE F.No=G.FK_Flow AND Starter='" + WebUser.No + "' GROUP BY FK_Flow,FlowName,ICON Order By SendDT) WHERE rownum <=" + top;
break;
default:
throw new Exception("err@系统暂时还未开发使用" + BP.Difference.SystemConfig.AppCenterDBType + "数据库");
}
DataTable dt = DBAccess.RunSQLReturnTable(sql);
return BP.Tools.Json.ToJson(dt);
}
public string Student_JiaoNaXueFei()
{
string no = this.GetRequestVal("No");
string name = this.GetRequestVal("Name");
string note = this.GetRequestVal("Note");
var jine = this.GetRequestValFloat("JinE");
return "学费缴纳成功[" + no + "][" + name + "][" + note + "][" + jine + "]";
}
#endregion 界面方法.
}
}