using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using SysBaseLibs;
using System.Web.Script.Serialization;
using System.Web.UI.HtmlControls;
namespace SysDataLibs.TableClass
{
public partial class MarketSellers_info
{
///
/// 证照信息
///
///
///
///
//public static void PrintMarketSellerWarrantInfo(HtmlTable poTable, string SellerID, UserSession poSession)
//{
// if (poTable != null && SellerID.Trim().Length > 0 && poSession != null && poSession.DBConn != null)
// {
// string lcSql = "select * from " + Tn.SellerHasWarrant + " where " + SellerHasWarrant_info.cSellerID + "=" + SellerID + "";
// rsQuery loQuery = poSession.DBConn.OpenQuery(lcSql);
// //行标题
// HtmlTableRow loRow = new HtmlTableRow();
// HtmlTableCell loCell = new HtmlTableCell();
// string lcColor = "#ffffff";
// loRow.Height = "20";
// loCell.Attributes.Add("bgcolor", "#8caae7");
// loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerHtml = " 证照信息 ";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// //列标题
// loRow = new HtmlTableRow();
// loRow.Height = "19";
// lcColor = "#c6dbff";
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// loCell.Align = "center";
// loCell.InnerHtml = "编号";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// loCell.ColSpan = 2;
// loCell.Align = "center";
// loCell.InnerHtml = "证件名称";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// //loCell.ColSpan = 2;
// loCell.Align = "center";
// loCell.InnerHtml = "证件号码";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// //loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerHtml = "起始日期";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// //loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerHtml = "截止日期";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// //loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerHtml = "附件";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
// {
// //----------------------------------------------------------
// loQuery.SortBy(SellerHasWarrant_info.cValidEndTime, false);
// loQuery.MoveFirst();
// for (int i = 0; i < loQuery.RecCount; i++)
// {
// lcColor = "#ffffff";
// loRow = new HtmlTableRow();
// loRow.Height = "19";
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("bgcolor", lcColor);
// loCell.Align = "center";
// loCell.InnerText = (i + 1) + "";
// loRow.Cells.Add(loCell);
// //证件类型
// loCell = new HtmlTableCell();
// loCell.Align = "center";
// string lcTitle = loQuery.GetString("WarrantTypeID");
// WarrantType_info LTbl = new WarrantType_info();
// string lcErrMsg = "";
// lcSql = "select * from " + Tn.WarrantType + " where " + WarrantType_info.cWarrantTypeID + " =" + lcTitle + " ";
// SysDataLibs.AppEnv.GetTableInfo(lcSql, LTbl, poSession.DBConn, ref lcErrMsg);
// loCell.ColSpan = 2;
// lcSql = "select " + Sys_Status_info.cDisplayValue + " from " + Tn.Sys_Status;
// string tempc2 = loQuery.GetString("WarrantStyle").Trim();
// //从 cn_SysStatus 里获取相应值
// lcSql += " where TableName='SellerHasWarrant' and ColName='WarrantStyle' and CodeValue ='" + tempc2 + "'";
// string tempc3 = SysDataLibs.AppEnv.GetTextWithSQL(lcSql, Sys_Status_info.cDisplayValue, poSession.DBConn);
// //tempc2 =="1" 执照类别为 正式 则不显示
// loCell.InnerText = LTbl.Name + (tempc2 == "1" ? "" : " [ " + tempc3 + " ]");//string.Format("
{1}
\n", loQuery.GetString("WarrantTypeID"), lcTitle);
// loCell.Attributes.Add("bgcolor", lcColor);
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// //loCell.ColSpan = 2;
// loCell.Align = "center";
// loCell.InnerText = loQuery.GetString("WarrantNumber");
// loCell.Attributes.Add("bgcolor", lcColor);
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Align = "center";
// loCell.InnerText = string.Format("{0:d}", loQuery.GetDateTime("ValidStartTime"));
// loCell.Attributes.Add("bgcolor", lcColor);
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Align = "center";
// loCell.InnerText = string.Format("{0:d}", loQuery.GetDateTime("ValidEndTime"));
// loCell.Attributes.Add("bgcolor", lcColor);
// loRow.Cells.Add(loCell);
// string lcSql1 = "select * from Sys_AttachFiles where TableID= '" + Tn.SellerHasWarrant + "' and ColumnID='ID' AND SourceKey='" + loQuery.GetString("ID") + "'";
// rsQuery loQry = poSession.DBConn.OpenQuery(lcSql1);
// loCell = new HtmlTableCell();
// loCell.Align = "center";
// if (loQry != null && loQry.IsOpened && loQry.RecCount > 0)
// {
// Sys_AttachFiles_info loInfo = new Sys_AttachFiles_info(loQry.CurrentRow);
// loCell.InnerHtml = "" + loInfo.FileTitle + "";
// }
// loCell.Attributes.Add("bgcolor", lcColor);
// loRow.Cells.Add(loCell);
// poTable.Rows.Add(loRow);
// loQuery.MoveNext();
// }
// }
// else
// {
// //行标题
// loRow = new HtmlTableRow();
// loCell = new HtmlTableCell();
// lcColor = "#ffffff";
// loRow.Height = "19";
// loCell.Attributes.Add("bgcolor", lcColor);
// loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerText = "没有相关记录";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// }
// }
//}
//信用评比情况
//public static void PrintMarketSellerCreditInfo(HtmlTable poTable, string SellerID, UserSession poSession)
//{
// if (poTable != null && SellerID.Trim().Length > 0 && poSession != null && poSession.DBConn != null)
// {
// //行标题
// HtmlTableRow loRow = new HtmlTableRow();
// HtmlTableCell loCell = new HtmlTableCell();
// string lcColor = "";
// //loRow.Height = "20";
// //loCell.Attributes.Add("bgcolor", "#8caae7");
// loCell.ColSpan = 7;
// loCell.Attributes.Add("class", "tdHeadTitleSmall");
// loCell.Align = "center";
// loCell.InnerHtml = "信用评比情况";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// //列标题
// loRow = new HtmlTableRow();
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("class", "tdTableHeader");
// loCell.Align = "center";
// loCell.InnerHtml = "序号";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("class", "tdTableHeader");
// loCell.ColSpan = 3;
// loCell.InnerHtml = "信誉等级";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("class", "tdTableHeader");
// loCell.InnerHtml = "得分";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// loCell.ColSpan = 2;
// loCell.Attributes.Add("class", "tdTableHeader");
// loCell.InnerHtml = "评级时间";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// //获取近两年的记录
// string lcSql = "select * from " + Tn.vwSellerEvalRpt + " where " + vwSellerEvalRpt_info.cSellerID + "=" + SellerID + " and " + vwSellerEvalRpt_info.cYear + "> '" + DateTime.Now.AddYears(-2).Year + "' order by Year Desc , Month desc ";
// rsQuery loQuery = poSession.DBConn.OpenQuery(lcSql);
// if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
// {
// //loQuery.SortBy(vwSellerEvalRpt_info.cValidEndTime, false);
// loQuery.MoveFirst();
// for (int i = 0; i < loQuery.RecCount; i++)
// {
// lcColor = "#ffffff";
// loRow = new HtmlTableRow();
// loCell = new HtmlTableCell();
// // loCell.Attributes.Add("class", "td2");
// loCell.Align = "center";
// loCell.InnerHtml = (i + 1) + "";
// loRow.Cells.Add(loCell);
// // 信誉等级
// loCell = new HtmlTableCell();
// // loCell.Attributes.Add("class", "td2");
// loCell.ColSpan = 3;
// loCell.Align = "center";
// loCell.InnerHtml = SellerEvalGrade_info.GetRankByScore(loQuery.GetInt(vwSellerEvalRpt_info.cTotalScore));
// loRow.Cells.Add(loCell);
// // 信誉分值
// loCell = new HtmlTableCell();
// // loCell.Attributes.Add("class", "td2");
// loCell.Align = "center";
// loCell.InnerHtml = loQuery.GetInt(vwSellerEvalRpt_info.cTotalScore) + "";
// loRow.Cells.Add(loCell);
// loCell = new HtmlTableCell();
// // loCell.Attributes.Add("class", "td2");
// loCell.ColSpan = 2;
// loCell.Align = "center";
// loCell.InnerHtml = loQuery.GetString(vwSellerEvalRpt_info.cYear) + "年" + loQuery.GetString(vwSellerEvalRpt_info.cMonth) + "月";
// loRow.Cells.Add(loCell);
// poTable.Rows.Add(loRow);
// loQuery.MoveNext();
// }
// }
// else
// {
// //行标题
// loRow = new HtmlTableRow();
// loCell = new HtmlTableCell();
// loCell.Attributes.Add("class", "td2");
// loCell.ColSpan = 7;
// loCell.Align = "center";
// loCell.InnerHtml = "没有相关记录";
// loRow.Cells.Add(loCell);
// //
// poTable.Rows.Add(loRow);
// }
// }
//}
//---日常经营行为记录
public static string PrintMarketSellerViolations(string sellerId, UserSession poSession)
{
if (sellerId.Trim().Length > 0 && poSession?.DBConn != null)
{
string lcSql = "select * from " + Tn.SellerViolations + " where " + SellerViolations_info.cSellerID + "=" + sellerId;
rsQuery loQuery = poSession.DBConn.OpenQuery(lcSql);
if (loQuery.IsOpened && loQuery.RecCount > 0)
return loQuery.CurrentTable.ToJson("yyyy-MM-dd");
return "";
}
return "";
}
}
}