示例#1
0
        //from prop level
        private static AccountDetails.ContactPreferences SetContactPreferences(int CustomerID, int PropertyID)
        {
            string q = "Select Postonly, emailonly, PostAndEmail from core.LeaseholderContactPreferences where CustomerID = " + CustomerID.ToString() + " and PropertyID = " + PropertyID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            AccountDetails.ContactPreferences ad = new AccountDetails.ContactPreferences();
            ad = AccountDetails.ContactPreferences.postandemail; //sets default
            //set first to compare
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                if (dr[0] != DBNull.Value)
                {
                    ad = AccountDetails.ContactPreferences.Post;
                }
                if (dr[1] != DBNull.Value)
                {
                    ad = AccountDetails.ContactPreferences.email;
                }
                if (dr[2] != DBNull.Value)
                {
                    ad = AccountDetails.ContactPreferences.postandemail;
                }
            }

            return(ad);
        }
示例#2
0
        public static bool IsPasswordCorrect(string password, int CustomerID, int usertype)
        {
            bool r = false;

            try
            {
                List <string> ColNames = new List <string>();
                ColNames.Add("core.CustomerPortal.PWord");

                string q = "Select pword, salt from core.customerportal where customerID = "
                           + CustomerID.ToString() + " and usertype = " + usertype.ToString();

                DBConnectionObject db = GlobalVariables.GetConnection();
                DataTable          dt = db.Connection.GetDataTable(q);

                string pword = "";
                string salt  = "";

                if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
                {
                    pword = dt.Rows[0][0].ToString();
                    salt  = dt.Rows[0][0].ToString();
                }

                if (pword == BCrypt.Net.BCrypt.HashPassword(password, salt))
                {
                    r = true;
                }
            } catch { }
            return(r);
        }
示例#3
0
        public static void InsertReportUpdateFailure(int RepairID, int CustomerID)
        {
            List <string> c = new List <string>()
            {
                "repairID",
                "customerID",
                "_date"
            };

            List <string> p = new List <string>()
            {
                "@repairID",
                "@customerID",
                "@_date"
            };

            List <object> o = new List <object>()
            {
                RepairID,
                CustomerID,
                DateTime.Now
            };

            DBConnectionObject db = GlobalVariables.GetConnection();

            db.Connection.InsertCommandCurrent("core.RepairUpdateFailures", c, p, o);
        }
示例#4
0
        public static List <ServiceCharges> BudgetListByEstate(int EstateID)
        {
            string q = "select id, budgetname from core.ServiceChargeBudgets " +
                       "where EstateID = " + EstateID.ToString() +
                       " and _status = 'Completed' and not fundtypeid = 4 ";

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            List <ServiceCharges> r = new List <ServiceCharges>();

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                foreach (DataRow dr in dt.Rows)
                {
                    int Bid = 0;
                    int.TryParse(dr[0].ToString(), out Bid);
                    r.Add(new ServiceCharges
                    {
                        BudgetID   = Bid,
                        BudgetName = dr[1].ToString()
                    });
                }
            }
            return(r);
        }
示例#5
0
        public static List <Properties> GetAllOwnedProperties(int CustomerID)
        {
            string q = "select Core.Units.FlatOrApt, Core.Units.UnitNumber, Core.Units.Address1, Core.Units.Address2, Core.Units.Address3, " +
                       "Core.Units.Address4, Core.Units.Address5, Core.Units.ID FROM CORE.Units inner join core.PropertyOwnership on core.PropertyOwnership.UnitID = " +
                       "core.Units.ID where core.PropertyOwnership.OwnerID = " + CustomerID.ToString();

            List <Properties>  rList = new List <Properties>();
            DBConnectionObject db    = GlobalVariables.GetConnection();
            DataTable          dt    = db.Connection.GetDataTable(q);

            foreach (DataRow dr in dt.Rows)
            {
                int id = 0;
                if (dr[7] != DBNull.Value)
                {
                    id = Convert.ToInt32(dr[7]);
                }
                string Add1 = SetAddress1(dr[0].ToString(), dr[1].ToString(), dr[2].ToString());
                rList.Add(new Properties(PropertyTypes.Unit)
                {
                    ID          = id, Address1 = Add1,
                    Address2    = dr[3].ToString(),
                    Address3    = dr[4].ToString(),
                    Address4    = dr[5].ToString(),
                    Address5    = dr[6].ToString(),
                    FullAddress =
                        SetAddressString(Add1, dr[3].ToString(), dr[4].ToString(), dr[5].ToString(), dr[6].ToString())
                });
            }
            return(rList);
        }
