123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Data;
- using SysBaseLibs;
- using System.Web.Script.Serialization;
- namespace SysDataLibs.TableClass
- {
- #region SellerHasStall
- public class SellerHasStall_info : ITableInfo
- {
- #region SellerHasStall表 字段信息
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 经营户编号;
- /// </summary>
- public const string cSellerID = "SellerID";
- /// <summary>
- /// 为关键字段: Y --- PrimaryKey;
- /// 自动增长: N;
- /// 数据类型: int;
- /// 数据长度: 4;
- /// 是否允许为空: N;
- /// 默认值: ;
- /// 描述: 摊位编号;
- /// </summary>
- public const string cStallID = "StallID";
- #endregion
- public SellerHasStall_info() { }
- public SellerHasStall_info(DataRow poRow)
- {
- CreateTableInfo(poRow);
- }
- public void CreateTableInfo(DataRow poRow)
- {
- _SellerID = UtilStr.StrFromObj(poRow[cSellerID]);
- _StallID = UtilStr.StrFromObj(poRow[cStallID]);
- }
- public SellerHasStall_info(string pcSellerID, string pcStallID, DBConnSql poDBConn)
- {
- if (pcSellerID.Trim().Length > 0 && pcStallID.Trim().Length > 0 && poDBConn != null)
- {
- string lcSql = "select * from " + Tn.SellerHasStall + " where SellerID='" + pcSellerID + "' and StallID='" + pcStallID + "'";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount == 1)
- {
- loQuery.MoveFirst();
- CreateTableInfo(loQuery.CurrentRow);
- }
- }
- }
- private string _SellerID = "";
- public string SellerID
- {
- get { return _SellerID; }
- set { _SellerID = value; }
- }
- private string _StallID = "";
- public string StallID
- {
- get { return _StallID; }
- set { _StallID = value; }
- }
- [ScriptIgnore]
- public rsXmlNode DataXMLNode
- {
- get
- {
- rsXmlNode loMainNode = new rsXmlNode("SellerHasStallRecord", "");
- rsXmlNode loNode = null;
- loNode = new rsXmlNode(cSellerID, SellerID);
- loMainNode.AddChild(loNode);
- loNode = new rsXmlNode(cStallID, StallID);
- loMainNode.AddChild(loNode);
- return loMainNode;
- }
- }
- public string InsertSql()
- {
- return " insert into " + Tn.SellerHasStall + " " +
- " (" + cSellerID + "," + cStallID + ") " +
- " values (" + _SellerID + "," + _StallID + ") ";
- }
- public string UpdateSql()
- {
- return "";
- }
- public string DeleteSql()
- {
- return "Delete " + Tn.SellerHasStall + " where " + cSellerID + "=" + _SellerID + " and " + cStallID + "=" + _StallID + "";
- }
- public static string GetStallInfobySellerId(string pcSellerId, DBConnSql poDBConn)
- {
- string lcRetVal = "";
- string lcSql = " select * from SellerHasStall where SellerID =" + pcSellerId + "";
- rsQuery loQuery = poDBConn.OpenQuery(lcSql);
- if (loQuery != null && loQuery.IsOpened && loQuery.RecCount > 0)
- {
- loQuery.MoveFirst();
- for (int i = 0; i < loQuery.RecCount; i++)
- {
- lcRetVal += (lcRetVal == "" ? "" : ",") + loQuery.GetString("StallID");
- loQuery.MoveNext();
- }
- }
- return lcRetVal;
- }
- public static bool UpdateStallBySellerId(string pcSellerId, string pcStallList, DBConnSql poConn)
- {
- bool lbRetVal = false;
- string lcSql = " Delete SellerHasStall where SellerID=" + pcSellerId + " \r\n ";
- if (pcStallList.Trim().Length > 0)
- {
- Array loArr = UtilStr.StrToArrayEx(pcStallList, ",");
- if (loArr != null && loArr.Length > 0)
- {
- foreach (string lcStallId in loArr)
- {
- string Stallid = UtilStr.FormatStr(lcStallId);
- if (lcStallId.Trim().Length > 0)
- lcSql += " insert into SellerHasStall (SellerID,StallID) values (" + pcSellerId + "," + Stallid + ") \r\n ";
- }
- }
- }
- if (poConn != null)
- {
- lbRetVal = poConn.ExcuteSqlTran(lcSql);
- }
- return lbRetVal;
- }
- }
- #endregion
- #region
- public class SellerHasStall_Qry : rsQuery
- {
- public Int64 SellerID
- {
- get { return GetInt(SellerHasStall_info.cSellerID); }
- // set { SetField(SellerHasStall_info.cSellerID, value); }
- }
- public Int64 StallID
- {
- get { return GetInt(SellerHasStall_info.cStallID); }
- // set { SetField(SellerHasStall_info.cStallID, value); }
- }
- }
- #endregion
- }
|