Exemplo n.º 1
0
Arquivo: Counties.cs Projeto: mnisl/OD
		///<summary>Must run UsedBy before running this.</summary>
		public static void Delete(County Cur){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),Cur);
				return;
			}
			string command= "DELETE from county WHERE CountyName = '"+POut.String(Cur.CountyName)+"'";
			Db.NonQ(command);
		}
Exemplo n.º 2
0
Arquivo: Counties.cs Projeto: mnisl/OD
		///<summary>Updates the Countyname and code in the County table, and also updates all patients that were using the oldCounty name.</summary>
		public static void Update(County county){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),county);
				return;
			}
			//Can't use CRUD here because we're updating by the OldCountyName
			string command = "UPDATE county SET "
				+"CountyName ='"  +POut.String(county.CountyName)+"'"
				+",CountyCode ='" +POut.String(county.CountyCode)+"'"
				+" WHERE CountyName = '"+POut.String(county.OldCountyName)+"'";
			Db.NonQ(command);
			//then, update all patients using that County
			command = "UPDATE patient SET "
				+"County ='"  +POut.String(county.CountyName)+"'"
				+" WHERE County = '"+POut.String(county.OldCountyName)+"'";
			Db.NonQ(command);
		}
Exemplo n.º 3
0
        ///<summary>Updates the Countyname and code in the County table, and also updates all patients that were using the oldCounty name.</summary>
        public static void Update(County county)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), county);
                return;
            }
            //Can't use CRUD here because we're updating by the OldCountyName
            string command = "UPDATE county SET "
                             + "CountyName ='" + POut.String(county.CountyName) + "'"
                             + ",CountyCode ='" + POut.String(county.CountyCode) + "'"
                             + " WHERE CountyName = '" + POut.String(county.OldCountyName) + "'";

            Db.NonQ(command);
            //then, update all patients using that County
            command = "UPDATE patient SET "
                      + "County ='" + POut.String(county.CountyName) + "'"
                      + " WHERE County = '" + POut.String(county.OldCountyName) + "'";
            Db.NonQ(command);
        }
Exemplo n.º 4
0
Arquivo: Counties.cs Projeto: mnisl/OD
		///<summary>Need to make sure Countyname not already in db.</summary>
		public static long Insert(County county){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				return Meth.GetLong(MethodBase.GetCurrentMethod(),county);
			}
			return Crud.CountyCrud.Insert(county);
		}