示例#6
0
        public static List <Properties> GetAllUnitsowners(int UnitID)
        {
            string q = "select Core.leaseholders.title, Core.leaseholders.firstname," +
                       "core.leaseholders.surname, Core.leaseholders.Address_1, Core.leaseholders.Address_2, " +
                       "Core.leaseholders.Address_3, " +
                       "Core.leaseholders.Address_4, Core.leaseholders.Address_5, Core.leaseholders.ID " +
                       "FROM CORE.leaseholders " +
                       "inner join core.PropertyOwnership on core.Leaseholders.ID = core.PropertyOwnership.OwnerID " +
                       "where core.PropertyOwnership.UnitID = " + UnitID.ToString() + " and core.propertyownership.currentowner = 1";

            List <Properties>  rList = new List <Properties>();
            DBConnectionObject db    = GlobalVariables.GetConnection();
            DataTable          dt    = db.Connection.GetDataTable(q);

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                foreach (DataRow dr in dt.Rows)
                {
                    int id = 0;
                    if (dr[8] != DBNull.Value)
                    {
                        id = Convert.ToInt32(dr[8]);
                    }
                    string Add1 = SetAddress1(dr[0].ToString(), dr[1].ToString(), dr[2].ToString());
                    rList.Add(new Properties(PropertyTypes.Owner)
                    {
                        ID = id, Address1 = Add1, FullAddress = Add1
                    });
                }
            }
            return(rList);
        }
示例#7
0
        public static double GetApportionment(int budgetID, string scheduleName, int PropertyID)
        {
            string q = "Select Apportionment from core.ServiceChargeBudgetApportionments where " +
                       "budgetID = " + budgetID.ToString() + " and ScheduleName = '" + scheduleName + "' and " +
                       " unitID = " + PropertyID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            double r = 0;

            foreach (DataRow dr in dt.Rows)
            {
                if (dr[0].ToString() != "Error")
                {
                    if (dr[0] != DBNull.Value)
                    {
                        string h = dr[0].ToString();
                        r = Convert.ToDouble(dr[0]);
                    }
                }
            }

            return(r);
        }
示例#8
0
        public static List <Repairs> GetRepairHistory(int repairID)
        {
            string q = "select updateDate, updatenote from core.RepairUpdateNote " +
                       " where repairID = " + repairID.ToString() + " order by UpdateDate desc";

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);
            List <Repairs>     r  = new List <Repairs>();

            if (dt.Rows.Count > 0)
            {
                DataRow d = dt.Rows[0];
                if (d[0].ToString() != "Error")
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        DateTime logged = new DateTime();
                        if (dr[0] != DBNull.Value)
                        {
                            logged = Convert.ToDateTime(dr[0]);
                        }
                        r.Add(new Repairs {
                            RaisedDate = logged, RaisedDatestr = Controls.DateString(logged), UpdateNote = dr[1].ToString()
                        });
                    }
                }
            }
            return(r);
        }
示例#9
0
        private void UpdateRoomList()
        {
            Char[]             prohibitedChars = { ' ', '*', '.', '\'' };
            DBConnectionObject DBconnection    = DBConnectionObject.getInstance();

            string room = roomField.Text.Trim(prohibitedChars).Replace("'", "’");

            List <RADGSHALibrary.Room> ResultingRoomList = new List <RADGSHALibrary.Room>();

            if (room != "")
            {
                ResultingRoomList = DBconnection.queryRoom(room);
            }

            RoomListView.Items.Clear();

            foreach (RADGSHALibrary.Room r in ResultingRoomList)
            {
                ListViewItem roomResult = new ListViewItem(r.getRoomNumber());
                roomResult.SubItems.Add(r.getHourlyRate().ToString());
                roomResult.SubItems.Add(r.getEffectiveDate().ToString());
                RoomListView.Items.Add(roomResult);
            }

            if (RoomListView.SelectedItems.Count != 1)
            {
                submitButton.Enabled = false;
            }
        }
