Esempio n. 1
0
        private void printskk9_Click(object sender, EventArgs e)
        {
            Report Rpt = new Report();

            Rpt.PrintGrd(GrdView);
            ReportView frm = new ReportView();

            frm.lsReportName = "rptskk9";
            frm.Show(this);
        }
Esempio n. 2
0
        private void printLabel_Click(object sender, EventArgs e)
        {
            GrdView.Sheets[0].SetActiveCell(0, 0);
            Cursor.Current = System.Windows.Forms.Cursors.Default;
            Cursor.Show();
            //lsTblMeeting.UpdateMeetingContactWithoutSelect(Convert.ToInt32(TxtMeetingID.Text), Pb1 , lsGdb.Gdb);
            Report Rpt = new Report();

            Rpt.PrintGrdMeetingLabel(GrdView, TxtMeetingNameT.Text, TxtDescription.Text, TxtPlace.Text);
            Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Cursor.Show();
            ReportView frm = new ReportView();

            frm.lsReportName = "rptmeetinglabel";
            frm.HLine1       = TxtMeetingNameT.Text;
            frm.HLine2       = TxtDescription.Text;
            frm.HLine3       = TxtPlace.Text;
            frm.Show(this);
        }
Esempio n. 3
0
        private void BtnOK_Click(object sender, EventArgs e)
        {
            Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Cursor.Show();
            //lsGdb.ConnectDatabase();
            string lsStartDate = "", lsEndDate = "";

            switch (lsReportName)
            {
            case "rptmonthlysalereport":
            {
                Int32    li = Convert.ToInt32(CboMonth.SelectedValue);
                DateTime ld = new DateTime();
                lsStartDate = CboYear.Text + "-" + li.ToString("00") + "-01";
                ld          = lsGdb.LastDayofMonth(Convert.ToDateTime(lsStartDate));
                lsEndDate   = lsGdb.SelectDateMySQL(ld);
                lsStartDate = (Convert.ToInt16(CboYear.Text) - 543) + "-" + li.ToString("00") + "-01";
                break;
            }

            case "rptmonthlysummarydeposit":
            {
                Int32    li = Convert.ToInt32(CboMonth.SelectedValue);
                DateTime ld = new DateTime();
                //lsStartDate = CboYear.Text + "-" + li.ToString("00") + "-01";
                lsStartDate = "01/" + li.ToString("00") + "/" + CboYear.Text;
                ld          = lsGdb.LastDayofMonth(Convert.ToDateTime(lsStartDate));
                //lsEndDate = lsGdb.SelectDateMySQL(ld);
                lsEndDate = lsGdb.SelectDateBudda(ld);
                //lsStartDate = (Convert.ToInt16(CboYear.Text)-543) + "-" + li.ToString("00") + "-01";
                break;
            }

            case "rptmemberstatus":
            {
                lsStartDate = lsGdb.SelectDateMySQL(TxtStartDate.Value);
                lsEndDate   = lsGdb.SelectDateMySQL(TxtEndDate.Value);
                break;
            }

            default:
            {
                lsStartDate = lsGdb.SelectDateMySQL(TxtStartDate.Value);
                lsEndDate   = lsGdb.SelectDateMySQL(TxtEndDate.Value);
                break;
            }
            }
            //lsFromMember = CboFromMember.SelectedValue.ToString();
            //lsToMember = CboToMember.SelectedValue.ToString();
            Report lsRpt = new Report();

            lsRpt.Connnection = lsGdb.Gdb;
            switch (lsReportName)
            {
            case "rptmonthlysummarydeposit":
            {
                string   lsEndDate1 = "";
                DateTime ldEndDate;
                if (Chk0111.Checked)
                {
                    lsEndDate = "11" + lsEndDate.Substring(2);
                }
                else if (Chk1222.Checked)
                {
                    lsStartDate = "12" + lsStartDate.Substring(2);
                    lsEndDate   = "22" + lsEndDate.Substring(2);
                }
                else
                {
                    ldEndDate   = lsGdb.LastDayofMonth(Convert.ToDateTime(lsStartDate));
                    lsStartDate = "23" + lsStartDate.Substring(2);
                    lsEndDate   = ldEndDate.Day.ToString("00") + "/" + ldEndDate.Month.ToString("00") + "/" + (ldEndDate.Year + 543);
                }
                CreateMonthlySummaryDeposit(lsStartDate, lsEndDate, CboFromMember.Text, CboToMember.Text, Cbo1.Text, Cbo2.Text, ChkBKK.Checked);
                break;
            }

            case "rptmemberstatus":
            {
                lsRpt.CreateStatusMember(lsStartDate, lsEndDate, "1");
                break;
            }

            default:
            {
                lsRpt.CreateVoucherAcc(lsReportName, lsStartDate, lsEndDate, CboFromMember.Text, CboToMember.Text, Cbo1.Text, Cbo2.Text, true);
                break;
            }
            }
            Cursor.Current = System.Windows.Forms.Cursors.Default;
            Cursor.Show();
            ReportView frm = new ReportView();

            if (lsReportName != "rptmonthlysummarydeposit")
            {
                frm.HLine1 = lsIni.GetString("thahr30", "companyname", "Thai Hotels ");
                frm.HLine2 = lsIni.GetString("report", lsReportName, "DAILY SUMMARY DEPOSIT REPORT ");
                frm.HLine3 = "For date : " + TxtStartDate.Value.ToShortDateString() + " to " + TxtEndDate.Value.ToShortDateString();
            }

            switch (lsReportName)
            {
            case "rptdailypayinrecordpayment":
            {
                frm.HLine1       = lsIni.GetString("thahr30", "companyname", "Thai Hotels ");
                frm.HLine2       = lsIni.GetString("report", lsReportName, "- ");
                frm.lsReportName = lsReportName;
                break;
            }

            case "rptdailypayinrecordsu":
            {
                frm.HLeft2       = "From : " + Cbo1.Text;
                frm.lsReportName = lsReportName;
                break;
            }

            case "rptmonthlysalereport":
            {
                frm.HLine3       = "For the month of : " + CboMonth.Text + " " + (Convert.ToInt16(CboYear.Text) - 543);
                frm.lsReportName = lsReportName;
                break;
            }

            case "rptmonthlysummarydeposit":
            {
                string lsBKK = "";
                if (ChkBKK.Checked == true)
                {
                    lsBKK = "[hotel in bangkok]";
                }
                else
                {
                    lsBKK = "[hotel out of bangkok]";
                }
                frm.HLine3 = "For the month of : " + CboMonth.Text + " " + (Convert.ToInt16(CboYear.Text) - 543) + " " + lsBKK;
                if (Chk0111.Checked)
                {
                    frm.lsReportName = lsReportName + "01_11";
                }
                else if (Chk1222.Checked)
                {
                    frm.lsReportName = lsReportName + "12_22";
                }
                else
                {
                    frm.lsReportName = lsReportName + "23_31";
                }
                break;
            }

            case "":
            {
                frm.HLine3 = Cbo1.Text;
                break;
            }

            default:
            {
                if (ChkSummary.Checked)
                {
                    frm.lsReportName = lsReportName + "summary";
                }
                else
                {
                    frm.lsReportName = lsReportName;
                }
                break;
            }
            }
            frm.Show(this);
        }
