/// <summary> /// 计算两个时间点. /// </summary> /// <param name="sa"></param> /// <param name="nd"></param> private void InitDT(SelectAccper sa, Node nd) { //计算上一个时间的发送点. if (this.LastTimeDot == null) { Paras ps = new Paras(); ps.SQL = "SELECT SDT FROM WF_GenerWorkerlist WHERE WorkID=" + ps.DBStr + "WorkID AND FK_Node=" + ps.DBStr + "FK_Node"; ps.Add("WorkID", this.HisCurrWorkNode.WorkID); ps.Add("FK_Node", nd.NodeID); DataTable dt = DBAccess.RunSQLReturnTable(ps); foreach (DataRow dr in dt.Rows) { this.LastTimeDot = dr[0].ToString(); break; } } //上一个节点的发送时间点或者 到期的时间点,就是当前节点的接受任务的时间。 sa.PlanADT = this.LastTimeDot; //计算当前节点的应该完成日期。 DateTime dtOfShould = Glo.AddDayHoursSpan(this.LastTimeDot, nd.TimeLimit, nd.TimeLimitHH, nd.TimeLimitMM, nd.TWay); sa.PlanSDT = dtOfShould.ToString(DataType.SysDatatimeFormatCN); //给最后的时间点复制. this.LastTimeDot = sa.PlanSDT; }
public string ActiveDDL_Init() { DataSet ds = new DataSet(); //加载外键字段. Paras ps = new Paras(); ps.SQL = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData=" + SystemConfig.AppCenterDBVarStr + "FK_MapData AND KeyOfEn!=" + SystemConfig.AppCenterDBVarStr + "KeyOfEn"; ps.Add("FK_MapData", this.FK_MapData); ps.Add("KeyOfEn", this.KeyOfEn); //var sql = "SELECT KeyOfEn AS No, Name FROM Sys_MapAttr WHERE UIContralType=1 AND FK_MapData='" + this.FK_MapData + "' AND KeyOfEn!='" + this.KeyOfEn + "'"; DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps); dt.TableName = "Sys_MapAttr"; dt.Columns[0].ColumnName = "No"; dt.Columns[1].ColumnName = "Name"; ds.Tables.Add(dt); if (dt.Rows.Count == 0) { return("err@表单中没有要级联的下拉框."); } //加载数据源. SFDBSrcs srcs = new SFDBSrcs(); srcs.RetrieveAll(); DataTable dtSrc = srcs.ToDataTableField(); dtSrc.TableName = "Sys_SFDBSrc"; ds.Tables.Add(dtSrc); // 加载mapext 数据. MapExt me = new MapExt(); int i = me.Retrieve(MapExtAttr.ExtType, MapExtXmlList.ActiveDDL, MapExtAttr.FK_MapData, this.FK_MapData, MapExtAttr.AttrOfOper, this.KeyOfEn); if (i == 0) { me.FK_MapData = this.FK_MapData; me.AttrOfOper = this.KeyOfEn; me.FK_DBSrc = "local"; } if (me.FK_DBSrc == "") { me.FK_DBSrc = "local"; } //去掉 ' 号. me.SetValByKey("Doc", me.Doc); dt = me.ToDataTableField(); dt.TableName = "Sys_MapExt"; ds.Tables.Add(dt); return(BP.Tools.Json.ToJson(ds)); }
/// <summary> /// 初始化正则表达式界面 /// </summary> /// <returns></returns> public string RegularExpression_Init() { DataSet ds = new DataSet(); Paras ps = new Paras(); ps.SQL = "SELECT * FROM Sys_MapExt WHERE AttrOfOper=" + SystemConfig.AppCenterDBVarStr + "AttrOfOper AND FK_MapData=" + SystemConfig.AppCenterDBVarStr + "FK_MapData"; ps.Add("AttrOfOper", this.KeyOfEn); ps.Add("FK_MapData", this.FK_MapData); DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps); dt.TableName = "Sys_MapExt"; ds.Tables.Add(dt); BP.Sys.XML.RegularExpressions res = new BP.Sys.XML.RegularExpressions(); res.RetrieveAll(); DataTable myDT = res.ToDataTable(); myDT.TableName = "RE"; ds.Tables.Add(myDT); BP.Sys.XML.RegularExpressionDtls dtls = new BP.Sys.XML.RegularExpressionDtls(); dtls.RetrieveAll(); DataTable myDTDtls = dtls.ToDataTable(); myDTDtls.TableName = "REDtl"; ds.Tables.Add(myDTDtls); return(BP.Tools.Json.ToJson(ds)); }
/// <summary> /// 执行保存. /// </summary> public void Save() { FrmRpt rpt = new FrmRpt(this.EnsName); DataTable dtCol = BP.DA.DBAccess.RunSQLReturnTable(rpt.SQLOfColumn); DataTable dtRow = BP.DA.DBAccess.RunSQLReturnTable(rpt.SQLOfRow); BP.DA.DBAccess.RunSQL("DELETE " + rpt.PTable + " WHERE RefOID=" + this.RefPKVal); Paras ps = new Paras(); ps.SQL = "INSERT INTO " + rpt.PTable + " ()VALUES()"; foreach (DataRow drCol in dtCol.Rows) { string col = drCol[0].ToString(); foreach (DataRow drRow in dtRow.Rows) { ps.Clear(); string row = drRow[0].ToString(); string val = this.Pub1.GetTextBoxByID("TB_" + col + "" + row).Text; ps.Add("Col", col); ps.Add("Row", col); ps.Add("Val", decimal.Parse(val)); ps.Add("MyPK", col + "_" + row + "_" + this.RefPKVal); BP.DA.DBAccess.RunSQL(ps); } } }
protected void Page_Load(object sender, EventArgs e) { string sql = ""; Paras ps = new Paras(); string dbstr = BP.SystemConfig.AppCenterDBVarStr; switch (this.Request.QueryString["DoType"]) { case "DelDraft": BP.Sys.MapData md = new BP.Sys.MapData("ND" + this.FK_Node); sql = "SELECT count(*) FROM " + md.PTable + " WHERE Rec=" + dbstr + "Rec AND OID=" + dbstr + "OID"; ps.SQL = sql; ps.Add("Rec", BP.Web.WebUser.No); ps.Add("OID", this.WorkID); if (DBAccess.RunSQLReturnValInt(ps) == 0) { throw new Exception("非法的用户删除草稿."); } sql = "DELETE FROM ND" + this.FK_Node + " WHERE Rec=" + dbstr + "Rec AND OID=" + dbstr + "OID"; ps.SQL = sql; DBAccess.RunSQL(ps); this.WinClose(); break; default: break; } }
/// <summary> /// 获取一个操作人员对于一个系统的权限 /// </summary> /// <param name="userNo">用户编号</param> /// <param name="app">系统编号</param> /// <returns>结果集</returns> public static DataTable DB_Menus(string userNo, string app) { Paras ps = new Paras(); ps.SQL = "SELECT * FROM GPM_EmpMenu WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp AND FK_App=" + SystemConfig.AppCenterDBVarStr + "FK_App "; ps.Add("FK_Emp", userNo); ps.Add("FK_App", app); return(DBAccess.RunSQLReturnTable(ps)); }
/// <summary> /// 取出Map 的扩展属性。 /// 用于第3方的扩展属性开发。 /// </summary> /// <param name="key">属性Key</param> /// <returns>设置的属性</returns> public string GetMapExtAttrByKey(string key) { Paras ps = new Paras(); ps.Add("enName", this.ToString()); ps.Add("key", key); return((string)DBAccess.RunSQLReturnVal("select attrValue from Sys_ExtMap WHERE className=" + SystemConfig.AppCenterDBVarStr + "enName AND attrKey=" + SystemConfig.AppCenterDBVarStr + "key", ps)); }
/// 查看某一用户的评论. public string FlowBBS_Check() { Paras pss = new Paras(); pss.SQL = "SELECT * FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE ActionType=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "ActionType AND WorkID=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "WorkID AND EMPFROMT='" + this.UserName + "'"; pss.Add("ActionType", (int)BP.WF.ActionType.FlowBBS); pss.Add("WorkID", this.WorkID); return(BP.Tools.Json.ToJson(BP.DA.DBAccess.RunSQLReturnTable(pss))); }
/// <summary> /// 设置SID /// </summary> /// <param name="sid"></param> public static void SetSID(string sid) { Paras ps = new Paras(); ps.SQL = "UPDATE Port_Emp SET SID=" + SystemConfig.AppCenterDBVarStr + "SID WHERE No=" + SystemConfig.AppCenterDBVarStr + "No"; ps.Add("SID", sid); ps.Add("No", WebUser.No); BP.DA.DBAccess.RunSQL(ps); WebUser.SID = sid; }
/// <summary> /// 获得发起的BBS评论. /// </summary> /// <returns></returns> public string FlowBBSList() { Paras ps = new Paras(); ps.SQL = "SELECT * FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE ActionType=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "ActionType AND WorkID=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "WorkID"; ps.Add("ActionType", (int)BP.WF.ActionType.FlowBBS); ps.Add("WorkID", this.WorkID); //转化成json return(BP.Tools.Json.ToJson(BP.DA.DBAccess.RunSQLReturnTable(ps))); }
/// <summary> /// 统计评论条数. /// </summary> /// <returns></returns> public string FlowBBS_Count() { Paras ps = new Paras(); ps.SQL = "SELECT COUNT(ActionType) FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE ActionType=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "ActionType AND WorkID=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "WorkID"; ps.Add("ActionType", (int)BP.WF.ActionType.FlowBBS); ps.Add("WorkID", this.WorkID); string count = BP.DA.DBAccess.RunSQLReturnValInt(ps).ToString(); return(count); }
/// <summary> /// 重新产生标题,根据新的规则. /// </summary> public string DoGenerTitle() { if (WebUser.No != "admin") { return("非admin用户不能执行。"); } Flow fl = new Flow(this.No); Node nd = fl.HisStartNode; Works wks = nd.HisWorks; wks.RetrieveAllFromDBSource(WorkAttr.Rec); string table = nd.HisWork.EnMap.PhysicsTable; string tableRpt = "ND" + int.Parse(this.No) + "Rpt"; Sys.MapData md = new Sys.MapData(tableRpt); foreach (Work wk in wks) { if (wk.Rec != WebUser.No) { BP.Web.WebUser.Exit(); try { Emp emp = new Emp(wk.Rec); BP.Web.WebUser.SignInOfGener(emp); } catch { continue; } } string sql = ""; string title = WorkNode.GenerTitle(fl, wk); Paras ps = new Paras(); ps.Add("Title", title); ps.Add("OID", wk.OID); ps.SQL = "UPDATE " + table + " SET Title=" + SystemConfig.AppCenterDBVarStr + "Title WHERE OID=" + SystemConfig.AppCenterDBVarStr + "OID"; DBAccess.RunSQL(ps); ps.SQL = "UPDATE " + md.PTable + " SET Title=" + SystemConfig.AppCenterDBVarStr + "Title WHERE OID=" + SystemConfig.AppCenterDBVarStr + "OID"; DBAccess.RunSQL(ps); ps.SQL = "UPDATE WF_GenerWorkFlow SET Title=" + SystemConfig.AppCenterDBVarStr + "Title WHERE WorkID=" + SystemConfig.AppCenterDBVarStr + "OID"; DBAccess.RunSQL(ps); ps.SQL = "UPDATE WF_GenerFH SET Title=" + SystemConfig.AppCenterDBVarStr + "Title WHERE FID=" + SystemConfig.AppCenterDBVarStr + "OID"; DBAccess.RunSQLs(sql); } Emp emp1 = new Emp("admin"); BP.Web.WebUser.SignInOfGener(emp1); return("全部生成成功,影响数据(" + wks.Count + ")条"); }
/// <summary> /// 设置SID /// </summary> /// <param name="sid"></param> public static void SetSID(string sid) { //判断是否视图,如果为视图则不进行修改 if (BP.DA.DBAccess.IsView("Port_Emp") == false) { Paras ps = new Paras(); ps.SQL = "UPDATE Port_Emp SET SID=" + SystemConfig.AppCenterDBVarStr + "SID WHERE No=" + SystemConfig.AppCenterDBVarStr + "No"; ps.Add("SID", sid); ps.Add("No", WebUser.No); BP.DA.DBAccess.RunSQL(ps); } WebUser.SID = sid; }
/// <summary> /// 查询 /// </summary> /// <returns></returns> public string Home_Init_WorkCount() { Paras ps = new Paras(); ps.SQL = "SELECT TSpan as No, '' as Name, COUNT(WorkID) as Num, FROM WF_GenerWorkFlow WHERE Emps LIKE '%" + SystemConfig.AppCenterDBVarStr + "Emps%' GROUP BY TSpan"; ps.Add("Emps", WebUser.No); //string sql = "SELECT TSpan as No, '' as Name, COUNT(WorkID) as Num, FROM WF_GenerWorkFlow WHERE Emps LIKE '%" + WebUser.No + "%' GROUP BY TSpan"; DataSet ds = new DataSet(); DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps); ds.Tables.Add(dt); if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL) { dt.Columns[0].ColumnName = "TSpan"; dt.Columns[1].ColumnName = "Num"; } string sql = "SELECT IntKey as No, Lab as Name FROM Sys_Enum WHERE EnumKey='TSpan'"; DataTable dt1 = BP.DA.DBAccess.RunSQLReturnTable(sql); foreach (DataRow dr in dt.Rows) { foreach (DataRow mydr in dt1.Rows) { } } return(BP.Tools.Json.ToJson(dt)); }
static ObservableCollection <T> getItems <T>(string Path, out string Errmsg, Dictionary <string, string> Paras = null, int RetryNum = 3) { if (Paras == null) { Paras = new Dictionary <string, string>(); } Paras.Add("limit", "50"); Paras.Add("offset", "0"); int iOffset = 0; ObservableCollection <T> pRet = new ObservableCollection <T>(); while (true) { string sRet = get(Path, out Errmsg, Paras, RetryNum); if (sRet.IsBlank() || Errmsg.IsNotBlank()) { break; } ObservableCollection <T> pList = JsonHelper.ConverStringToObject <ObservableCollection <T> >(sRet, "items"); foreach (var item in pList) { pRet.Add(item); } if (pList.Count() < 50) { break; } iOffset += pList.Count(); Paras["offset"] = iOffset.ToString(); } return(pRet); }
/// <summary> /// 初始化切换部门. /// </summary> /// <returns></returns> public string ChangeDept_Init() { Paras ps = new Paras(); ps.SQL = "SELECT a.No,a.Name, NameOfPath, '0' AS CurrentDept FROM Port_Dept A, Port_DeptEmp B WHERE A.No=B.FK_Dept AND B.FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp"; ps.Add("FK_Emp", BP.Web.WebUser.No); DataTable dt = DBAccess.RunSQLReturnTable(ps); if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL) { dt.Columns["NO"].ColumnName = "No"; dt.Columns["NAME"].ColumnName = "Name"; dt.Columns["CURRENTDEPT"].ColumnName = "CurrentDept"; dt.Columns["NAMEOFPATH"].ColumnName = "NameOfPath"; } //设置当前的部门. foreach (DataRow dr in dt.Rows) { if (dr["No"].ToString() == WebUser.FK_Dept) { dr["CurrentDept"] = "1"; } if (dr["NameOfPath"].ToString() != "") { dr["Name"] = dr["NameOfPath"]; } } return(BP.Tools.Json.ToJson(dt)); }
/// <summary> /// 初始化 /// </summary> /// <returns></returns> public string StandAloneFrm_Init() { ps = new Paras(); ps.SQL = "SELECT m.No, m.Name, n.FK_Node, n.FK_Flow FROM WF_FrmNode n INNER JOIN Sys_MapData m ON n.FK_Frm=m.No WHERE n.FrmEnableRole!=5 AND n.FK_Node=" + SystemConfig.AppCenterDBVarStr + "FK_Node"; ps.Add("FK_Node", this.FK_Node); //string sql = "SELECT m.No, m.Name, n.FK_Node, n.FK_Flow FROM WF_FrmNode n INNER JOIN Sys_MapData m ON n.FK_Frm=m.No WHERE n.FrmEnableRole!=5 AND n.FK_Node=" + this.FK_Node; DataTable dt = DBAccess.RunSQLReturnTable(ps); dt.TableName = "Frms"; dt.Columns[0].ColumnName = "No"; dt.Columns[1].ColumnName = "Name"; DataRow dr = dt.NewRow(); dr[0] = "all"; dr[1] = "请选择表单"; dt.Rows.Add(dr); DataSet ds = new DataSet(); ds.Tables.Add(dt); //增加条件集合. string fk_mainNode = this.GetRequestVal("FK_MainNode"); string toNodeID = this.GetRequestVal("ToNodeID"); Conds conds = new Conds(); conds.Retrieve(CondAttr.FK_Node, fk_mainNode, CondAttr.ToNodeID, toNodeID); ds.Tables.Add(conds.ToDataTableField("WF_Conds")); return(BP.Tools.Json.DataSetToJson(ds, false)); // cond.ToJson(); }
/// <summary> /// 为一个岗位设置全部的权限 /// </summary> /// <param name="fk_station"></param> public void OpenAllForStation(string fk_station) { Paras ps = new Paras(); ps.Add("user", Web.WebUser.No); ps.Add("st", fk_station); if (DBAccess.IsExits("SELECT FK_Emp FROM Port_EmpStation WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "user AND FK_Station=" + SystemConfig.AppCenterDBVarStr + "st", ps)) { this.OpenAll(); } else { this.Readonly(); } }
/// <summary> /// 不大于 /// 小于或等于 /// </summary> /// <param name="field"></param> /// <param name="standard"></param> /// <returns></returns> public ORM <T> Ngt(String feild, Object standard) { String keyflag = feild + Paras.Count; QueryStirng.Append(" and " + feild + "<=@" + keyflag + " "); Paras.Add(new MySqlParameter(keyflag, standard)); return(this); }
/// <summary> /// 数据库操作访问 /// </summary> public void DataBaseAccess() { #region 执行不带有参数. // 执行Insert ,delete, update 语句. int result = BP.DA.DBAccess.RunSQL("DELETE FROM Port_Emp WHERE 1=2"); // 执行多个sql string sqls = "DELETE FROM Port_Emp WHERE 1=2"; sqls += "@DELETE FROM Port_Emp WHERE 1=2"; sqls += "@DELETE FROM Port_Emp WHERE 1=2"; BP.DA.DBAccess.RunSQLs(sqls); //执行查询返回datatable. string sql = "SELECT * FROM Port_Emp"; DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sql); //执行查询返回 string 值. sql = "SELECT FK_Dept FROM Port_Emp WHERE No='" + BP.Web.WebUser.No + "'"; string fk_dept = BP.DA.DBAccess.RunSQLReturnString(sql); //执行查询返回 int 值. 也可以返回float, string sql = "SELECT count(*) as Num FROM Port_Emp "; int empNum = BP.DA.DBAccess.RunSQLReturnValInt(sql); //运行存储过程. string spName = "MySp"; BP.DA.DBAccess.RunSP(spName); #endregion 执行不带有参数. #region 执行带有参数. // 执行Insert ,delete, update 语句. // 已经明确数据库类型. Paras ps = new Paras(); ps.SQL = "DELETE FROM Port_Emp WHERE No=@UserNo"; ps.Add("UserNo", "abc"); BP.DA.DBAccess.RunSQL(ps); // 不知道数据库类型. ps = new Paras(); ps.SQL = "DELETE FROM Port_Emp WHERE No=" + BP.SystemConfig.AppCenterDBVarStr + "UserNo"; ps.Add("UserNo", "abc"); BP.DA.DBAccess.RunSQL(ps); //执行查询返回datatable. ps = new Paras(); ps.SQL = "SELECT * FROM Port_Emp WHERE FK_Dept=@DeptNoVar"; ps.Add("DeptNoVar", "0102"); DataTable dtDept = BP.DA.DBAccess.RunSQLReturnTable(ps); //运行存储过程. ps = new Paras(); ps.Add("DeptNoVar", "0102"); spName = "MySp"; BP.DA.DBAccess.RunSP(spName, ps); #endregion 执行带有参数. }
public RobotCmdBase() { for (int i = 0; i < 6; i++) { Paras.Add(""); } I_Speed = EnumRobotSpeed.V10; I_Tool = EnumRobotTool.Tool0; }
private void InsertIt(string emp) { try { Int32 oid = DBAccess.GenerOIDByGUID(); string dbstr = BP.SystemConfig.AppCenterDBVarStr; Paras ps = new Paras(); ps.SQL = "INSERT INTO ND24Rpt (OID,Title,FlowStarter) VALUES(" + dbstr + "OID," + dbstr + "Title," + dbstr + "FlowStarter)"; ps.Add("OID", oid); ps.Add("Title", emp + DataType.CurrentData); ps.Add("FlowStarter", emp); ps.Add("WFState", 1); DBAccess.RunSQL(ps); ps = new Paras(); ps.SQL = "INSERT INTO ND24Track (MyPK,ActionType,ActionTypeText,EmpFrom) VALUES(" + dbstr + "MyPK," + dbstr + "ActionType," + dbstr + "ActionTypeText," + dbstr + "EmpFrom)"; ps.Add("MyPK", oid); ps.Add("ActionType", 1); ps.Add("ActionTypeText", emp); ps.Add("EmpFrom", emp); DBAccess.RunSQL(ps); ps = new Paras(); ps.SQL = "INSERT INTO WF_GenerWorkFlow (WorkID,FID,FK_Flow,Starter,FK_Node) VALUES(" + dbstr + "WorkID," + dbstr + "FID," + dbstr + "FK_Flow," + dbstr + "Starter," + dbstr + "FK_Node)"; ps.Add("WorkID", oid); ps.Add("FID", 1); ps.Add("FK_Flow", emp); ps.Add("Starter", emp); ps.Add("FK_Node", 2401); DBAccess.RunSQL(ps); ps = new Paras(); ps.SQL = "INSERT INTO WF_GenerWorkerlist (WorkID,FK_Node,FK_Emp) VALUES(" + dbstr + "WorkID," + dbstr + "FK_Node," + dbstr + "FK_Emp)"; ps.Add("WorkID", oid); ps.Add("FK_Emp", emp); ps.Add("FK_Node", 2401); DBAccess.RunSQL(ps); } catch (Exception ex) { Log.DefaultLogWriteLineError(ex.Message); } }
/// <summary> /// 提交评论. /// </summary> /// <returns></returns> public string FlowBBS_Save() { string msg = this.GetValFromFrmByKey("TB_Msg"); string mypk = BP.WF.Dev2Interface.Flow_BBSAdd(this.FK_Flow, this.WorkID, this.FID, msg, WebUser.No, WebUser.Name); Paras ps = new Paras(); ps.SQL = "SELECT * FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE MyPK=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "MyPK"; ps.Add("MyPK", mypk); return(BP.Tools.Json.ToJson(BP.DA.DBAccess.RunSQLReturnTable(ps))); }
/// <summary> /// 登录. /// </summary> /// <returns></returns> public string Login_Submit() { string userNo = this.GetRequestVal("TB_No"); if (userNo == null) { userNo = this.GetRequestVal("TB_UserNo"); } string pass = this.GetRequestVal("TB_PW"); if (pass == null) { pass = this.GetRequestVal("TB_Pass"); } BP.Port.Emp emp = new Emp(); emp.No = userNo; if (emp.RetrieveFromDBSources() == 0) { if (DBAccess.IsExitsTableCol("Port_Emp", "NikeName") == true) { /*如果包含昵称列,就检查昵称是否存在.*/ Paras ps = new Paras(); ps.SQL = "SELECT No FROM Port_Emp WHERE NikeName=" + SystemConfig.AppCenterDBVarStr + "NikeName"; ps.Add("NikeName", userNo); string no = DBAccess.RunSQLReturnStringIsNull(ps, null); if (no == null) { return("err@用户名或者密码错误."); } emp.No = no; int i = emp.RetrieveFromDBSources(); if (i == 0) { return("err@用户名或者密码错误."); } } else { return("err@用户名或者密码错误."); } } if (emp.CheckPass(pass) == false) { return("err@用户名或者密码错误."); } //调用登录方法. BP.WF.Dev2Interface.Port_Login(emp.No, emp.Name, emp.FK_Dept, emp.FK_DeptText); return("登录成功."); }
/// <summary> /// 获取Guest的待办 /// </summary> /// <param name="fk_flow">流程编号,流程编号为空表示所有的流程.</param> /// <param name="guestNo">客户编号</param> /// <returns>结果集合</returns> public static DataTable DB_GenerEmpWorksOfDataTable(string guestNo, string fk_flow = null) { Paras ps = new Paras(); string dbstr = BP.Sys.SystemConfig.AppCenterDBVarStr; string sql; /*不是授权状态*/ if (DataType.IsNullOrEmpty(fk_flow)) { ps.SQL = "SELECT * FROM WF_EmpWorks WHERE GuestNo=" + dbstr + "GuestNo ORDER BY FK_Flow,ADT DESC "; ps.Add("GuestNo", guestNo); } else { ps.SQL = "SELECT * FROM WF_EmpWorks WHERE GuestNo=" + dbstr + "GuestNo AND FK_Flow=" + dbstr + "FK_Flow ORDER BY ADT DESC "; ps.Add("FK_Flow", fk_flow); ps.Add("GuestNo", guestNo); } return(BP.DA.DBAccess.RunSQLReturnTable(ps)); }
/// <summary> /// 设置用户信息 /// </summary> /// <param name="flowNo">流程编号</param> /// <param name="workID">工作ID</param> /// <param name="guestNo">客户编号</param> /// <param name="guestName">客户名称</param> public static void SetGuestInfo(string flowNo, Int64 workID, string guestNo, string guestName) { string dbstr = BP.Sys.SystemConfig.AppCenterDBVarStr; Paras ps = new Paras(); ps.SQL = "UPDATE WF_GenerWorkFlow SET GuestNo=" + dbstr + "GuestNo, GuestName=" + dbstr + "GuestName WHERE WorkID=" + dbstr + "WorkID"; ps.Add("GuestNo", guestNo); ps.Add("GuestName", guestName); ps.Add("WorkID", workID); BP.DA.DBAccess.RunSQL(ps); Flow fl = new Flow(flowNo); ps = new Paras(); ps.SQL = "UPDATE " + fl.PTable + " SET GuestNo=" + dbstr + "GuestNo, GuestName=" + dbstr + "GuestName WHERE OID=" + dbstr + "OID"; ps.Add("GuestNo", guestNo); ps.Add("GuestName", guestName); ps.Add("OID", workID); BP.DA.DBAccess.RunSQL(ps); }
public string AddParameter(object value) { if (Paras == null) { Paras = new Dictionary <string, object>(); } string parameterName = string.Format("@P{0}", Paras.Count); Paras.Add(parameterName, value); SqlParameters.Add(new SqlParameter(parameterName, value)); return(parameterName); }
/// <summary> /// 打开最后一个节点表单 /// </summary> /// <returns></returns> public string DoOpenLastForm() { Paras pss = new Paras(); pss.SQL = "SELECT MYPK FROM ND" + int.Parse(this.FK_Flow) + "Track WHERE ActionType=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "ActionType AND WorkID=" + BP.Sys.SystemConfig.AppCenterDBVarStr + "WorkID ORDER BY RDT DESC"; pss.Add("ActionType", (int)BP.WF.ActionType.Forward); pss.Add("WorkID", this.WorkID); DataTable dt = DBAccess.RunSQLReturnTable(pss); if (dt != null && dt.Rows.Count > 0) { string myPk = dt.Rows[0][0].ToString(); return("/WF/WFRpt.htm?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&DoType=View&MyPK=" + myPk + "&PWorkID=" + this.PWorkID); } Node nd = new Node(this.FK_Node); nd.WorkID = this.WorkID; //为获取表单ID ( NodeFrmID )提供参数. return("/WF/CCForm/FrmGener.htm?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow + "&FK_MapData=" + nd.NodeFrmID + "&ReadOnly=1&IsEdit=0"); }
public string DistributedOfMy_Init() { DataSet ds = new DataSet(); //我发起的流程. Paras ps = new Paras(); ps.SQL = "select FK_Flow, FlowName,Count(WorkID) as Num FROM WF_GenerWorkFlow WHERE Starter=" + SystemConfig.AppCenterDBVarStr + "Starter GROUP BY FK_Flow, FlowName "; ps.Add("Starter", BP.Web.WebUser.No); //string sql = ""; //sql = "select FK_Flow, FlowName,Count(WorkID) as Num FROM WF_GenerWorkFlow WHERE Starter='" + BP.Web.WebUser.No + "' GROUP BY FK_Flow, FlowName "; System.Data.DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(ps); dt.TableName = "Start"; if (SystemConfig.AppCenterDBType == DBType.Oracle) { dt.Columns["FK_FLOW"].ColumnName = "FK_Flow"; dt.Columns["FLOWNAME"].ColumnName = "FlowName"; dt.Columns["NUM"].ColumnName = "Num"; } ds.Tables.Add(dt); //待办. ps = new Paras(); ps.SQL = "select FK_Flow, FlowName,Count(WorkID) as Num FROM wf_empworks WHERE FK_Emp=" + SystemConfig.AppCenterDBVarStr + "FK_Emp GROUP BY FK_Flow, FlowName "; ps.Add("FK_Emp", BP.Web.WebUser.No); //sql = "select FK_Flow, FlowName,Count(WorkID) as Num FROM wf_empworks WHERE FK_Emp='" + BP.Web.WebUser.No + "' GROUP BY FK_Flow, FlowName "; System.Data.DataTable dtTodolist = BP.DA.DBAccess.RunSQLReturnTable(ps); dtTodolist.TableName = "Todolist"; if (SystemConfig.AppCenterDBType == DBType.Oracle) { dtTodolist.Columns["FK_FLOW"].ColumnName = "FK_Flow"; dtTodolist.Columns["FLOWNAME"].ColumnName = "FlowName"; dtTodolist.Columns["NUM"].ColumnName = "Num"; } ds.Tables.Add(dtTodolist); //正在运行的流程. System.Data.DataTable dtRuning = BP.WF.Dev2Interface.DB_TongJi_Runing(); dtRuning.TableName = "Runing"; ds.Tables.Add(dtRuning); //归档的流程. System.Data.DataTable dtOK = BP.WF.Dev2Interface.DB_TongJi_FlowComplete(); dtOK.TableName = "OK"; ds.Tables.Add(dtOK); //返回结果. return(BP.Tools.Json.DataSetToJson(ds, false)); }
/// <summary> /// 抄送初始化. /// </summary> /// <returns></returns> public string CC_Init() { GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID); Hashtable ht = new Hashtable(); ht.Add("Title", gwf.Title); //计算出来曾经抄送过的人. Paras ps = new Paras(); ps.SQL = "SELECT CCToName FROM WF_CCList WHERE FK_Node=" + SystemConfig.AppCenterDBVarStr + "FK_Node AND WorkID=" + SystemConfig.AppCenterDBVarStr + "WorkID"; ps.Add("FK_Node", this.FK_Node); ps.Add("WorkID", this.WorkID); //string sql = "SELECT CCToName FROM WF_CCList WHERE FK_Node=" + this.FK_Node + " AND WorkID=" + this.WorkID; DataTable mydt = DBAccess.RunSQLReturnTable(ps); string toAllEmps = ""; foreach (DataRow dr in mydt.Rows) { toAllEmps += dr[0].ToString() + ","; } ht.Add("CCTo", toAllEmps); // 根据他判断是否显示权限组。 if (BP.DA.DBAccess.IsExitsObject("GPM_Group") == true) { ht.Add("IsGroup", "1"); } else { ht.Add("IsGroup", "0"); } //返回流程标题. return(BP.Tools.Json.ToJsonEntityModel(ht)); }