示例#10
0
        public static PurchaseOrders GetPurchaseOrderByID(int ID)
        {
            string q = "Select * from core.PurchaseOrders where ID = " + ID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            PurchaseOrders po = new PurchaseOrders();

            if (dt.Rows.Count > 0)
            {
                DataRow d = dt.Rows[0];
                if (d[0].ToString() != "Error")
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        PurchaseOrders p = new PurchaseOrders {
                            ID = Convert.ToInt32(dr[0]),
                        };
                    }
                }
            }

            return(po);
        }
示例#11
0
        public static List <OwnerNotesProperties> GetAllOwnerNotes(int unitID, int customerID)
        {
            List <OwnerNotesProperties> rlist = new List <OwnerNotesProperties>();

            string q = "select  core.OwnerNotes.AddedDate, core.OwnerNotes.userID, core.OwnerNotes.details " +
                       "from core.OwnerNotes where unitID = " + unitID.ToString() +
                       "and OwnerID = " + customerID.ToString() +
                       "and PortalViewable = 1 order by AddedDate desc";

            DBConnectionObject db = GlobalVariables.GetConnection();

            DataTable dt = db.Connection.GetDataTable(q);

            foreach (DataRow dr in dt.Rows)
            {
                rlist.Add(new OwnerNotesProperties {
                    dateAdded = Convert.ToDateTime(dr[0]), addedby = dr[1].ToString(), details = dr[2].ToString()
                });
            }

            if (rlist.Count == 0)
            {
                rlist.Add(new OwnerNotesProperties {
                    details = "No history items exist for this property."
                });
            }

            return(rlist);
        }
示例#12
0
        public static List <Properties> GetAllEstates()
        {
            string q = "select * FROM CORE.Estates where _statusID = 1";

            List <Properties>  rList = new List <Properties>();
            DBConnectionObject db    = GlobalVariables.GetConnection();
            DataTable          dt    = db.Connection.GetDataTable(q);

            foreach (DataRow dr in dt.Rows)
            {
                int id = 0;
                if (dr[0] != DBNull.Value)
                {
                    id = Convert.ToInt32(dr[0]);
                }
                string Add1 = SetAddress1(dr[0].ToString(), dr[1].ToString(), dr[2].ToString());
                rList.Add(new Properties(PropertyTypes.Estate)
                {
                    ID          = id,
                    Address1    = dr[1].ToString(),
                    Address2    = dr[2].ToString(),
                    Address3    = dr[3].ToString(),
                    Address4    = dr[4].ToString(),
                    Address5    = dr[5].ToString(),
                    FullAddress = SetAddressString(dr[1].ToString(), dr[2].ToString(),
                                                   dr[3].ToString(), dr[4].ToString(), dr[5].ToString())
                });
            }
            return(rList);
        }
示例#13
0
        public static Contractors ContractorDetailsByPO(int PONumber)
        {
            string q = " select core.Contractors.Name from core.Contractors " +
                       "inner join core.PurchaseOrders on core.Contractors.id = core.PurchaseOrders.SupplierID " +
                       "where core.PurchaseOrders.ID = " + PONumber.ToString();

            DBConnectionObject db      = GlobalVariables.GetConnection();
            DataTable          dt      = db.Connection.GetDataTable(q);
            Contractors        returnC = new Contractors();

            returnC.Name = "";

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0][0] != DBNull.Value || dt.Rows[0][0].ToString() != "Error")
                {
                    Contractors c = new Contractors {
                        Name = dt.Rows[0][0].ToString()
                    };
                    returnC = c;
                }
            }

            return(returnC);
        }
示例#14
0
        public static void Remove(int customerID, int RepairID)
        {
            string q = "delete from core.repairupdates where customerID = " + customerID.ToString() +
                       " and repairID = " + RepairID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();

            db.Connection.ExecuteCommand(q);
        }
示例#15
0
        public static void AddNew(int customerId, int repairID)
        {
            string q = "insert into core.RepairUpdates values (" + customerId.ToString() + ", " +
                       repairID.ToString() + ")";


            DBConnectionObject db = GlobalVariables.GetConnection();

            db.Connection.ExecuteCommand(q);
        }