Esempio n. 4
0
        private void BtnOK_Click(object sender, EventArgs e)
        {
            Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Cursor.Show();
            lsGdb.ConnectDatabase();
            string lsStartDate = "", lsEndDate = "";

            switch (lsReportName)
            {
            case "rptmonthlysalereport":
            {
                Int32    li = Convert.ToInt32(CboMonth.SelectedValue);
                DateTime ld = new DateTime();
                lsStartDate = CboYear.Text + "-" + li.ToString("00") + "-01";
                ld          = lsGdb.LastDayofMonth(Convert.ToDateTime(lsStartDate));
                lsEndDate   = ld.Year.ToString("0000") + "-" + ld.Month.ToString("00") + "-" + ld.Day.ToString("00");
                lsStartDate = (Convert.ToInt16(CboYear.Text) - 543) + "-" + li.ToString("00") + "-01";
                break;
            }

            case "rptmonthlysummarydeposit":
            {
                Int32    li = Convert.ToInt32(CboMonth.SelectedValue);
                DateTime ld = new DateTime();
                lsStartDate = CboYear.Text + "-" + li.ToString("00") + "-01";
                ld          = lsGdb.LastDayofMonth(Convert.ToDateTime(lsStartDate));
                lsEndDate   = ld.Year.ToString("0000") + "-" + ld.Month.ToString("00") + "-" + ld.Day.ToString("00");
                lsStartDate = (Convert.ToInt16(CboYear.Text) - 543) + "-" + li.ToString("00") + "-01";
                break;
            }

            default:
            {
                lsStartDate = TxtStartDate.Value.Year.ToString("0000") + "-" + TxtStartDate.Value.Month.ToString("00") + "-" + TxtStartDate.Value.Day.ToString("00");
                lsEndDate   = TxtEndDate.Value.Year.ToString("0000") + "-" + TxtEndDate.Value.Month.ToString("00") + "-" + TxtEndDate.Value.Day.ToString("00");
                break;
            }
            }
            //lsFromMember = CboFromMember.SelectedValue.ToString();
            //lsToMember = CboToMember.SelectedValue.ToString();
            Report lsRpt = new Report();

            switch (lsReportName)
            {
            case "rptmonthlysummarydeposit":
            {
                lsRpt.CreateMonthlySummaryDeposit(lsStartDate, lsEndDate, CboFromMember.Text, CboToMember.Text, Cbo1.Text, Cbo2.Text);
                break;
            }

            default:
            {
                lsRpt.CreateVoucherAcc(lsReportName, lsStartDate, lsEndDate, CboFromMember.Text, CboToMember.Text, Cbo1.Text, Cbo2.Text, true);
                break;
            }
            }
            Cursor.Current = System.Windows.Forms.Cursors.Default;
            Cursor.Show();
            ReportView frm = new ReportView();

            if (ChkSummary.Checked)
            {
                frm.lsReportName = lsReportName + "summary";
            }
            else
            {
                frm.lsReportName = lsReportName;
            }

            frm.Show(this);
        }
