📄 frmmainmenu.cs
字号:
fRpt.Show();
}
private void mnuStockRptStockNumLessThan10_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\StckBottom10Rep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\StckBottom10Rep.rpt";
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuStockRptStockTop10_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\StckTop10Rep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\StckTop10Rep.rpt";
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuSalesMgmtRptBillsToday_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\BillTodayRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
// fRpt.crvReportViewer.ReportSource = @"..\..\Reports\ BillTodayRep.rpt";
fRpt.crvReportViewer.SelectionFormula ="{Bills.BillDate}=#" +DateTime.Today +"#";
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuSalesMgmtRptBillsWeek_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\BillWeekRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\BillWeekRep.rpt";
int dayofweek=0;
switch(DateTime.Today.DayOfWeek)
{
case DayOfWeek.Monday: dayofweek = 1;break;
case DayOfWeek.Tuesday: dayofweek = 2;break;
case DayOfWeek.Wednesday: dayofweek = 3;break;
case DayOfWeek.Thursday: dayofweek = 4;break;
case DayOfWeek.Friday: dayofweek = 5;break;
case DayOfWeek.Saturday: dayofweek = 6;break;
case DayOfWeek.Sunday: dayofweek = 0;break;
}
DateTime currentdt=DateTime.Today;
DateTime weekstartdt=currentdt.AddDays (-dayofweek);
fRpt.crvReportViewer.SelectionFormula ="{Bills.BillDate} >= #"+weekstartdt+"# and {Bills.BillDate}<= #" + currentdt + "#";
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuSalesMgmtRptBillsMonth_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\BillMonthRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\BillMonthRep.rpt";
fRpt.crvReportViewer.SelectionFormula ="Month({Bills.BillDate})="+DateTime.Today.Month;
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuSalesMgmtRptBillsYear_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\BillYearRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\BillYearRep.rpt";
fRpt.crvReportViewer.SelectionFormula ="Year({Bills.BillDate})="+DateTime.Today.Year;
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuSalesMgmtRptBillsCurrDisRpt_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\CurrDiscRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"\Reports\CurrDiscRep.rpt";
fRpt.crvReportViewer.SelectionFormula="Date({Discount.ValidFrom})=#" +DateTime.Today.Date +"# and "+"Date({Discount.ValidTo}) =#" +DateTime.Today.Date+"#";
//MessageBox.Show("{Discount.ValidFrom}=" +DateTime.Today.Date +" and "+"{Discount.ValidTo} =" +DateTime.Today.Date);
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuTellerRptSalesToday_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\TellerBillTodayRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\TellerBillTodayRep.rpt";
fRpt.crvReportViewer.SelectionFormula="{Bills.UsrId}='" +frmLogin.loginId +"'" +" and {Bills.BillDate}=#" +DateTime.Today+"#";
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuTellerRptSalesMonth_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\TellerBillMonthRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\TellerBillMonthRep.rpt";
fRpt.crvReportViewer.SelectionFormula="{Bills.UsrId}='" +frmLogin.loginId +"'" +" and "+"Month({Bills.BillDate})= "+DateTime.Today.Month;
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuTellerRptSalesAll_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\TellerBillReport.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
//fRpt.crvReportViewer.ReportSource = @"..\..\Reports\TellerBillReport.rpt";
fRpt.crvReportViewer.SelectionFormula="{Bills.UsrId}='" +frmLogin.loginId +"'" +" and "+"Year({Bills.BillDate})= "+DateTime.Today.Year;
fRpt.crvReportViewer.RefreshReport();
fRpt.MdiParent = this;
fRpt.Left = this.Left;
fRpt.Top = this.Top;
fRpt.Show();
}
private void mnuWindowsCloseAll_Click(object sender, System.EventArgs e)
{
DialogResult YesNo;
if(this.MdiChildren.Length > 0)
{
YesNo = MessageBox.Show("您要关闭所有窗体吗?","关闭",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
if(YesNo.ToString() == "Yes")
{
foreach(Form frm in this.MdiChildren)
{
frm.Close();
}
}
}
else
{
MessageBox.Show("没有打开窗体");
}
}
private void mnuProductPdtMgmt_Click(object sender, System.EventArgs e)
{
varPrdMgmt++;
if(varPrdMgmt == 1)
{
frmProductDetails frmPrDet =new frmProductDetails();
frmPrDet.MdiParent = this;
frmPrDet.Left = this.Left ;
frmPrDet.Top = this.Top;
frmPrDet.Show();
}
else
{
MessageBox.Show("产品管理窗体已加载");
}
}
private void mnuProductPrdCtgy_Click(object sender, System.EventArgs e)
{
varPrdCategory++;
if(varPrdCategory == 1)
{
frmCategory frmCat =new frmCategory();
frmCat.MdiParent = this;
frmCat.Left = this.Left ;
frmCat.Top = this.Top;
frmCat.Show();
}
else
{
MessageBox.Show("产品类别窗体已加载");
}
}
private void mnuTellerPrdSales_Click(object sender, System.EventArgs e)
{
varPrdSales++;
if(varPrdSales == 1)
{
frmProductSales frmPrSales =new frmProductSales(frmLogin.loginId);
frmPrSales.MdiParent = this;
frmPrSales.Left = this.Left ;
frmPrSales.Top = this.Top;
frmPrSales.Show();
}
else
{
MessageBox.Show("产品销售窗体已加载");
}
}
private void mnuSalesMgmtRtnMgmt_Click(object sender, System.EventArgs e)
{
varRtnMgmt++;
if(varRtnMgmt == 1)
{
frmReturn frmRet=new frmReturn();
frmRet.MdiParent = this;
frmRet.Left = this.Left ;
frmRet.Top = this.Top;
frmRet.Show();
}
else
{
MessageBox.Show("退货管理窗体已加载");
}
}
private void mnuSalesMgmtRptStatPrdSoldTodayByCount_Click(object sender, System.EventArgs e)
{
this.grpReportNotification.Visible = true;
this.tmrMenu.Enabled =true;
this.pgrReport.Visible = true;
fRpt = new frmReport();
fRpt.crvReportViewer.Visible=true;
fRpt.crvReportViewer.SetBounds(this.Top,this.Left,this.Size.Width,this.Size.Height);
initialLoad(settings.uiDirectory+@"\Reports\ProdSellCountRep.rpt");
fRpt.crvReportViewer.ReportSource = repDoc;
/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -