//读取数据库,显示接口列表。 private void bindJK(DropDownList ddljk) { string sql = " select distinct JK_host from AAA_ipcJK where JK_open = 1 order by JK_host "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsGXlist = new DataSet(); Hashtable input = new Hashtable(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "接口", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { ddljk.Items.Clear(); dsGXlist = (DataSet)(return_ht["return_ds"]); ddljk.DataSource = dsGXlist.Tables["接口"].DefaultView; ddljk.DataTextField = "JK_host"; ddljk.DataValueField = "JK_host"; ddljk.DataBind(); ddljk.Items.Insert(0, new ListItem("请选择", "")); if (ddljk.Items.Count > 0) { ddljk.SelectedIndex = 0; } } else { //读取数据库出错。。。 ddljk.DataSource = null; ddljk.DataBind(); ddljk.Items.Insert(0, new ListItem("请选择", "")); Response.Write(return_ht["return_errmsg"].ToString()); } }
//读取数据库,显示已添加的数据。 private void beginshow() { string sql = " select IP.IP_guid,IP.IP_address as IP地址,IP.IP_JK_host as 接口域名,IP.IP_open as IP地址是否有效, IP.IP_shuoming as 备注, "; sql = sql + " JK.JK_port as 接口备用端口,(CASE JK.JK_open when '1' then '有效' when '0' then '禁用' else '未知' end) as 接口有效性,(CASE IP.IP_zt WHEN '1' THEN '活着' WHEN '0' THEN '挂了' ELSE '未知' END) as IP地址状态,IP_addtime as IP添加时间,IP_edittime as IP最后修改时间 "; sql = sql + " from AAA_ipcIP as IP left join (select distinct JK_host,JK_port,JK_open from AAA_ipcJK) as JK on IP.IP_JK_host = JK.JK_host "; sql = sql + " " + TextBox2.Text + " "; sql = sql + " " + TextBox1.Text + " "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsIPlist = new DataSet(); Hashtable input = new Hashtable(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "IP负载", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsIPlist = (DataSet)(return_ht["return_ds"]); GridView1.DataSource = dsIPlist.Tables["IP负载"].DefaultView; GridView1.DataBind(); //Response.Write(dsGXlist.Tables[0].Rows.Count.ToString()); } else { //读取数据库出错。。。 GridView1.DataSource = null; GridView1.DataBind(); Response.Write(return_ht["return_errmsg"].ToString()); } }
/// <summary> /// 检查单据状态 /// </summary> /// <returns></returns> public string check_bxsqzt(string BID) { I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); Hashtable param = new Hashtable(); param.Add("@BID", BID); return_ht = I_DBL.RunParam_SQL("select top 1 Bzhuangtai from ZZZ_BXSQ where BID=@BID", "数据记录", param); if ((bool)(return_ht["return_float"])) { DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy(); if (redb.Rows.Count < 1) { return(""); } else { return(redb.Rows[0]["Bzhuangtai"].ToString()); } } else { return(""); } }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //以可排序guid方式生成 string guid = CombGuid.GetMewIdFormSequence("ZZZ_gonggao"); param.Add("@GID", guid); param.Add("@Gtitle", ht_forUI["Gtitle"].ToString()); string htmlstr = ht_forUI["Gneirong_html"].ToString(); htmlstr = StringOP.uncMe(htmlstr, "mima"); param.Add("@Gneirong", htmlstr); param.Add("@Glaiyuan", ht_forUI["Glaiyuan"].ToString()); param.Add("@Gzt", ht_forUI["Gzt"].ToString()); param.Add("@Gaddren", ht_forUI["yhbsp_session_uer_UAid"].ToString()); alsql.Add("INSERT INTO ZZZ_gonggao(GID, Gtitle, Gneirong, Glaiyuan, Gaddren, Gzt) VALUES(@GID, @Gtitle, @Gneirong, @Glaiyuan, @Gaddren, @Gzt)"); if (ht_forUI["Gzt"].ToString() == "显示") { alsql.Add("INSERT INTO auth_znx(touser, msgtitle, msurl) select UAid as touser, '有新的公告发布' as msgtitle, '/adminht/corepage/bas/list_ss_gonggao.aspx' as msurl from ZZZ_userinfo where zhuangtai='在职' "); } return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "保存成功!{" + guid + "}"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 编辑数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_EDIT(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里省略 if (ht_forUI["idforedit"].ToString().Trim() == "") { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "没有明确的修改目标!"; return(dsreturn); } //开始真正的处理,这里只是演示,所以直接在这里写业务逻辑代码了 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); param.Add("@YID", ht_forUI["idforedit"].ToString()); param.Add("@YSTR", ht_forUI["YSTR"].ToString()); alsql.Add("UPDATE ZZZ_ZFCMJ SET YSTR=@YSTR where YID =@YID "); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "修改成功!"; } else { //其实要记录日志,而不是输出,这里只是演示 //dsreturn.Tables.Add(parameter_forUI.Copy()); dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,修改失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 检查制单人身份 /// </summary> /// <returns></returns> public string check_G_UAID_bumen(string G_UAID) { I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); Hashtable param = new Hashtable(); param.Add("@G_UAID", G_UAID); return_ht = I_DBL.RunParam_SQL("select top 1 suoshuquyu from ZZZ_userinfo where Uaid=@G_UAID", "数据记录", param); if ((bool)(return_ht["return_float"])) { DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy(); if (redb.Rows.Count < 1) { return(""); } else { //122 121 88 120 89 if (redb.Rows[0]["suoshuquyu"].ToString() == "122" || redb.Rows[0]["suoshuquyu"].ToString() == "121" || redb.Rows[0]["suoshuquyu"].ToString() == "88" || redb.Rows[0]["suoshuquyu"].ToString() == "120" || redb.Rows[0]["suoshuquyu"].ToString() == "89") { return("业务员"); } else { return(""); } } } else { return(""); } }
//读取数据库,显示接口中的方法信息。 private void beginshow() { string sql = " select "; sql = sql + " FF.FF_guid as 方法唯一标示,FF.FF_yewuname as 业务名称,FF.FF_name as 方法名,FF.FF_retype as 返回值类型,FF.FF_canshu as 参数类型, "; sql = sql + " FF.FF_shuoming as 方法注释, (CASE FF.FF_open WHEN '1' THEN '有效' WHEN '0' THEN '禁用' ELSE '未知' END) as 方法是否有效, "; sql = sql + " (CASE FF.FF_zt WHEN '1' THEN '活着' WHEN '0' THEN '挂了' ELSE '未知' END) as 方法目前状态, "; sql = sql + " (CASE FF.FF_CorE WHEN '1' THEN '有插入或更新操作' WHEN '0' THEN '仅查询操作' ELSE '未知' END) as 操作特点, "; sql = sql + " FF.FF_log as 日志设置 "; sql = sql + " from AAA_ipcFF as FF "; sql = sql + " where FF.FF_JK_guid = @JK_guid "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsJKlist = new DataSet(); Hashtable input = new Hashtable(); input["@JK_guid"] = Request["JK_guid"].ToString(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "方法", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsJKlist = (DataSet)(return_ht["return_ds"]); GridView1.DataSource = dsJKlist.Tables["方法"].DefaultView; GridView1.DataBind(); } else { //读取数据库出错。。。 //读取数据库出错。。。 GridView1.DataSource = null; GridView1.DataBind(); Response.Write(return_ht["return_errmsg"].ToString()); } }
/// <summary> /// 根据提货单号获取对应的发货单号以及发货单状态 /// </summary> /// <param name="I_DBL"></param> /// <param name="thNumber"></param> /// <returns></returns> public DataTable GetFHNumber(I_Dblink I_DBL, string thNumber, string fhlx) { String sql = "select FHDID,FHDLX, THDID,FHDZT,FHSL from tFHXXB where THDID=@THDID and FHDLX=@FHDLX and( FHDZT is null or FHDZT!='完成')"; Hashtable htin = new Hashtable(); htin["@THDID"] = thNumber; htin["@FHDLX"] = fhlx; Hashtable ht = I_DBL.RunParam_SQL(sql, "dtResult", htin); if ((bool)(ht["return_float"])) { DataSet ds = (DataSet)ht["return_ds"]; if (ds != null && ds.Tables["dtResult"] != null && ds.Tables["dtResult"].Rows.Count == 1) { DataTable fh = new DataTable(); fh = ds.Tables["dtResult"].Copy(); fh.TableName = "发货信息"; return(fh); } else { return(null); } } else { return(null); } }
/// <summary> /// 根据合同编号获取买卖方经纪人以及区代等相关信息 /// </summary> /// <param name="I_DBL"></param> /// <param name="htbh"></param> /// <returns></returns> public DataTable GetAllAccountNumbersByHTID(I_Dblink I_DBL, string htbh) { String sql = "select B.UserId as '买方区代账号', B.GLJJRuserid as '买方经纪人账号', B.BSSQY as '买方所属区域', B.BUserId as '买方账号',B.BFullName as '买方名称',S.UserId as '卖方区代账号', S.GLJJRuserid as '卖方经纪人账号', S.SSSQY as '卖方所属区域', S.SUserId as '卖方账号',S.SFullName as '卖方名称' from (select BA.UserId,GLJJRuserid,HTID ,BSSQY , BUserId, BFullName from tHTXXB left join (select * from uQYDLXXB where uQYDLXXB.SFYX='T' ) as BA on BSSQY= (DLQY_Prov +'|'+ DLQY_city +'|'+DLQY_qu ) left join uUserInfo on BUserId=uUserInfo.UserId) B join (select SA.UserId ,GLJJRuserid ,HTID ,SSSQY ,SUserId ,SFullName from tHTXXB left join (select * from uQYDLXXB where uQYDLXXB.SFYX='T' ) as SA on SSSQY= (DLQY_Prov +'|'+ DLQY_city +'|'+DLQY_qu ) left join uUserInfo on BUserId=uUserInfo.UserId) S on B.HTID=S.HTID where B.HTID = @HTID "; Hashtable htin = new Hashtable(); htin["@HTID"] = htbh; Hashtable ht = I_DBL.RunParam_SQL(sql, "dtResult", htin); if ((bool)(ht["return_float"])) { DataSet ds = (DataSet)ht["return_ds"]; if (ds != null && ds.Tables["dtResult"] != null && ds.Tables["dtResult"].Rows.Count == 1) { DataTable AccountNumber = new DataTable(); AccountNumber = ds.Tables["dtResult"].Copy(); AccountNumber.TableName = "关联账号信息"; return(AccountNumber); } else { return(null); } } else { return(null); } }
/// <summary> /// 根据用户编号获取相应的经纪人编号 /// </summary> /// <param name="I_DBL"></param> /// <param name="userId"></param> /// <returns></returns> public DataTable GetAccountNumber(I_Dblink I_DBL, string userId) { String sql = "select uUserInfo.UserId as '用户账号',GLJJRuserid as '经纪人账号' from uUserInfo where uUserInfo.UserId =@UserId "; Hashtable htin = new Hashtable(); htin["@UserId"] = userId; Hashtable ht = I_DBL.RunParam_SQL(sql, "dtResult", htin); if ((bool)(ht["return_float"])) { DataSet ds = (DataSet)ht["return_ds"]; if (ds != null && ds.Tables["dtResult"] != null && ds.Tables["dtResult"].Rows.Count == 1) { DataTable AccountNumber = new DataTable(); AccountNumber = ds.Tables["dtResult"].Copy(); AccountNumber.TableName = "关联账号信息"; return(AccountNumber); } else { return(null); } } else { return(null); } }
//读取数据库,显示接口信息。 private void beginshow0() { string sql = " select JK.JK_guid as 接口唯一标示,JK.JK_host as 接口域名,(select count(*) from AAA_ipcIP where IP_JK_host = JK.JK_host and IP_open = '正常负载') as 负载IP数量,JK.JK_path as 接口地址,JK.JK_shuoming as 接口说明, "; sql = sql + " JK.JK_banben as 接口版本号,(CASE JK.JK_open WHEN '1' THEN '有效' WHEN '0' THEN '禁用' ELSE '未知' END) as 接口是否有效, "; sql = sql + " (CASE JK.JK_zt WHEN '1' THEN '活着' WHEN '0' THEN '挂了' ELSE '未知' END) as 接口目前状态, "; sql = sql + " JK.JK_addtime as 添加时间,JK.JK_edittime as 最后一次修改时间 ,JK.JK_port as 接口备用端口 "; sql = sql + " from AAA_ipcJK as JK "; sql = sql + " where JK.JK_guid = @JK_guid "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsGXlist = new DataSet(); Hashtable input = new Hashtable(); input["@JK_guid"] = Request["JK_guid"].ToString(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "接口", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsGXlist = (DataSet)(return_ht["return_ds"]); showjk.InnerHtml = "<table border='0' cellpadding='5' cellspacing='1' bgcolor='#333333'>"; for (int i = 0; i < dsGXlist.Tables["接口"].Columns.Count; i++) { showjk.InnerHtml = showjk.InnerHtml + "<tr><td bgcolor='#FFFFFF'><strong>" + dsGXlist.Tables["接口"].Columns[i].ColumnName + ":</strong></td><td bgcolor='#FFFFFF'>" + dsGXlist.Tables["接口"].Rows[0][i].ToString() + "</td></tr>"; } showjk.InnerHtml = showjk.InnerHtml + "</table> "; } else { //读取数据库出错。。。 dsGXlist = null; Response.Write(return_ht["return_errmsg"].ToString()); } }
//读取数据库 private void beginshowFF() { string sql = " select (FF_yewuname + '->' + FF_name + '[' + (CASE FF_CorE WHEN '1' THEN '有插入或更新操作' WHEN '0' THEN '仅查询操作' ELSE '未知' END) +']') as showtxt,FF_guid from AAA_ipcFF where FF_open = 1 and FF_JK_guid = @FF_JK_guid order by FF_yewuname asc,FF_name asc "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsFFlist = new DataSet(); Hashtable input = new Hashtable(); input["@FF_JK_guid"] = GX_JK_guid.SelectedValue; Hashtable return_ht = I_DBL.RunParam_SQL(sql, "方法列表", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsFFlist = (DataSet)(return_ht["return_ds"]); GX_FF_guid.DataSource = dsFFlist.Tables["方法列表"].DefaultView; GX_FF_guid.DataTextField = "showtxt"; GX_FF_guid.DataValueField = "FF_guid"; GX_FF_guid.DataBind(); //Response.Write(dsGXlist.Tables[0].Rows.Count.ToString()); if (GX_FF_guid.Items.Count > 0) { GX_FF_guid.SelectedIndex = 0; } } else { //读取数据库出错。。。 GX_FF_guid.DataSource = null; GX_FF_guid.DataBind(); Response.Write(return_ht["return_errmsg"].ToString()); } }
/// <summary> /// 获取当前数据库内容,用于时间对比字符串 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> private string get_dbtime(string QID) { string dbtime = ""; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); Hashtable param = new Hashtable(); param.Add("@QID", QID); return_ht = I_DBL.RunParam_SQL("select * from View_ZZZ_HQ_YJ_ex where YJ_QID = @QID order by YJlysj asc", "数据记录", param); if ((bool)(return_ht["return_float"])) { DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy(); for (int i = 0; i < redb.Rows.Count; i++) { dbtime = dbtime + redb.Rows[i]["YJqsshijian"].ToString() + ","; } return(dbtime); } else { return(""); } }
public string SaveCallLog(DataTable dtgx, string[] objCS_str) { try { //数据库连接初始化(实际上这里应该是用内存数据库,以及内存文件系统。 加快速度。暂不实现) I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable input = new Hashtable(); input["@LOG_guid"] = Guid.NewGuid().ToString(); input["@LOG_GX_guid"] = dtgx.Rows[0]["关系唯一标示"].ToString(); input["@LOG_JK_host"] = dtgx.Rows[0]["接口域名"].ToString(); input["@LOG_JK_path"] = dtgx.Rows[0]["接口地址"].ToString(); input["@LOG_FF_yewuname"] = dtgx.Rows[0]["业务名称"].ToString(); input["@LOG_FF_name"] = dtgx.Rows[0]["方法名"].ToString(); input["@LOG_FF_retype"] = dtgx.Rows[0]["返回值类型"].ToString(); input["@LOG_FF_canshu"] = dtgx.Rows[0]["参数类型"].ToString(); input["@LOG_GX_type"] = dtgx.Rows[0]["调用方式"].ToString(); input["@LOG_FF_CorE"] = dtgx.Rows[0]["操作特点"].ToString(); input["@LOG_zt"] = 9; //默认是不确定 Hashtable return_ht = I_DBL.RunParam_SQL("INSERT INTO AAA_ipcLOG(LOG_guid,LOG_GX_guid,LOG_JK_host,LOG_JK_path,LOG_FF_yewuname,LOG_FF_name,LOG_FF_retype,LOG_FF_canshu,LOG_GX_type,LOG_FF_CorE,LOG_zt) VALUES (@LOG_guid,@LOG_GX_guid,@LOG_JK_host,@LOG_JK_path,@LOG_FF_yewuname,@LOG_FF_name,@LOG_FF_retype,@LOG_FF_canshu,@LOG_GX_type,@LOG_FF_CorE,@LOG_zt) ", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { //必须把具体参数序列化,记录到磁盘上。 //FileStream stream = new FileStream(Context.Request.MapPath("/objCS_" + dtgx.Rows[0]["调用方式"].ToString() + "/") + "\\" + input["@LOG_guid"].ToString() + ".txt", FileMode.Create); //XmlSerializer serializer = new XmlSerializer(objCS.GetType()); //serializer.Serialize(stream, objCS); //stream.Close(); string[] typestr = objCS_str[0].Split('|'); string mainfile_str = ""; for (int i = 0; i < typestr.Length; i++) { string thisfilename = input["@LOG_guid"].ToString() + "_" + i + "_" + typestr[i] + ".txt"; if (i == typestr.Length - 1) { mainfile_str = mainfile_str + thisfilename; } else { mainfile_str = mainfile_str + thisfilename + "|"; } File.WriteAllText(Context.Request.MapPath("/objCS_" + dtgx.Rows[0]["调用方式"].ToString() + "/") + "\\" + thisfilename, objCS_str[i + 1]); } File.WriteAllText(Context.Request.MapPath("/objCS_" + dtgx.Rows[0]["调用方式"].ToString() + "/") + "\\" + input["@LOG_guid"].ToString() + ".txt", mainfile_str); return("okgo:" + input["@LOG_guid"].ToString()); } else { //数据库出错。。。 return("errstop"); } } catch (Exception ex) { //File.WriteAllText("d:\aaa.txt",ex.ToString() + ex.InnerException.Message); return("errstop"); } }
//读取数据库,显示接口数据。 private void beginshowJK() { string sql = " select distinct JK_host from AAA_ipcJK where JK_open = 1 order by JK_host asc "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsJKlist = new DataSet(); Hashtable input = new Hashtable(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "接口列表", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsJKlist = (DataSet)(return_ht["return_ds"]); JK_host_selt.DataSource = dsJKlist.Tables[0].DefaultView; JK_host_selt.DataTextField = "JK_host"; JK_host_selt.DataValueField = "JK_host"; JK_host_selt.DataBind(); JK_host_selt.Items.Insert(0, new ListItem("请选择", "请选择")); TextBox1.Text = "请选择"; } else { //读取数据库出错。。。 TextBox1.Text = ""; JK_host_selt.DataSource = null; JK_host_selt.DataBind(); //Response.Write(return_ht["return_errmsg"].ToString()); lblerrmsg.Text = return_ht["return_errmsg"].ToString(); lblerrmsg.Visible = true; } }
/// <summary> /// 根据传入的方法中文名获取方法的日志类型、方法英文名、接口名称、接口地址信息。 /// </summary> /// <param name="methodname"></param> /// <returns></returns> // [WebMethod(Description = "获取方法当前的日志类型等基本信息")] private DataSet GetFFinfo(string methodname, I_Dblink I_DBL) { try { //数据库连接初始化 // I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsGXlist = new DataSet(); Hashtable input = new Hashtable(); input["@FF_yewuname"] = methodname; //日志唯一标示 string sql_select = "select FF_name,FF_guid,FF_log,JK_guid,JK_host,JK_path from AAA_ipcFF as FF left join AAA_ipcJK as JK on FF.FF_JK_guid=JK_guid where FF.FF_yewuname=@FF_yewuname"; DataSet dsreturn = new DataSet(); Hashtable return_ht = I_DBL.RunParam_SQL(sql_select, "日志类型", input); if ((bool)return_ht["return_float"]) { return((DataSet)return_ht["return_ds"]); } else { return(null); } } catch { return(null); } }
public string SaveCallLog_end(string LOG_guid, string LOG_begintime, string LOG_alltime, string LOG_zt, string LOG_trytext1, string LOG_xingneng) { try { //数据库连接初始化(实际上这里应该是用内存数据库,以及内存文件系统。 加快速度。暂不实现) I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable input = new Hashtable(); input["@LOG_guid"] = LOG_guid; //日志唯一标示 input["@LOG_begintime"] = LOG_begintime; //首次执行开始时间 input["@LOG_alltime"] = LOG_alltime; //执行消耗时间 input["@LOG_zt"] = LOG_zt; //当前状态 input["@LOG_trytext1"] = LOG_trytext1; //首次执行调试信息 input["@LOG_xingneng"] = LOG_xingneng; //性能调试信息 Hashtable return_ht = I_DBL.RunParam_SQL("update AAA_ipcLOG set LOG_begintime=@LOG_begintime,LOG_alltime=@LOG_alltime,LOG_zt=@LOG_zt,LOG_trytext1=@LOG_trytext1,LOG_xingneng=@LOG_xingneng where LOG_guid=@LOG_guid ", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { return("ok"); } else { return(return_ht["return_errmsg"].ToString()); } } catch (Exception exx) { return(exx.ToString()); } }
//读取数据库,显示接口关系。 private void beginshowJK() { string sql = " select (JK_host + '[' + JK_path + ']') as showtxt,JK_guid from AAA_ipcJK where JK_open = 1 order by JK_host asc,JK_path asc "; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsJKlist = new DataSet(); Hashtable input = new Hashtable(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "接口列表", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsJKlist = (DataSet)(return_ht["return_ds"]); GX_JK_guid.DataSource = dsJKlist.Tables["接口列表"].DefaultView; GX_JK_guid.DataTextField = "showtxt"; GX_JK_guid.DataValueField = "JK_guid"; GX_JK_guid.DataBind(); //Response.Write(dsGXlist.Tables[0].Rows.Count.ToString()); if (GX_JK_guid.Items.Count > 0) { GX_JK_guid.SelectedIndex = 0; } } else { //读取数据库出错。。。 GX_JK_guid.DataSource = null; GX_JK_guid.DataBind(); Response.Write(return_ht["return_errmsg"].ToString()); } }
/// <summary> /// 根据合同编号获取其相应的未完成的提货单的相关信息 /// </summary> /// <param name="I_DBL"></param> /// <param name="htid"></param> /// <returns></returns> public DataTable GetTHRelativeHT(I_Dblink I_DBL, string htid) { String sql = "select THDID,HTID,PrdID,DJHK,THDZT,THDstate from tTHDXXB where THDZT !='完成' and HTID=@HTID "; Hashtable htin = new Hashtable(); htin["@HTID"] = htid; Hashtable ht = I_DBL.RunParam_SQL(sql, "dtResult", htin); if ((bool)(ht["return_float"])) { DataSet ds = (DataSet)ht["return_ds"]; if (ds != null && ds.Tables["dtResult"] != null) { DataTable th = new DataTable(); th = ds.Tables["dtResult"].Copy(); th.TableName = "相关信息"; return(th); } else { return(null); } } else { return(null); } }
/// <summary> /// 根据合同编号获取买方账号的经纪人以及区代等相关信息 /// </summary> /// <param name="I_DBL"></param> /// <param name="htbh"></param> /// <returns></returns> public DataTable GetBuyAccountNumbersByHTID(I_Dblink I_DBL, string htbh) { String sql = "select BA.UserId as '区代账号',GLJJRuserid as '经纪人账号' ,HTID as '合同编号' ,BSSQY as '所属区域' , BUserId as '买方账号', BFullName as '买方名称' from tHTXXB left join (select * from uQYDLXXB where uQYDLXXB.SFYX='T' ) as BA on BSSQY= (DLQY_Prov +'|'+ DLQY_city +'|'+DLQY_qu ) left join uUserInfo on BUserId=uUserInfo.UserId where HTID=@HTID "; Hashtable htin = new Hashtable(); htin["@HTID"] = htbh; Hashtable ht = I_DBL.RunParam_SQL(sql, "dtResult", htin); if ((bool)(ht["return_float"])) { DataSet ds = (DataSet)ht["return_ds"]; if (ds != null && ds.Tables["dtResult"] != null && ds.Tables["dtResult"].Rows.Count == 1) { DataTable AccountNumber = new DataTable(); AccountNumber = ds.Tables["dtResult"].Copy(); AccountNumber.TableName = "关联账号信息"; return(AccountNumber); } else { return(null); } } else { return(null); } }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //以可排序guid方式生成 //string guid = CombGuid.GetNewCombGuid("D"); //以两位年+两位月+两位日+6位序列顺序号方式生成 string guid = CombGuid.GetNewCombGuid("U"); param.Add("@UAid", guid); param.Add("@Uloginname", ht_forUI["Uloginname"].ToString()); //对密码进行加密 string mima_enc = StringOP.encMe(ht_forUI["Uloginpassword"].ToString().Trim(), "mima"); param.Add("@Uloginpassword", mima_enc); param.Add("@xingming", ht_forUI["xingming"].ToString()); param.Add("@xingbie", ht_forUI["xingbie"].ToString()); param.Add("@nianling", ht_forUI["nianling"].ToString()); param.Add("@zhuangtai", ht_forUI["zhuangtai"].ToString()); param.Add("@beizhu", ht_forUI["beizhu"].ToString()); alsql.Add("INSERT INTO auth_users_auths(UAid ,Uloginname,Uloginpassword) VALUES(@UAid ,@Uloginname,@Uloginpassword )"); alsql.Add("INSERT INTO ZZZ_userinfo(UAid ,xingming,xingbie,nianling,zhuangtai,beizhu) VALUES(@UAid ,@xingming,@xingbie,@nianling,@zhuangtai,@beizhu)"); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "新增成功!"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
//读取数据库,显示接口。 private void beginshow() { string sql = " select "; sql = sql + " FF.FF_guid as 方法唯一标示,FF.FF_JK_guid as接口唯一标示,JK_host as 接口域名,JK.JK_path as 接口地址, "; sql = sql + " FF.FF_yewuname as 业务名称,FF.FF_name as 方法名,FF.FF_retype as 返回值类型,FF.FF_canshu as 参数类型, "; sql = sql + " FF.FF_shuoming as 方法注释, (CASE FF.FF_open WHEN '1' THEN '有效' WHEN '0' THEN '禁用' ELSE '未知' END) as 方法是否有效, "; sql = sql + " (CASE FF.FF_zt WHEN '1' THEN '活着' WHEN '0' THEN '挂了' ELSE '未知' END) as 方法目前状态, "; sql = sql + " (CASE FF.FF_CorE WHEN '1' THEN '有插入或更新操作' WHEN '0' THEN '仅查询操作' ELSE '未知' END) as 操作特点, FF.FF_log as 日志设置,FF.FF_addtime as 添加时间,FF.FF_edittime as 最后一次修改时间 "; sql = sql + " from AAA_ipcFF as FF left join AAA_ipcJK as JK on JK.JK_guid=FF.FF_JK_guid "; sql = sql + " where FF.FF_guid=@FF_guid"; I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); DataSet dsFFlist = new DataSet(); Hashtable input = new Hashtable(); input["@FF_guid"] = Request ["FF_guid"].ToString(); Hashtable return_ht = I_DBL.RunParam_SQL(sql, "方法信息", input); if ((bool)(return_ht["return_float"])) //说明执行完成 { dsFFlist = (DataSet)(return_ht["return_ds"]); lblJK_host.Text = dsFFlist.Tables[0].Rows[0]["接口域名"].ToString(); lblJK_path.Text = dsFFlist.Tables[0].Rows[0]["接口地址"].ToString(); lblFF_guid.Text = dsFFlist.Tables[0].Rows[0]["方法唯一标示"].ToString(); FF_yewuname.Text = dsFFlist.Tables[0].Rows[0]["业务名称"].ToString(); lblFF_yewuname.Text = dsFFlist.Tables[0].Rows[0]["业务名称"].ToString(); FF_name.Text = dsFFlist.Tables[0].Rows[0]["方法名"].ToString(); lblFF_name.Text = dsFFlist.Tables[0].Rows[0]["方法名"].ToString(); FF_retype.Text = dsFFlist.Tables[0].Rows[0]["返回值类型"].ToString(); lblFF_retype.Text = dsFFlist.Tables[0].Rows[0]["返回值类型"].ToString(); FF_canshu.Text = dsFFlist.Tables[0].Rows[0]["参数类型"].ToString(); lblFF_canshu.Text = dsFFlist.Tables[0].Rows[0]["参数类型"].ToString(); FF_shuoming.Text = dsFFlist.Tables[0].Rows[0]["方法注释"].ToString(); lblFF_shuoming.Text = dsFFlist.Tables[0].Rows[0]["方法注释"].ToString(); FF_open.SelectedValue = dsFFlist.Tables[0].Rows[0]["方法是否有效"].ToString() == "有效" ? "1" : "0"; lblFF_open.Text = dsFFlist.Tables[0].Rows[0]["方法是否有效"].ToString() == "有效" ? "1" : "0"; FF_CorE.SelectedValue = dsFFlist.Tables[0].Rows[0]["操作特点"].ToString() == "仅查询操作" ? "0" : "1"; lblFF_CorE.Text = dsFFlist.Tables[0].Rows[0]["操作特点"].ToString() == "仅查询操作" ? "0" : "1"; string fflog = dsFFlist.Tables[0].Rows[0]["日志设置"].ToString(); foreach (ListItem item in FF_Log.Items) { if (fflog.IndexOf(item.Text) >= 0) { item.Selected = true; } } lblFF_log.Text = fflog; } else { Response.Write(return_ht["return_errmsg"].ToString()); } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public string NRS_DEL(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //存在有效目标才删除 if (ht_forUI.Contains("ajaxrun") && ht_forUI["ajaxrun"].ToString() == "del" && ht_forUI.Contains("oper") && ht_forUI["oper"].ToString() == "del" && ht_forUI.Contains("id") && ht_forUI["id"].ToString().Trim() != "") { //开始真正的处理,这里只是演示,所以直接在这里写业务逻辑代码了 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable param = new Hashtable(); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); //删除数据表里的数据 string[] delids = ht_forUI["id"].ToString().Split(','); for (int d = 0; d < delids.Length; d++) { //sys开头的,不允许删除。为了防止意外导致系统出错。 if (delids[d].IndexOf("sys_") < 0) { param.Add("@FID_" + d, delids[d]); alsql.Add("delete FUP_FormsMainInfo where FID=@FID_" + d); alsql.Add("delete FUP_FormsSubDialog where DID_FSID in (select FSID from FUP_FormsSubInfo where FS_FID=@FID_" + d + ")"); alsql.Add("delete FUP_FormsSubInfo where FS_FID=@FID_" + d); } } return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { ; } else { ; } } return(""); }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //pid, pname, pmclass, pmclass_a, pmclass_b, pbeizhu, piskzph, plaiyua, pdanwei_a, pdanwei_b, pdanwei_gongshi, pyx param.Add("@pid", ht_forUI["pid"].ToString()); param.Add("@pname", ht_forUI["pname"].ToString()); param.Add("@pguige", ht_forUI["pguige"].ToString()); param.Add("@pmclass", ht_forUI["pmclass"].ToString()); param.Add("@pmclass_a", ht_forUI["pmclass_a"].ToString()); param.Add("@pmclass_b", ht_forUI["pmclass_b"].ToString()); param.Add("@pbeizhu", ht_forUI["pbeizhu"].ToString()); param.Add("@piskzph", ht_forUI["piskzph"].ToString()); param.Add("@plaiyua", ht_forUI["plaiyua"].ToString()); param.Add("@pdanwei_a", ht_forUI["pdanwei_a"].ToString()); param.Add("@pdanwei_b", ht_forUI["pdanwei_b"].ToString()); param.Add("@pdanwei_gongshi", ht_forUI["pdanwei_gongshi"].ToString()); param.Add("@pyx", ht_forUI["pyx"].ToString()); alsql.Add("INSERT INTO ZZZ_products(pid, pname,pguige, pmclass, pmclass_a, pmclass_b, pbeizhu, piskzph, plaiyua, pdanwei_a, pdanwei_b, pdanwei_gongshi, pyx) VALUES(@pid, @pname,@pguige, @pmclass, @pmclass_a, @pmclass_b, @pbeizhu, @piskzph, @plaiyua, @pdanwei_a, @pdanwei_b, @pdanwei_gongshi, @pyx)"); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "新增成功!"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 编辑数据前获取数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_EDIT_INFO(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里省略 //开始真正的处理,这里只是演示,所以直接在这里写业务逻辑代码了 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); Hashtable param = new Hashtable(); param.Add("@DDID", ht_forUI["idforedit"].ToString()); return_ht = I_DBL.RunParam_SQL("select top 1 * from ZZZ_kaoqin_dd where DDID=@DDID", "数据记录", param); if ((bool)(return_ht["return_float"])) { DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy(); if (redb.Rows.Count < 1) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "没有找到指定数据!"; return(dsreturn); } dsreturn.Tables.Add(redb); dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = ""; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "意外错误,获取失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //以可排序guid方式生成 string guid = CombGuid.GetNewCombGuid("F"); param.Add("@FID", guid); param.Add("@Fmingcheng", ht_forUI["Fmingcheng"].ToString()); param.Add("@Fleixing", ht_forUI["Fleixing"].ToString()); if (ht_forUI.Contains("allpath_file1")) { param.Add("@Ffujian", ht_forUI["allpath_file1"].ToString()); } else { param.Add("@Ffujian", ""); } param.Add("@Fjianshu", ht_forUI["Fjianshu"].ToString()); alsql.Add("INSERT INTO ZZZ_WENDANG(FID, Fmingcheng, Fleixing, Ffujian, Fjianshu, Friqi ) VALUES(@FID, @Fmingcheng, @Fleixing, @Ffujian, @Fjianshu, getdate() )"); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "新增成功!{" + guid + "}"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //以可排序guid方式生成 //string guid = CombGuid.GetNewCombGuid("D"); //以两位年+两位月+两位日+6位序列顺序号方式生成 string guid = CombGuid.GetMewIdFormSequence("pSPXXB"); param.Add("@PrdID", guid); param.Add("@PrdName", ht_forUI["PrdName"].ToString()); param.Add("@GGXH", ht_forUI["GGXH"].ToString()); param.Add("@ZXBZ", ht_forUI["ZXBZ"].ToString()); param.Add("@FLBH", ht_forUI["FLBH"].ToString()); param.Add("@JJDW", ht_forUI["JJDW"].ToString()); param.Add("@JJPL", ht_forUI["JJPL"].ToString()); param.Add("@PrdDes", ht_forUI["PrdDes"].ToString()); param.Add("@ZZYQ", ht_forUI["ZZYQ"].ToString()); param.Add("@SPZT", ht_forUI["SPZT"].ToString()); param.Add("@ZTSM", ht_forUI["ZTSM"].ToString()); alsql.Add("INSERT INTO pSPXXB(PrdID,PrdName,GGXH,ZXBZ,FLBH,JJDW,JJPL,PrdDes,ZZYQ,SPZT,ZTSM) VALUES(@PrdID,@PrdName,@GGXH,@ZXBZ,@FLBH,@JJDW,@JJPL,@PrdDes,@ZZYQ,@SPZT,@ZTSM )"); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "新增成功!{" + guid + "}"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 增加数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_ADD(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里要根据具体业务逻辑处理 //开始真正的处理,根据业务逻辑操作数据库 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); Hashtable param = new Hashtable(); //以可排序guid方式生成 //string guid = CombGuid.GetNewCombGuid("D"); //以两位年+两位月+两位日+6位序列顺序号方式生成 string guid = CombGuid.GetMewIdFormSequence("AAA_jkpz"); param.Add("@KID", guid); param.Add("@Kname", ht_forUI["Kname"].ToString()); param.Add("@Kbeizhu", ht_forUI["Kbeizhu"].ToString()); param.Add("@Kyanse", ht_forUI["Kyanse"].ToString()); param.Add("@Kfangfa", ht_forUI["Kfangfa"].ToString()); param.Add("@Krungroup", ht_forUI["Krungroup"].ToString()); param.Add("@Kruntime_ds", ht_forUI["Kruntime_ds"].ToString()); param.Add("@Kruntime_jg", ht_forUI["Kruntime_jg"].ToString()); param.Add("@Kused", ht_forUI["Kused"].ToString()); alsql.Add("INSERT INTO AAA_jkpz(KID, Kname, Kbeizhu, Kyanse, Kfangfa, Krungroup, Kruntime_ds, Kruntime_jg, Kused) VALUES(@KID, @Kname, @Kbeizhu, @Kyanse, @Kfangfa, @Krungroup, @Kruntime_ds, @Kruntime_jg, @Kused )"); return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "新增成功!"; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "系统故障,保存失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }
/// <summary> /// 自定义按钮处理 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public string NRS_ZDY_tijiaojihua(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //存在有效目标才删除 if (ht_forUI.Contains("zdyname") && ht_forUI["xuanzhongzhi"].ToString() != "") { if (ht_forUI["xuanzhongzhi"].ToString().Trim() == "") { return("未选中任何要操作的数据。"); } //开始真正的处理,这里只是演示,所以直接在这里写业务逻辑代码了 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable param = new Hashtable(); Hashtable return_ht = new Hashtable(); ArrayList alsql = new ArrayList(); //数据表里的数据 string[] ids = ht_forUI["xuanzhongzhi"].ToString().Split(','); for (int d = 0; d < ids.Length; d++) { if (ids[d].Trim() != "") { param.Add("@GID_" + d, ids[d]); alsql.Add("UPDATE ZZZ_workplan SET Gzhuangtai='提交' where Gzhuangtai='草稿' and GID =@GID_" + d); } } return_ht = I_DBL.RunParam_SQL(alsql, param); if ((bool)(return_ht["return_float"])) { return("提交计划完成!"); } } return("提交计划失败,发生错误"); }
/// <summary> /// 编辑数据前获取数据 /// </summary> /// <param name="parameter_forUI">前台表单传来的参数</param> /// <returns></returns> public DataSet NRS_EDIT_INFO(DataTable parameter_forUI) { //接收转换参数 Hashtable ht_forUI = new Hashtable(); for (int i = 0; i < parameter_forUI.Rows.Count; i++) { ht_forUI[parameter_forUI.Rows[i]["参数名"].ToString()] = parameter_forUI.Rows[i]["参数值"].ToString(); } //初始化返回值 DataSet dsreturn = initReturnDataSet().Clone(); dsreturn.Tables["返回值单条"].Rows.Add(new string[] { "err", "初始化" }); //参数合法性各种验证,这里省略 //开始真正的处理,这里只是演示,所以直接在这里写业务逻辑代码了 I_Dblink I_DBL = (new DBFactory()).DbLinkSqlMain(""); Hashtable return_ht = new Hashtable(); Hashtable param = new Hashtable(); param.Add("@UAid", ht_forUI["idforedit"].ToString()); return_ht = I_DBL.RunParam_SQL("select top 1 *, sheng as yhb_city_Promary_shengshiqu, shi as yhb_city_City_shengshiqu, qu as yhb_city_Qu_shengshiqu from view_ZZZ_userinfo_ex where UAid=@UAid", "数据记录", param); if ((bool)(return_ht["return_float"])) { DataTable redb = ((DataSet)return_ht["return_ds"]).Tables["数据记录"].Copy(); if (redb.Rows.Count < 1) { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "没有找到指定数据!"; return(dsreturn); } redb.Rows[0]["Uloginpassword"] = StringOP.uncMe(redb.Rows[0]["Uloginpassword"].ToString(), "mima"); dsreturn.Tables.Add(redb); dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "ok"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = ""; } else { dsreturn.Tables["返回值单条"].Rows[0]["执行结果"] = "err"; dsreturn.Tables["返回值单条"].Rows[0]["提示文本"] = "意外错误,获取失败:" + return_ht["return_errmsg"].ToString(); } return(dsreturn); }