Esempio n. 1
0
 public string this[string columnName]
 {
     get
     {
         if (columnName == "FirstName")
         {
             if (string.IsNullOrEmpty(FirstName))
             {
                 return("First Name is required");
             }
         }
         if (columnName == "LastName")
         {
             if (string.IsNullOrEmpty(LastName))
             {
                 return("Last Name is required");
             }
         }
         if (columnName == "GrandFatherName")
         {
             if (string.IsNullOrEmpty(GrandFatherName))
             {
                 return("Grand Father Name is required");
             }
         }
         if (columnName == "Dob")
         {
             if (string.IsNullOrEmpty(Dob.ToString()))
             {
                 return("Date of birth is required");
             }
         }
         return(string.Empty);
     }
 }
Esempio n. 2
0
 public override string ToString()
 {
     return(String.Format("{0},{1},{2},{3},{4}", Id, FirstName, LastName, Dob.ToString(), CurrentSity));
 }
Esempio n. 3
0
 public override void ShowRecord()
 {
     Console.WriteLine("Patient Record Details:\nSurname: {0}\nFirst Name: {1}\nDoB: {2}\nAddress: {3}\nContact Number: {4}\n\nEnd of Patient Record\n\n", Surname, FirstName, Dob.ToString("dd/MM/yy"), Address, contactnumber.ToString());
 }
Esempio n. 4
0
        public override void updateDetails(int custID)
        {
            dbcon = new DatabaseConnector();
            Cid   = custID;

            dbcon.OpenConnection();

            //insert into tbl_nm(db FIELDS) VALUES(variables)
            //convert date to enter format
            dbcon.InitSqlCommand("UPDATE customer SET fname='" + Fname + "',lname='" + Lname + "',nic='" + Nic + "',gender='" + Gender + "',dob='" + Dob.ToString("yyyy-MM-dd") + "',address1='" + Add1 + "',address2='" + Add2 + "',phone='" + Phone + "',mail='" + Email + "' WHERE cid='" + Cid + "'").ExecuteNonQuery();

            dbcon.CloseConnection();
        }
Esempio n. 5
0
 public override string ToString()
 {
     return(Name + " " + Dob.ToString("yyyy.MM.dd"));
 }