示例#16
0
        public static Repairs GetOutstandingRepairs(int EstateID)
        {
            string q = "select core.Repairs.ID, core.Repairs.ReportID, core.Repairs.RepairTitle, " +
                       "core.Repairs.RepairDetails, core.Repairs.RaisedDate, " +
                       "core.Repairs.TargetCompletionDate,  core.RepairStatus.RepairStatus " +
                       "from core.Repairs inner join core.RepairStatus on core.Repairs.RepairStatusID " +
                       "= core.RepairStatus.id where core.repairs.EstateID = " + EstateID.ToString() +
                       " and  core.Repairs.RepairStatusId = 1 " +
                       " order by core.repairs.raisedDate Asc";

            DBConnectionObject db = GlobalVariables.GetConnection();

            DataTable dt      = db.Connection.GetDataTable(q);
            Repairs   repairs = new Repairs();

            repairs.AllRepairs = new List <Repairs>();

            if (dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];
                if (row[0].ToString() != "Error")
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        //raised date
                        DateTime raised = new DateTime();
                        if (dr[4] != DBNull.Value)
                        {
                            raised = Convert.ToDateTime(dr[4]);
                        }

                        //Target Completion
                        DateTime target = new DateTime();
                        if (dr[5] != DBNull.Value)
                        {
                            target = Convert.ToDateTime(dr[5]);
                        }


                        repairs.AllRepairs.Add(new Repairs {
                            ID            = Convert.ToInt32(dr[0]),
                            Title         = dr[2].ToString(),
                            Details       = dr[3].ToString(),
                            RaisedDate    = raised,
                            RaisedDatestr = Controls.DateString(raised),
                            TargetDate    = target,
                            TargetDatestr = Controls.DateString(target),
                            Status        = dr[6].ToString()
                        });
                    }
                }
            }

            return(repairs);
        }
示例#17
0
        public static List <ServiceCharges> ReplaceTransactionDateWithPaidDate(List <ServiceCharges> TransList)
        {
            //replaces the transaction date with the paid date for transactions that are payments
            //to reduce db calls loop creats the query string

            string PaidDateStr = "select transactionID, paiddate from core.paymentdata where transactionID = ";

            int c = 0;

            for (int i = 0; i <= TransList.Count - 1; i++)
            {
                if (TransList[i].TransType == "Payment")
                {
                    if (c == 0)
                    {
                        PaidDateStr += TransList[i].ID.ToString();
                    }
                    else
                    {
                        PaidDateStr += " or transactionid = " + TransList[i].ID.ToString();
                    }

                    c += 1;
                }
            }

            DBConnectionObject db        = GlobalVariables.GetConnection();
            DataTable          dataTable = db.Connection.GetDataTable(PaidDateStr);

            if (dataTable.Rows.Count > 0 && dataTable.Rows[0][0].ToString() != "Error")
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    //get trans ID

                    int id = Convert.ToInt32(row[0]);
                    foreach (ServiceCharges tr in TransList)
                    {
                        if (tr.ID == id)
                        {
                            DateTime _date = Convert.ToDateTime(row[1]);

                            tr.TransDate    = _date;
                            tr.TransDatestr = Controls.DateString(_date);

                            break;
                        }
                    }
                }
            }



            return(TransList);
        }
示例#18
0
        //account details where property is selected
        public static AccountDetails OwnerAccountDetails(int CustomerID, int PropertyID)
        {
            string q = "Select * from core.LeaseholderContactPreferences " +
                       "where core.LeaseholderContactPreferences.CustomerID = " + CustomerID.ToString() + " and UnitID = " + PropertyID.ToString();

            AccountDetails        r     = new AccountDetails();
            List <AccountDetails> rList = new List <AccountDetails>();
            DBConnectionObject    db    = GlobalVariables.GetConnection();
            DataTable             dt    = db.Connection.GetDataTable(q);

            foreach (DataRow dr in dt.Rows)
            {
                rList.Add(new AccountDetails {
                    ContactAdd1 = dr[5].ToString(), ContactAdd2 = dr[6].ToString(), ContactAdd3 = dr[7].ToString(), ContactAdd4 = dr[8].ToString(), ContactAdd5 = dr[9].ToString(), phoneNumber = dr[11].ToString()
                });
                if (dr[10] != DBNull.Value)
                {
                    rList[0].Email = dr[10].ToString();
                }

                if (dr[1] != DBNull.Value)
                {
                    rList[0].PostOnly = Convert.ToBoolean(dr[1]);
                    if (rList[0].PostOnly == true)
                    {
                        rList[0].ContactPref = AccountDetails.ContactPreferences.Post;
                    }
                }

                if (dr[2] != DBNull.Value)
                {
                    rList[0].EmailOnly = Convert.ToBoolean(dr[2]);
                    if (rList[0].EmailOnly == true)
                    {
                        rList[0].ContactPref = AccountDetails.ContactPreferences.email;
                    }
                }

                if (dr[3] != DBNull.Value)
                {
                    rList[0].PostAndEmail = Convert.ToBoolean(dr[3]);
                    if (rList[0].PostAndEmail == true)
                    {
                        rList[0].ContactPref = AccountDetails.ContactPreferences.postandemail;
                    }
                }
            }
            if (rList.Count != 0)
            {
                r = rList[0];
            }


            return(r);
        }