Esempio n. 5
0
        private void TvwMain_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            Cursor.Show();
            if (lsGdb.Gdb.State == ConnectionState.Closed)
            {
                lsGdb.ConnectDatabase();
            }
            switch (e.Node.Name)
            {
            case "voucheradd":
                VoucherAdd frm = new VoucherAdd();
                frm.Connnection = lsGdb.Gdb;
                frm.Show(this);
                break;

            case "voucherview":
                VoucherView frm1 = new VoucherView();
                frm1.Connnection = lsGdb.Gdb;
                frm1.Show();
                break;

            case "memberview":
                MemberView frm2 = new MemberView();
                frm2.Connnection = lsGdb.Gdb;
                frm2.Show(this);
                break;

            case "memberadd":
                MemberAdd frm3 = new MemberAdd();
                frm3.Connnection = lsGdb.Gdb;
                frm3.Show(this);
                break;

            case "importdata":
                ImportData frm4 = new ImportData();
                frm4.Show(this);
                break;

            case "membersearch":
                MemberSearch frm5 = new MemberSearch();
                frm5.Show(this);
                break;

            case "senddata":
                ShopSendData frm6 = new ShopSendData();
                frm6.Show(this);
                break;

            case "preparedata":
                KingPowerGenData frm7 = new KingPowerGenData();
                frm7.Connnection = lsGdb.Gdb;
                frm7.Show(this);
                break;

            case "nationality":
                InitialAdd frm8 = new InitialAdd();
                frm8.TableName   = e.Node.Name;
                frm8.ColumnCode  = "nationcode";
                frm8.ColumnNameE = "nationname";
                frm8.OrderBy     = "nationcode";
                frm8.Show(this);
                break;

            case "salutation":
                InitialAdd frm9 = new InitialAdd();
                frm9.TableName   = "salutation";
                frm9.ColumnCode  = "salcode";
                frm9.ColumnNameE = "salnamee";
                frm9.OrderBy     = "salcode";
                frm9.Show(this);
                break;

            case "shopview":
                ShopView frm10 = new ShopView();
                frm10.Connnection = lsGdb.Gdb;
                frm10.Show(this);
                break;

            case "rptdailypayinrecord":
                ReportCriteria frm11 = new ReportCriteria();
                frm11.Connnection  = lsGdb.Gdb;
                frm11.lsReportName = e.Node.Name;
                frm11.Show(this);
                break;

            case "rptrecordofdeposit":
                ReportCriteria frm12 = new ReportCriteria();
                frm12.Connnection  = lsGdb.Gdb;
                frm12.lsReportName = e.Node.Name;
                frm12.Show(this);
                break;

            case "rptmonthlysalereport":
                ReportCriteria frm13 = new ReportCriteria();
                frm13.Connnection  = lsGdb.Gdb;
                frm13.lsReportName = e.Node.Name;
                frm13.Show(this);
                break;

            case "rptmonthlysummarydeposit":
                ReportCriteria frm14 = new ReportCriteria();
                frm14.Connnection  = lsGdb.Gdb;
                frm14.lsReportName = e.Node.Name;
                frm14.Show(this);
                break;

            case "webkingpower":
                KingPowerWeb frm15 = new KingPowerWeb();
                //frm15.lsReportName = e.Node.Name;
                frm15.Show(this);
                break;

            case "accrecvoucher":
                AccRecVoucher frm16 = new AccRecVoucher();
                frm16.Connnection = lsGdb.Gdb;
                frm16.Show(this);
                break;

            case "rptrecordofdepositkingpower":
                ReportCriteria frm17 = new ReportCriteria();
                frm17.Connnection  = lsGdb.Gdb;
                frm17.lsReportName = e.Node.Name;
                frm17.Show(this);
                break;

            case "typebis":
                InitialAdd frm18 = new InitialAdd();
                frm18.TableName   = "typebis";
                frm18.ColumnCode  = "tbiscode";
                frm18.ColumnNameE = "tbisname";
                frm18.OrderBy     = "tbiscode";
                frm18.Show(this);
                break;

            case "typemem":
                InitialAdd frm19 = new InitialAdd();
                frm19.TableName   = "typemem";
                frm19.ColumnCode  = "tmemcode";
                frm19.ColumnNameE = "tmemname";
                frm19.OrderBy     = "tmemcode";
                frm19.Show(this);
                break;

            case "typeroom":
                InitialAdd frm20 = new InitialAdd();
                frm20.TableName   = "typeroom";
                frm20.ColumnCode  = "plcode";
                frm20.ColumnNameE = "plnamee";
                frm20.OrderBy     = "plcode";
                frm20.Show(this);
                break;

            case "shift":
                InitialAdd frm21 = new InitialAdd();
                frm21.TableName   = "shift";
                frm21.ColumnCode  = "shiftcode";
                frm21.ColumnNameE = "shiftname";
                frm21.OrderBy     = "shiftcode";
                frm21.Show(this);
                break;

            case "location":
                InitialAdd frm22 = new InitialAdd();
                frm22.TableName   = "location";
                frm22.ColumnCode  = "locationcode";
                frm22.ColumnNameE = "locationnamet";
                frm22.OrderBy     = "locationcode";
                frm22.Show(this);
                break;

            case "accinvoice":
                AccInvoice frm23 = new AccInvoice();
                frm23.Connnection = lsGdb.Gdb;
                frm23.Show(this);
                break;

            case "rptsalereport":
                ReportCriteria frm24 = new ReportCriteria();
                frm24.Connnection  = lsGdb.Gdb;
                frm24.lsReportName = e.Node.Name;
                frm24.Show(this);
                break;

            case "rptsalereportcounter":
                ReportCriteria frm29 = new ReportCriteria();
                frm29.Connnection  = lsGdb.Gdb;
                frm29.lsReportName = e.Node.Name;
                frm29.Show(this);
                break;

            case "rptdailypayinrecordmanager":
                ReportCriteria frm25 = new ReportCriteria();
                frm25.Connnection  = lsGdb.Gdb;
                frm25.lsReportName = e.Node.Name;
                frm25.Show(this);
                break;

            case "accmemberyear":
                AccMemberYear frm26 = new AccMemberYear();
                frm26.Connnection = lsGdb.Gdb;
                frm26.Show(this);
                break;

            case "rptsumtypemember":
                //ReportCriteria frm27 = new ReportCriteria();  rptsumtypememregion
                //frm27.Connnection = lsGdb.Gdb;
                //frm27.lsReportName = e.Node.Name;
                //frm26.Show(this);
                Report Report = new Report();
                Report.SumTypeMember(true);
                ReportView Rpt = new ReportView();
                Rpt.ReportFileName = e.Node.Name;
                Rpt.Show(this);
                break;

            case "rptsumtypememberregion":
                //ReportCriteria frm27 = new ReportCriteria();  rptsumtypememregion
                //frm27.Connnection = lsGdb.Gdb;
                //frm27.lsReportName = e.Node.Name;
                //frm26.Show(this);
                Report Report1 = new Report();
                Report1.SumTypeMemberRegion(true);
                ReportView Rpt1 = new ReportView();
                Rpt1.HLine2         = "Report Summary Member Group By region";
                Rpt1.ReportFileName = e.Node.Name;
                Rpt1.Show(this);
                break;

            case "memberskk9":
                MemberSKK9 frm27 = new MemberSKK9();
                frm27.Connnection = lsGdb.Gdb;
                frm27.Show(this);
                break;

            case "staffview":
                StaffView frm28 = new StaffView();
                frm28.FlagStafF   = StaffView.FlagStaff.Staff;
                frm28.Connnection = lsGdb.Gdb;
                frm28.Show(this);
                break;

            case "committeeview":
                StaffView frm37 = new StaffView();
                frm37.FlagStafF   = StaffView.FlagStaff.Committee;
                frm37.Connnection = lsGdb.Gdb;
                frm37.Show(this);
                break;

            case "prview":
                StaffView frm38 = new StaffView();
                frm38.FlagStafF   = StaffView.FlagStaff.PR;
                frm38.Connnection = lsGdb.Gdb;
                frm38.Show(this);
                break;

            case "guessview":
                StaffView frm39 = new StaffView();
                frm39.FlagStafF   = StaffView.FlagStaff.Guess;
                frm39.Connnection = lsGdb.Gdb;
                frm39.Show(this);
                break;

            case "addressdistrict":
                AddressDistrict frm30 = new AddressDistrict();
                frm30.Connnection = lsGdb.Gdb;
                frm30.FormName    = AddressDistrict.FormName1.FormDistrict;
                frm30.Show(this);
                break;

            case "addresssubdistrict":
                AddressDistrict frm31 = new AddressDistrict();
                frm31.Connnection = lsGdb.Gdb;
                frm31.FormName    = AddressDistrict.FormName1.FormSubDistrict;
                frm31.Show(this);
                break;

            case "serviceip":
                ServiceIP frm32 = new ServiceIP();
                //frm15.lsReportName = e.Node.Name;
                frm32.Show(this);
                break;

            case "rptmemberstatus":
            {
                ReportCriteria frm33 = new ReportCriteria();
                frm33.Connnection  = lsGdb.Gdb;
                frm33.lsReportName = e.Node.Name;
                frm33.Show(this);
                break;
            }

            case "rptdailypayinrecordsu":
                ReportCriteria frm34 = new ReportCriteria();
                frm34.Connnection  = lsGdb.Gdb;
                frm34.lsReportName = e.Node.Name;
                frm34.Show(this);
                break;

            case "rptdailypayinrecordpayment":
                ReportCriteria frm35 = new ReportCriteria();
                frm35.Connnection  = lsGdb.Gdb;
                frm35.lsReportName = e.Node.Name;
                frm35.Show(this);
                break;

            case "membermeetingview":
                MeetingView frm36 = new MeetingView();
                frm36.Connnection = lsGdb.Gdb;
                frm36.Show(this);
                break;

            case "membersendemail":
                MemberSendEmail frm371 = new MemberSendEmail();
                //frm37.Connnection = lsGdb.Gdb;
                frm371.Show(this);
                break;

            case "meetingsendmail":
                //MeetingSendMail frm37 = new MeetingSendMail();
                //frm37.Connnection = lsGdb.Gdb;
                //frm37.Show(this);membersendemail
                break;
            }
            Cursor.Current = System.Windows.Forms.Cursors.Default;
            Cursor.Show();
        }