예제 #1
0
		///<summary></summary>
		public static void Update(Reseller reseller) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),reseller);
				return;
			}
			Crud.ResellerCrud.Update(reseller);
		}
예제 #2
0
		///<summary></summary>
		public static long Insert(Reseller reseller) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				reseller.ResellerNum=Meth.GetLong(MethodBase.GetCurrentMethod(),reseller);
				return reseller.ResellerNum;
			}
			return Crud.ResellerCrud.Insert(reseller);
		}
예제 #3
0
        ///<summary>Checks the database to see if the reseller has customers with active repeating charges.</summary>
        public static bool HasActiveResellerCustomers(Reseller reseller)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetBool(MethodBase.GetCurrentMethod(), reseller));
            }
            string command = @"SELECT COUNT(*) FROM patient
				INNER JOIN registrationkey ON patient.PatNum=registrationkey.PatNum AND IsResellerCustomer=1
				INNER JOIN repeatcharge ON patient.PatNum=repeatcharge.PatNum
				INNER JOIN procedurecode ON repeatcharge.ProcCode=procedurecode.ProcCode
				INNER JOIN resellerservice ON procedurecode.CodeNum=resellerservice.CodeNum 
				WHERE ((DATE(repeatcharge.DateStart)<=DATE(NOW()) AND ((YEAR(repeatcharge.DateStop)<1880) OR (DATE(NOW()<DATE(repeatcharge.DateStop))))))
				AND patient.Guarantor="                 + POut.Long(reseller.PatNum) + " "
                             + "AND resellerservice.ResellerNum=" + POut.Long(reseller.ResellerNum) + " "
                             + "GROUP BY patient.PatNum";

            if (PIn.Int(Db.GetScalar(command)) > 0)
            {
                return(true);
            }
            return(false);
        }
예제 #4
0
		///<summary>Checks the database to see if the reseller has customers with active repeating charges.</summary>
		public static bool HasActiveResellerCustomers(Reseller reseller) {
			string command=@"SELECT COUNT(*) FROM patient
				INNER JOIN registrationkey ON patient.PatNum=registrationkey.PatNum AND IsResellerCustomer=1
				INNER JOIN repeatcharge ON patient.PatNum=repeatcharge.PatNum
				INNER JOIN procedurecode ON repeatcharge.ProcCode=procedurecode.ProcCode
				INNER JOIN resellerservice ON procedurecode.CodeNum=resellerservice.CodeNum 
				WHERE ((DATE(repeatcharge.DateStart)<=DATE(NOW()) AND ((YEAR(repeatcharge.DateStop)<1880) OR (DATE(NOW()<DATE(repeatcharge.DateStop))))))
				AND patient.Guarantor="+POut.Long(reseller.PatNum)+" "
				+"AND resellerservice.ResellerNum="+POut.Long(reseller.ResellerNum)+" "
				+"GROUP BY patient.PatNum";
			if(PIn.Int(Db.GetScalar(command))>0) {
				return true;
			}
			return false;
		}
예제 #5
0
		public FormResellerEdit(Reseller reseller) {
			ResellerCur=reseller;
			InitializeComponent();
			Lan.F(this);
			gridMain.ContextMenu=menuRightClick;
		}
예제 #6
0
		private void butAdd_Click(object sender,EventArgs e) {
			//Only Jordan should be able to add resellers.
			if(!Security.IsAuthorized(Permissions.SecurityAdmin)) {
				return;
			}
			FormPatientSelect FormPS=new FormPatientSelect();
			FormPS.ShowDialog();
			if(FormPS.DialogResult!=DialogResult.OK) {
				return;
			}
			if(Patients.GetLim(FormPS.SelectedPatNum).Guarantor!=FormPS.SelectedPatNum) {
				MsgBox.Show(this,"Customer must be a guarantor before they can be added as a reseller.");
				return;
			}
			if(Resellers.IsResellerFamily(FormPS.SelectedPatNum)) {
				MsgBox.Show(this,"Customer is already a reseller.  CustomerNum: "+FormPS.SelectedPatNum);
				return;
			}
			Reseller reseller=new Reseller();
			reseller.PatNum=FormPS.SelectedPatNum;
			Resellers.Insert(reseller);
			FillGrid();
		}