示例#19
0
        public static PortalLogins Login(object username, string password)
        {
            PortalLogins r = new PortalLogins();

            try
            {
                string pcheck   = "";
                string salt     = "";
                int    UserID   = 0;
                int    UserType = 0;
                //check email and password
                string q = "select PWord, salt, customerid, UserType from core.customerportal where username = '******'";
                DBConnectionObject db = GlobalVariables.GetConnection();
                DataTable          dt = db.Connection.GetDataTable(q);

                if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
                {
                    pcheck = dt.Rows[0][0].ToString();
                    salt   = dt.Rows[0][1].ToString();
                    int.TryParse(dt.Rows[0][2].ToString(), out UserID);
                    int.TryParse(dt.Rows[0][3].ToString(), out UserType);
                }
                if (pcheck == BCrypt.Net.BCrypt.HashPassword(password, salt))
                {
                    r.LoginVerified = true;
                    r.UserType      = UserType;
                    r.CustomerID    = UserID;

                    //user id 1 = customer
                    //user id 2 = NEM User

                    string nameQ = "";
                    //get name
                    if (UserType == 1)
                    {
                        nameQ = "select concat(title, ' ', firstname, ' ', surname) from core.Leaseholders " +
                                " where id = " + r.CustomerID.ToString();
                    }
                    else if (UserType == 2)
                    {
                        nameQ = "select concat(firstname, ' ', surname) from users.users where id = " + r.CustomerID.ToString();
                    }

                    DataTable namedb = db.Connection.GetDataTable(nameQ);
                    if (namedb.Rows.Count > 0 && namedb.Rows[0][0].ToString() != "Error")
                    {
                        r.customerName = namedb.Rows[0][0].ToString();
                    }
                }
            }
            catch { }
            return(r);
        }
        private void viewPatientButton_Click(object sender, EventArgs e)
        {
            DBConnectionObject DBconnection = DBConnectionObject.getInstance();

            RADGSHALibrary.Patient p = DBconnection.getPatient(PatientListView.SelectedItems[0].SubItems[2].Text);

            //This should return the selected Patient
            this.Hide();
            Patient P = new Patient(this, p);

            this.Closed += (s, args) => P.Close();
            P.Show();
        }
示例#21
0
        public static int NumberOfOwnedProperties(int CustomerID)
        {
            string q = "select count(unitID) from core.PropertyOwnership where OwnerID = " + CustomerID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);
            int i = 0;

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                int.TryParse(dt.Rows[0][0].ToString(), out i);
            }
            return(i);
        }
示例#22
0
        public static string PropertyAddress(int UnitID)
        {
            string q = "select Core.Units.FlatOrApt, Core.Units.UnitNumber, Core.Units.Address1 from " +
                       " core.units where ID = " + UnitID.ToString();

            string             r  = "";
            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            foreach (DataRow dr in dt.Rows)
            {
                r = SetAddress1(dr[0].ToString(), dr[1].ToString(), dr[2].ToString());
            }
            return(r);
        }
示例#23
0
        public static string GetPropertyName(int unitid)
        {
            string q = "select concat(flatorapt, ' ', UnitNumber, ' ', Address1) from core.Units where id = " +
                       unitid.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);
            string             r  = "";

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                r = dt.Rows[0][0].ToString();
            }
            return(r);
        }
示例#24
0
        public static Documents GetDocumentByID(long DocID)
        {
            string q = "Select document from core.documents where id = " + DocID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            Documents r = new Documents();

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                r.Document = DataRowToByteArray(dt.Rows[0], 0);
            }

            return(r);
        }
