예제 #1
0
        public static bool Insert(Owner own)
        {
            const string GET_INSERT = @"insert [tbOwner] (BldgNo,UnitNo,Fname,Mname,Lname,Bdate,CelNo,TelNo,Email,Citizenship,CivilStatus,Gender) values (@BldgNo,@UnitNo,@Fname,@Mname,@Lname,@Bdate,@CelNo,@TelNo,@Email,@Citizenship,@Status,@Gender) ";

            SqlCommand com = new SqlCommand(GET_INSERT);

            com.Parameters.Add(new SqlParameter("@BldgNo", own.BldgNo));
            com.Parameters.Add(new SqlParameter("@UnitNo", own.UnitNo));
            com.Parameters.Add(new SqlParameter("@Fname", own.Fname));
            com.Parameters.Add(new SqlParameter("@Mname", own.Mname));
            com.Parameters.Add(new SqlParameter("@Lname", own.Lname));
            com.Parameters.Add(new SqlParameter("@Bdate", own.Bdate));
            com.Parameters.Add(new SqlParameter("@CelNo", own.CelNo));
            com.Parameters.Add(new SqlParameter("@TelNo", own.TelNo));
            com.Parameters.Add(new SqlParameter("@Email", own.Email));
            com.Parameters.Add(new SqlParameter("@Citizenship", own.Citizenship));
            com.Parameters.Add(new SqlParameter("@Status", own.CivilStatus));
            com.Parameters.Add(new SqlParameter("@Gender", own.Gender));
            return(SqlManager.ExecuteNonQuery(com));
        }
        public static bool Insert(Tenant usr)
        {
            const string GET_INSERT = @"insert [tbTenant] (UnitNo,BldgNo,Fname,Mname,Lname,Gender,Bdate,TelNo,CelNo,Email,Citizenship,CivilStatus,LeaseStart,LeaseEnd) values (@UnitNo,@BldgNo,@Fname,@Mname,@Lname,@Gender,@Bdate,@TelNo,@CelNo,@Email,@Citizenship,@CivilStatus, @LeaseStart, @LeaseEnd)";

            SqlCommand com = new SqlCommand(GET_INSERT);

            com.Parameters.Add(new SqlParameter("@BldgNo", usr.BldgNo));
            com.Parameters.Add(new SqlParameter("@UnitNo", usr.UnitNo));
            com.Parameters.Add(new SqlParameter("@Fname", usr.Fname));
            com.Parameters.Add(new SqlParameter("@Mname", usr.Mname));
            com.Parameters.Add(new SqlParameter("@Lname", usr.Lname));
            com.Parameters.Add(new SqlParameter("@Gender", usr.Gender));
            com.Parameters.Add(new SqlParameter("@Bdate", usr.Bdate));
            com.Parameters.Add(new SqlParameter("@TelNo", usr.TelNo));
            com.Parameters.Add(new SqlParameter("@CelNo", usr.CelNo));
            com.Parameters.Add(new SqlParameter("@Email", usr.Email));
            com.Parameters.Add(new SqlParameter("@Citizenship", usr.Citizenship));
            com.Parameters.Add(new SqlParameter("@CivilStatus", usr.CivilStatus));
            com.Parameters.Add(new SqlParameter("@LeaseStart", usr.LeaseStart));
            com.Parameters.Add(new SqlParameter("@LeaseEnd", usr.LeaseEnd));

            return(SqlManager.ExecuteNonQuery(com));
        }