示例#1
0
		///<summary>Updates one Statementm in the database.</summary>
		internal static void Update(Statementm statementm){
			string command="UPDATE statementm SET "
				+"PatNum      =  "+POut.Long  (statementm.PatNum)+", "
				+"DateSent    =  "+POut.Date  (statementm.DateSent)+", "
				+"DocNum      =  "+POut.Long  (statementm.DocNum)+" "
				+"WHERE CustomerNum = "+POut.Long(statementm.CustomerNum)+" AND StatementNum = "+POut.Long(statementm.StatementNum);
			Db.NonQ(command);
		}
示例#2
0
        ///<summary>Updates one Statementm in the database.</summary>
        internal static void Update(Statementm statementm)
        {
            string command = "UPDATE statementm SET "
                             + "PatNum      =  " + POut.Long(statementm.PatNum) + ", "
                             + "DateSent    =  " + POut.Date(statementm.DateSent) + ", "
                             + "DocNum      =  " + POut.Long(statementm.DocNum) + " "
                             + "WHERE CustomerNum = " + POut.Long(statementm.CustomerNum) + " AND StatementNum = " + POut.Long(statementm.StatementNum);

            Db.NonQ(command);
        }
示例#3
0
        ///<summary>Converts one Statement object to its mobile equivalent.  Warning! CustomerNum will always be 0.</summary>
        internal static Statementm ConvertToM(Statement statement)
        {
            Statementm statementm = new Statementm();

            //CustomerNum cannot be set.  Remains 0.
            statementm.StatementNum = statement.StatementNum;
            statementm.PatNum       = statement.PatNum;
            statementm.DateSent     = statement.DateSent;
            statementm.DocNum       = statement.DocNum;
            return(statementm);
        }
示例#4
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		internal static List<Statementm> TableToList(DataTable table){
			List<Statementm> retVal=new List<Statementm>();
			Statementm statementm;
			for(int i=0;i<table.Rows.Count;i++) {
				statementm=new Statementm();
				statementm.CustomerNum = PIn.Long  (table.Rows[i]["CustomerNum"].ToString());
				statementm.StatementNum= PIn.Long  (table.Rows[i]["StatementNum"].ToString());
				statementm.PatNum      = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				statementm.DateSent    = PIn.Date  (table.Rows[i]["DateSent"].ToString());
				statementm.DocNum      = PIn.Long  (table.Rows[i]["DocNum"].ToString());
				retVal.Add(statementm);
			}
			return retVal;
		}
示例#5
0
		///<summary>Usually set useExistingPK=true.  Inserts one Statementm into the database.</summary>
		internal static long Insert(Statementm statementm,bool useExistingPK){
			if(!useExistingPK) {
				statementm.StatementNum=ReplicationServers.GetKey("statementm","StatementNum");
			}
			string command="INSERT INTO statementm (";
			command+="StatementNum,";
			command+="CustomerNum,PatNum,DateSent,DocNum) VALUES(";
			command+=POut.Long(statementm.StatementNum)+",";
			command+=
				     POut.Long  (statementm.CustomerNum)+","
				+    POut.Long  (statementm.PatNum)+","
				+    POut.Date  (statementm.DateSent)+","
				+    POut.Long  (statementm.DocNum)+")";
			Db.NonQ(command);//There is no autoincrement in the mobile server.
			return statementm.StatementNum;
		}
示例#6
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        internal static List <Statementm> TableToList(DataTable table)
        {
            List <Statementm> retVal = new List <Statementm>();
            Statementm        statementm;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                statementm              = new Statementm();
                statementm.CustomerNum  = PIn.Long(table.Rows[i]["CustomerNum"].ToString());
                statementm.StatementNum = PIn.Long(table.Rows[i]["StatementNum"].ToString());
                statementm.PatNum       = PIn.Long(table.Rows[i]["PatNum"].ToString());
                statementm.DateSent     = PIn.Date(table.Rows[i]["DateSent"].ToString());
                statementm.DocNum       = PIn.Long(table.Rows[i]["DocNum"].ToString());
                retVal.Add(statementm);
            }
            return(retVal);
        }
示例#7
0
        ///<summary>Usually set useExistingPK=true.  Inserts one Statementm into the database.</summary>
        internal static long Insert(Statementm statementm, bool useExistingPK)
        {
            if (!useExistingPK)
            {
                statementm.StatementNum = ReplicationServers.GetKey("statementm", "StatementNum");
            }
            string command = "INSERT INTO statementm (";

            command += "StatementNum,";
            command += "CustomerNum,PatNum,DateSent,DocNum) VALUES(";
            command += POut.Long(statementm.StatementNum) + ",";
            command +=
                POut.Long(statementm.CustomerNum) + ","
                + POut.Long(statementm.PatNum) + ","
                + POut.Date(statementm.DateSent) + ","
                + POut.Long(statementm.DocNum) + ")";
            Db.NonQ(command);            //There is no autoincrement in the mobile server.
            return(statementm.StatementNum);
        }
示例#8
0
		///<summary>Converts one Statement object to its mobile equivalent.  Warning! CustomerNum will always be 0.</summary>
		internal static Statementm ConvertToM(Statement statement){
			Statementm statementm=new Statementm();
			//CustomerNum cannot be set.  Remains 0.
			statementm.StatementNum=statement.StatementNum;
			statementm.PatNum      =statement.PatNum;
			statementm.DateSent    =statement.DateSent;
			statementm.DocNum      =statement.DocNum;
			return statementm;
		}