chu3xxx Hội viên
Treo nick
Đă tham gia: 04 December 2004
Hiện giờ: Offline Bài gửi: 12
|
Msg 4 of 12: Đă gửi: 10 December 2004 lúc 11:26am | Đă lưu IP
|
|
|
đây nè....
#include "stdafx.h"
#include "TV1.h"
#include "TV1Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////// /////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATĂCAboutDlg)
enum { IĐ = IĐ_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // ĐX/ĐV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IĐ)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////// /////////////////
// CTV1Dlg dialog
CTV1Dlg::CTV1Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CTV1Dlg::IĐ, pParent)
{
//{{AFX_DATA_INIT(CTV1Dlg)
m_can = _T("Giap");
m_chi = _T("Ti");
m_cuc = _T("");
m_day = 1;
m_h1 = _T("");
m_h10 = _T("");
m_h11 = _T("");
m_h12 = _T("");
m_h2 = _T("");
m_h3 = _T("");
m_h4 = _T("");
m_h5 = _T("");
m_h6 = _T("");
m_h7 = _T("");
m_h8 = _T("");
m_h9 = _T("");
m_lday = _T("1");
m_lmonth = _T("1");
m_menh = _T("");
m_month = 1;
m_name = _T("");
m_sex = _T("Male");
m_time = _T("11:00 - 12:59 (Ti)");
m_tuoi = _T("");
m_year = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CTV1Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTV1Dlg)
ĐX_Control(pDX, IDC_SUU, m_suu);
ĐX_Control(pDX, IDC_TI, m_ti);
ĐX_Control(pDX, IDC_HOI, m_hoi);
ĐX_Control(pDX, IDC_TUAT, m_tuat);
ĐX_Control(pDX, IDC_DAU, m_dau);
ĐX_Control(pDX, IDC_THAN, m_than);
ĐX_Control(pDX, IDC_MUI, m_mui);
ĐX_Control(pDX, IDC_NGO, m_ngo);
ĐX_Control(pDX, IDC_TY, m_ty);
ĐX_Control(pDX, IDC_THIN, m_thin);
ĐX_Control(pDX, IDC_MAO, m_mao);
ĐX_Control(pDX, IDC_DAN, m_dan);
ĐX_CBString(pDX, IDC_CAN, m_can);
ĐX_CBString(pDX, IDC_CHI, m_chi);
ĐV_MaxChars(pDX, m_chi, 4);
ĐX_Text(pDX, IDC_CUC, m_cuc);
ĐX_Text(pDX, IDC_DAY, m_day);
ĐV_MinMaxInt(pDX, m_day, 1, 31);
ĐX_Text(pDX, IDC_H1, m_h1);
ĐX_Text(pDX, IDC_H10, m_h10);
ĐX_Text(pDX, IDC_H11, m_h11);
ĐX_Text(pDX, IDC_H12, m_h12);
ĐX_Text(pDX, IDC_H2, m_h2);
ĐX_Text(pDX, IDC_H3, m_h3);
ĐX_Text(pDX, IDC_H4, m_h4);
ĐX_Text(pDX, IDC_H5, m_h5);
ĐX_Text(pDX, IDC_H6, m_h6);
ĐX_Text(pDX, IDC_H7, m_h7);
ĐX_Text(pDX, IDC_H8, m_h8);
ĐX_Text(pDX, IDC_H9, m_h9);
ĐX_CBString(pDX, IDC_LDAY, m_lday);
ĐV_MaxChars(pDX, m_lday, 2);
ĐX_CBString(pDX, IDC_LMONTH, m_lmonth);
ĐV_MaxChars(pDX, m_lmonth, 2);
ĐX_Text(pDX, IDC_MENH, m_menh);
ĐX_Text(pDX, IDC_MONTH, m_month);
ĐV_MinMaxInt(pDX, m_month, 1, 12);
ĐX_Text(pDX, IDC_NAME, m_name);
ĐX_CBString(pDX, IDC_SEX, m_sex);
ĐX_CBString(pDX, IDC_TIME, m_time);
ĐX_Text(pDX, IDC_TUOI, m_tuoi);
ĐX_Text(pDX, IDC_YEAR, m_year);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTV1Dlg, CDialog)
//{{AFX_MSG_MAP(CTV1Dlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////////////////////////////////////// /////////////////
// CTV1Dlg message handlers
BOOL CTV1Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Ađ "About..." menu item to system menụ
// IDM_ABOUTBOX must be in the system command rangẹ
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenư pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEP ARATOR);
pSysMenu->AppendMenu(MF_STR ING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Ađ extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CTV1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you ađ a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CTV1Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CTV1Dlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CTV1Dlg::OnOK()
{
// TODO: Ađ extra validation here
bool test = TRUE;
UpdateDatăCRTLTOVAR);
m_tuoi = "Duong";
if ( (m_can == "Giap") || (m_can == "Binh") || (m_can == "Mau") || (m_can == "Canh")
|| (m_can == "Nham") )
{
if( (m_chi == "Mao") || (m_chi == "Ty") || (m_chi == "Mui")
|| (m_chi == "Dau") || (m_chi == "Hoi") || (m_chi == "Suu") )
{   ;
test = FALSE;
AfxMessageBox("Can Chi Ko Hạp");
}
}
if ( (m_can == "At") || (m_can == "Dinh") || (m_can == "Ky") || (m_can == "Tan")
|| (m_can == "Qui") )
{
if( (m_chi == "Dan") || (m_chi == "Thin") || (m_chi == "Ngo")
|| (m_chi == "Than") || (m_chi == "Tuat") || (m_chi == "Ti") )
{   ;
test = FALSE;
AfxMessageBox("Can Chi Ko Hạp");
}
m_tuoi = "Am";
}
if (test)
{
if (m_sex == "Male")
m_tuoi += " Nam";
else
m_tuoi += " Nu";
m_menh = check_menh( m_can, m_chi);
// Declarations & initializations
int menh;
int than;
m_dan.ResetContent();
m_mao.ResetContent();
m_thin.ResetContent();
m_ty.ResetContent();;
m_ngo.ResetContent();
m_mui.ResetContent();
m_than.ResetContent();
m_dau.ResetContent();
m_tuat.ResetContent();
m_hoi.ResetContent();
m_ti.ResetContent();
m_suu.ResetContent();
// Find MỆNH cua số
menh = find_menh(m_lmonth, m_time);
if ( (menh == 13) )
{
m_dan.InsertString(0,"MENH");
m_mao.InsertString(0,"PHỤ ;");
m_thin.InsertString(0,"PHÚC");
m_ty.InsertString(0,"DIEN");
m_ngo.InsertString(0,"QUAN");
m_mui.InsertString(0,"NÔ");
m_than.InsertString(0,"THIEN DI");
m_dau.InsertString(0,"TẬ T");
m_tuat.InsertString(0,"TÀI");
m_hoi.InsertString(0,"TỬ ");
m_ti.InsertString(0,"PHU THÊ");
m_suu.InsertString(0,"HUYNH");
}
if ( (menh == 2) || (menh == 14))
{
m_dan.InsertString(0,"HUYNH");
m_mao.InsertString(0,"MENH");
m_thin.InsertString(0,"PH̖ 8;");
m_ty.InsertString(0,"PHÚC");
m_ngo.InsertString(0,"DIEN");
m_mui.InsertString(0,"QUAN");
m_than.InsertString(0,"NÔ");
m_dau.InsertString(0,"THIEN DI");
m_tuat.InsertString(0,"TẬ ;T");
m_hoi.InsertString(0,"TÀI");
m_ti.InsertString(0,"TỬ" );
m_suu.InsertString(0,"PHU THÊ");
}
if ( (menh == 3) || (menh == 15))
{
m_dan.InsertString(0,"PHU THÊ");
m_mao.InsertString(0,"HUYNH");
m_thin.InsertString(0,"MENH");
m_ty.InsertString(0,"PHỤ ");
m_ngo.InsertString(0,"PHÚC");
m_mui.InsertString(0,"DIEN");
m_than.InsertString(0,"QUAN");
m_dau.InsertString(0,"NÔ");
m_tuat.InsertString(0,"THIEN DI");
m_hoi.InsertString(0,"TẬ T");
m_ti.InsertString(0,"TÀI");
m_suu.InsertString(0,"TỬ ");
}
if ( (menh == 4) || (menh == 16))
{
m_dan.InsertString(0,"TỬ ");
m_mao.InsertString(0,"PHU THÊ");
m_thin.InsertString(0,"HUYNH") ;
m_ty.InsertString(0,"MENH");
m_ngo.InsertString(0,"PHỤ ;");
m_mui.InsertString(0,"PHUC");
m_than.InsertString(0,"DIEN");
m_dau.InsertString(0,"QUAN");
m_tuat.InsertString(0,"NÔ");
m_hoi.InsertString(0,"THIEN DI");
m_ti.InsertString(0,"TẬT ");
m_suu.InsertString(0,"TÀI");
}
if ( (menh == 5) || (menh == 17))
{
m_dan.InsertString(0,"TÀI");
m_mao.InsertString(0,"TỬ ");
m_thin.InsertString(0,"PHU THÊ");
m_ty.InsertString(0,"HUYNH");
m_ngo.InsertString(0,"MENH");
m_mui.InsertString(0,"PHỤ ;");
m_than.InsertString(0,"PHUC");
m_dau.InsertString(0,"DIEN");
m_tuat.InsertString(0,"QUAN");
m_hoi.InsertString(0,"NÔ");
m_ti.InsertString(0,"THIEN DI");
m_suu.InsertString(0,"TẬ T");
}
if ( (menh == 6) || (menh == 18))
{
m_dan.InsertString(0,"TẬ T");
m_mao.InsertString(0,"TÀI");
m_thin.InsertString(0,"TỬ ;");
m_ty.InsertString(0,"PHU THÊ");
m_ngo.InsertString(0,"HUYNH");
m_mui.InsertString(0,"MENH");
m_than.InsertString(0,"PH̖ 8;");
m_dau.InsertString(0,"PHUC");
m_tuat.InsertString(0,"DIEN");
m_hoi.InsertString(0,"QUAN");
m_ti.InsertString(0,"NÔ");
m_suu.InsertString(0,"THIEN DI");
}
if ( (menh == 7) || (menh == 19))
{
m_dan.InsertString(0,"THIEN DI");
m_mao.InsertString(0,"TẬ T");
m_thin.InsertString(0,"TÀI");
m_ty.InsertString(0,"TỬ" );
m_ngo.InsertString(0,"PHU THÊ");
m_mui.InsertString(0,"HUYNH");
m_than.InsertString(0,"MENH");
m_dau.InsertString(0,"PHỤ ;");
m_tuat.InsertString(0,"PHUC");
m_hoi.InsertString(0,"DIEN");
m_ti.InsertString(0,"QUAN");
m_suu.InsertString(0,"NÔ");
}
if ( (menh == 8) || (menh == 20))
{
m_dan.InsertString(0,"NÔ");
m_mao.InsertString(0,"THIEN DI");
m_thin.InsertString(0,"TẬ ;T");
m_ty.InsertString(0,"TÀI");
m_ngo.InsertString(0,"TỬ ");
m_mui.InsertString(0,"PHU THÊ");
m_than.InsertString(0,"HUYNH") ;
m_dau.InsertString(0,"MENH");
m_tuat.InsertString(0,"PH̖ 8;");
m_hoi.InsertString(0,"PHUC");
m_ti.InsertString(0,"DIEN");
m_suu.InsertString(0,"QUAN");
}
if ( (menh == 9) || (menh == 21))
{
m_dan.InsertString(0,"QUAN");
m_mao.InsertString(0,"NÔ");
m_thin.InsertString(0,"THIEN DI");
m_ty.InsertString(0,"TẬT ");
m_ngo.InsertString(0,"TÀI");
m_mui.InsertString(0,"TỬ ");
m_than.InsertString(0,"PHU THÊ");
m_dau.InsertString(0,"HUYNH");
m_tuat.InsertString(0,"MENH");
m_hoi.InsertString(0,"PHỤ ;");
m_ti.InsertString(0,"PHU C");
m_suu.InsertString(0,"DIEN");
}
if ( (menh == 10) || (menh == 22))
{
m_dan.InsertString(0,"DIEN");
m_mao.InsertString(0,"QUAN");
m_thin.InsertString(0,"NÔ");
m_ty.InsertString(0,"THIEN DI");
m_ngo.InsertString(0,"TẬ T");
m_mui.InsertString(0,"TÀI");
m_than.InsertString(0,"TỬ ;");
m_dau.InsertString(0,"PHU THÊ");
m_tuat.InsertString(0,"HUYNH") ;
m_hoi.InsertString(0,"MENH");
m_ti.InsertString(0,"PHỤ ");
m_suu.InsertString(0,"PHU C");
}
if ( (menh == 11) || (menh == 23))
{
m_dan.InsertString(0,"PHU C");
m_mao.InsertString(0,"DIEN");
m_thin.InsertString(0,"QUAN");
m_ty.InsertString(0,"NÔ");
m_ngo.InsertString(0,"THIEN DI");
m_mui.InsertString(0,"TẬ T");
m_than.InsertString(0,"TÀI");
m_dau.InsertString(0,"TỬ ");
m_tuat.InsertString(0,"PHU THÊ");
m_hoi.InsertString(0,"HUYNH");
m_ti.InsertString(0,"MENH");
m_suu.InsertString(0,"PHỤ ;");
}
if ( (menh == 12) || (menh == 24))
{
m_dan.InsertString(0,"PHỤ ;");
m_mao.InsertString(0,"PHU C");
m_thin.InsertString(0,"DIEN");
m_ty.InsertString(0,"QUAN");
m_ngo.InsertString(0,"NÔ");
m_mui.InsertString(0,"THIEN DI");
m_than.InsertString(0,"TẬ ;T");
m_dau.InsertString(0,"TÀI");
m_tuat.InsertString(0,"TỬ ;");
m_hoi.InsertString(0,"PHU THÊ");
m_ti.InsertString(0,"HUYNH");
m_suu.InsertString(0,"MENH");
}
// Find THÂN cua số
m_dan.InsertString(1," ");
m_mao.InsertString(1," ");
m_thin.InsertString(1," ");
m_ty.InsertString(1," ");
m_ngo.InsertString(1," ");
m_mui.InsertString(1," ");
m_than.InsertString(1," ");
m_dau.InsertString(1," ");
m_tuat.InsertString(1," ");
m_hoi.InsertString(1," ");
m_ti.InsertString(1," ");
m_suu.InsertString(1," ");
than = find_than(m_lmonth, m_time);
if ( (than == 1) || (than == 13))
{
m_dan.InsertString(1,"(THÂN)");
}
if ( (than == 2) || (than == 14))
{
m_mao.InsertString(1,"(THÂN)");
}
if ( (than == 3) || (than == 15))
{
m_thin.InsertString(1,"(THÂN)");
}
if ( (than == 4) || (than == 16))
{
m_ty.InsertString(1,"(THÂN)");
}
if ( (than == 5) || (than == 17))
{
m_ngo.InsertString(1,"(THÂN)");
}
if ( (than == 6) || (than == 18))
{
m_mui.InsertString(1,"(THÂN)");
}
if ( (than == 7) || (than == 19))
{
m_than.InsertString(1,"(THÂN)");
}
if ( (than == 8) || (than == 20))
{
m_dau.InsertString(1,"(THÂN)");
}
if ( (than == 9) || (than == 21))
{
m_tuat.InsertString(1,"(THÂN)");
}
if ( (than == 10) || (than == 22))
{
m_hoi.InsertString(1,"(THÂN)");
}
if ( (than == 11) || (than == 23))
{
m_ti.InsertString(1,"(THÂN)");
}
if ( (than == 12))
{
m_suu.InsertString(1,"(THÂN)");
}
// Find CUC cua số
int cuc = 0;
if ( (m_can == "Giap") || (m_can == "Ky") )
{
if ( (menh == 11) || (menh == 12) || (menh == 23) || (menh == 24) )
{
m_cuc = "THỦY NHI CỤC";
cuc = 2;
}
if ( (menh == 2) || (menh == 9) || (menh == 10) || (menh == 13)
|| (menh == 14) || (menh == 21) || (menh == 22) )
{
m_cuc = "HOẢ LỤC CỤC";
cuc = 6;
}
if ( (menh == 4) || (menh == 16) || (menh == 3) || (menh == 15) )
{
m_cuc = "MỘC TAM CỤC";
cuc = 3;
}
if ( (menh == 5) || (menh == 17) || (menh == 6) || (menh == 18) )
{
m_cuc = "THỔ NGŨ CỤC";
cuc = 5;
}
if ( (menh == 7) || (menh == 19) || (menh == 8) || (menh == 20) )
{
m_cuc = "KIM TỨ CỤC";
cuc = 4;
}
}
if ( (m_can == "At") || (m_can == "Canh") )
{
if ( (menh == 11) || (menh == 12) || (menh == 23) || (menh == 24) )
{
m_cuc = "HOẢ LỤC CỤC";
cuc = 6;
}
if ( (menh == 2) || (menh == 9) || (menh == 10) || (menh == 13)
|| (menh == 14) || (menh == 21) || (menh == 22) )
{
m_cuc = "THỔ NGŨ CỤC";
cuc = 5;
}
if ( (menh == 4) || (menh == 16) || (menh == 3) || (menh == 15) )
{
m_cuc = "KIM TỨ CỤC";
cuc = 4;
}
if ( (menh == 5) || (menh == 17) || (menh == 6) || (menh == 18) )
{
m_cuc = "MỘC TAM CỤC";
cuc = 3;
}
if ( (menh == 7) || (menh == 19) || (menh == 8) || (menh == 20) )
{
m_cuc = "THỦY NHỊ CỤC";
cuc = 2;
}
}
if ( (m_can == "Binh") || (m_can == "Tan") )
{
if ( (menh == 11) || (menh == 12) || (menh == 23) || (menh == 24) )
{
m_cuc = "THỔ NGŨ CỤC";
cuc = 5;
}
if ( (menh == 2) || (menh == 9) || (menh == 10) || (menh == 13)
|| (menh == 14) || (menh == 21) || (menh == 22) )
{
m_cuc = "MỘC TAM CỤC";
cuc = 3;
}
if ( (menh == 4) || (menh == 16) || (menh == 3) || (menh == 15) )
{
m_cuc = "THỦY NHỊ CỤC";
cuc = 2;
}
if ( (menh == 5) || (menh == 17) || (menh == 6) || (menh == 18) )
{
m_cuc = "KIM TỨ CỤC";
cuc = 4;
}
if ( (menh == 7) || (menh == 19) || (menh == 8) || (menh == 20) )
{
m_cuc = "HOẢ LỤC CỤC";
cuc = 6;
}
}
if ( (m_can == "Dinh") || (m_can == "Nham") )
{
if ( (menh == 11) || (menh == 12) || (menh == 23) || (menh == 24) )
{
m_cuc = "MỘC TAM CỤC";
cuc = 3;
}
if ( (menh == 2) || (menh == 9) || (menh == 10) || (menh == 13)
|| (menh == 14) || (menh == 21) || (menh == 22) )
{
m_cuc = "KIM TỨ CỤC";
cuc = 4;
}
if ( (menh == 4) || (menh == 16) || (menh == 3) || (menh == 15) )
{
m_cuc = "HOẢ LỤC CỤC";
cuc = 6;
}
if ( (menh == 5) || (menh == 17) || (menh == 6) || (menh == 18) )
{
m_cuc = "THỦY NHỊ CỤC";
cuc = 2;
}
if ( (menh == 7) || (menh == 19) || (menh == 8) || (menh == 20) )
{
m_cuc = "THỔ NGŨ CỤC";
cuc = 5;
}
}
if ( (m_can == "Mau") || (m_can == "Qui") )
{
if ( (menh == 11) || (menh == 12) || (menh == 23) || (menh == 24) )
{
m_cuc = "KIM TỨ CỤC";
cuc = 4;
}
if ( (menh == 2) || (menh == 9) || (menh == 10) || (menh == 13)
|| (menh == 14) || (menh == 21) || (menh == 22) )
{
m_cuc = "THỦY NHỊ CỤC";
cuc = 2;
}
if ( (menh == 4) || (menh == 16) || (menh == 3) || (menh == 15) )
{
m_cuc = "THỔ NGŨ CỤC";
cuc = 5;
}
if ( (menh == 5) || (menh == 17) || (menh == 6) || (menh == 18) )
{
m_cuc = "HOẢ LỤC CỤC";
cuc = 6;
}
if ( (menh == 7) || (menh == 19) || (menh == 8) || (menh == 20) )
{
m_cuc = "MỘC TAM CỤC";
cuc = 3;
}
}
// Tim TU VI ở cung nạ
int day;
int tvstart;
day = _ttoi(m_lday);
// Declarations & initializations
m_dan.InsertString(2," ");
m_mao.InsertString(2," ");
m_thin.InsertString(2," ");
m_ty.InsertString(2," ");
m_ngo.InsertString(2," ");
m_mui.InsertString(2," ");
m_than.InsertString(2," ");
m_dau.InsertString(2," ");
m_tuat.InsertString(2," ");
m_hoi.InsertString(2," ");
m_ti.InsertString(2," ");
m_suu.InsertString(2," ");
m_dan.InsertString(3," ");
m_mao.InsertString(3," ");
m_thin.InsertString(3," ");
m_ty.InsertString(3," ");
m_ngo.InsertString(3," ");
m_mui.InsertString(3," ");
m_than.InsertString(3," ");
m_dau.InsertString(3," ");
m_tuat.InsertString(3," ");
m_hoi.InsertString(3," ");
m_ti.InsertString(3," ");
m_suu.InsertString(3," ");
if (cuc == 2)
{
if ( (day == 2) || (day == 3) || (day == 26) || (day == 27) )
{
m_dan.InsertString(2," TƯ VI");
tvstart = 1;
}
if ( (day == 4) || (day == 5) || (day == 28) || (day == 29) )
{
m_mao.InsertString(2," TƯ VI");
tvstart = 2;
}
if ( (day == 6) || (day == 7) || (day == 30) )
{
m_thin.InsertString(2," TƯ VI");
tvstart = 3;
}
if ( (day == 8) || (day == 9) )
{
m_ty.InsertString(2," TƯ VI");
tvstart = 4;
}
if ( (day == 10) || (day == 11) )
{
m_ngo.InsertString(2," TƯ VI");
tvstart = 5;
}
if ( (day == 12) || (day == 13) )
{
m_mui.InsertString(2," TƯ VI");
tvstart = 6;
}
if ( (day == 14) || (day == 15) )
{
m_than.InsertString(2," TƯ VI");
tvstart = 7;
}
if ( (day == 16) || (day == 17) )
{
m_dau.InsertString(2," TƯ VI");
tvstart = 8;
}
if ( (day == 18) || (day == 19) )
{
m_tuat.InsertString(2," TƯ VI");
tvstart = 9;
}
if ( (day == 20) || (day == 21) )
{
m_hoi.InsertString(2," TƯ VI");
tvstart = 10;
}
if ( (day == 22) || (day == 23) )
{
m_ti.InsertString(2," TƯ VI");
tvstart = 11;
}
if ( (day == 1) || (day == 24) || (day == 25) )
{
m_suu.InsertString(2," TƯ VI");
tvstart = 12;
}
}
|