示例#25
0
        public static List <Estates> GetServiceChargePeriodList(int EstateID)
        {
            List <Estates> rlist = new List <Estates>();

            string q = "Select core.ServiceChargeBudgets.ID, core.ServiceChargeBudgets.startDate, " +
                       "core.ServiceChargeBudgets.endDate, core.ServiceChargeBudgets._status, " +
                       "core.ServiceChargeBudgets.chargePeriod, core.FundTypes.FundType, core.ServiceChargeBudgets.BudgetName " +
                       "from core.ServiceChargeBudgets " +
                       "inner join core.FundTypes on core.FundTypes.Id = core.ServiceChargeBudgets.FundTypeID " +
                       "where core.ServiceChargeBudgets.EstateID = " + EstateID.ToString() + " and core.servicechargebudgets.fundtypeID = 2" +
                       " and core.ServiceChargeBudgets._status <> 'Progress'";

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                foreach (DataRow dr in dt.Rows)
                {
                    DateTime sdate = new DateTime();
                    if (dr[1] != DBNull.Value)
                    {
                        sdate = Convert.ToDateTime(dr[1]);
                    }
                    DateTime edate = new DateTime();
                    if (dr[2] != DBNull.Value)
                    {
                        edate = Convert.ToDateTime(dr[2]);
                    }
                    rlist.Add(new Estates()
                    {
                        BudgetId            = Convert.ToInt32(dr[0]),
                        SCStartDate         = sdate.ToShortDateString(),
                        SCEndDate           = edate.ToShortDateString(),
                        ServiceChargePeriod = SetServiceChargePeriod(sdate.ToShortDateString(),
                                                                     edate.ToShortDateString()),
                        _status   = dr[3].ToString(),
                        FundName  = dr[6].ToString(),
                        EstatedID = EstateID
                    });
                }
            }


            return(rlist);
        }
示例#26
0
        public static void UpdateLoginEmail(string Email, int CustomerID)
        {
            List <string> colnames = new List <string>();

            colnames.Add("Username");

            List <string> PList = new List <string>();

            PList.Add("@Username");

            List <object> values = new List <object>();

            values.Add(Email);

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.UpdateCommand("core.CustomerPortal", colnames, PList, values, " where customerID = " + CustomerID.ToString());
        }
示例#27
0
        public static List <string> GetPasswordandSalt(int customerID)
        {
            string q = "select PWord, Salt from core.customerportal where customerID = " + customerID.ToString();


            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            List <string> r = new List <string>();

            if (dt.Rows.Count > 0 && dt.Rows[0][0].ToString() != "Error")
            {
                r.Add(dt.Rows[0][0].ToString());
                r.Add(dt.Rows[0][1].ToString());
            }

            return(r);
        }
示例#28
0
        private void submitButton_Click(object sender, EventArgs e)
        {
            newRoom = new Room(RoomListView.SelectedItems[0].SubItems[0].Text, Decimal.Parse(RoomListView.SelectedItems[0].SubItems[1].Text), DateTime.Parse(RoomListView.SelectedItems[0].SubItems[2].Text));

            DBConnectionObject conn = DBConnectionObject.getInstance();

            foreach (RADGSHALibrary.Room r in selectedVisit.getRoomList())
            {
                conn.getRoomEntryExitDates(selectedPatient, selectedVisit, r, out DateTime entry, out DateTime roomExit, out bool stillInRoom);
                if (stillInRoom)
                {
                    conn.closeStaysIn(selectedPatient, selectedVisit, r, DateTime.Now);
                }
            }

            conn.addStaysIn(newRoom, selectedPatient, selectedVisit, DateTime.Now);
            selectedVisit.addRoom(newRoom);
            Close();
        }
示例#29
0
        public static double CompletedCost(int PONumber)
        {
            string q = "select sum(core.Transactions.TransAmount) from core.Transactions " +
                       "where PONumber = " + PONumber.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);
            double             d  = 0;

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0][0] != DBNull.Value || dt.Rows[0][0].ToString() != "Error")
                {
                    d = Convert.ToDouble(dt.Rows[0][0]);
                }
            }

            return(d);
        }
示例#30
0
        public static Estates GetEstatedByUnitID(int UnitID)
        {
            string q = "select core.Estates.ID, core.Estates.Name from Core.Estates " +
                       "inner join core.Units on core.Estates.ID = core.Units.EstateID " +
                       "where core.Units.ID = " + UnitID.ToString();

            DBConnectionObject db = GlobalVariables.GetConnection();
            DataTable          dt = db.Connection.GetDataTable(q);

            Estates r = new Estates();

            foreach (DataRow dr in dt.Rows)
            {
                r.EstatedID  = Convert.ToInt32(dr[0]);
                r.EstateName = dr[1].ToString();
            }

            return(r);
        }