예제 #1
0
        private void dgBindingFrm_Load(object sender, EventArgs e)
        {
            //Initialize Controller
            m_AppController = new AppController();

            /* Note that the DataProvider class is static, so it doesn't
             * get instantiated. */

            //Get Customer List
            CommandGettingOutlet getOutlets = new CommandGettingOutlet();

            m_OutletList = (outletList)m_AppController.ExecuteCommand(getOutlets);

            // Get invoices List
            CommandGetInvoices getInvoices = new CommandGetInvoices();

            m_Invoices = (InvoiceList)m_AppController.ExecuteCommand(getInvoices);

            CommandGetRoti getRoti = new CommandGetRoti();

            m_RotiList = (RotiToChooseList)m_AppController.ExecuteCommand(getRoti);

            //Bind Grids
            outletItemBindingSource.DataSource       = m_OutletList;
            rotiToChooseItemBindingSource.DataSource = m_RotiList;

            bindingInvoice.DataSource = m_Invoices;
            bindingItem.DataSource    = bindingInvoice;
            bindingItem.DataMember    = "Items";
        }
예제 #2
0
        private void detailedBindingForm_Load(object sender, EventArgs e)
        {
            m_AppController = new AppController();
            m_Control       = new miscellanacousFunction();

            CommandGetInvoices getInvoices = new CommandGetInvoices();

            m_InvoiceList = (InvoiceList)m_AppController.ExecuteCommand(getInvoices);

            CommandGetOutlet getOutlets = new CommandGetOutlet();

            m_OutletList = (outletList)m_AppController.ExecuteCommand(getOutlets);

            CommandGetRoti getRoti = new CommandGetRoti();

            m_RotiToChooseList = (RotiToChooseList)m_AppController.ExecuteCommand(getRoti);

            outletItemBindingSource.DataSource   = m_OutletList;
            RotiToChooseBindingSource.DataSource = m_RotiToChooseList;

            invoiceItemBindingSource.DataSource = m_InvoiceList;
            itemsBindingSource.DataSource       = invoiceItemBindingSource;
            itemsBindingSource.DataMember       = "Items";

            //invoiceItemBindingSource.Position = 0;
        }
예제 #3
0
        public void ListRotiToChoose(RotiToChooseList rotiList)
        {
            //Build a query string
            string sql = string.Format("SELECT ITEMCODE, ITEMNAME, ITEMSORT, Brand, Jenis, Category, SubCategory, Price, Stat FROM [ITEM]");

            //Get a dataset from the query
            DataSet dataSet = DataProvider.GetDataSet(sql);

            //Create variables for dataset
            DataTable rotiTable = dataSet.Tables[0];

            //Load roti list from the database
            RotiToChooseItem nextRoti = null;

            foreach (DataRow parent in rotiTable.Rows)
            {
                nextRoti             = new RotiToChooseItem();
                nextRoti.ItemCode    = parent["itemCode"].ToString();
                nextRoti.ItemName    = parent["itemName"].ToString();
                nextRoti.ItemSort    = parent["itemSort"].ToString();
                nextRoti.Brand       = parent["Brand"].ToString();
                nextRoti.Jenis       = parent["Jenis"].ToString();
                nextRoti.Category    = parent["Category"].ToString();
                nextRoti.SubCategory = parent["SubCategory"].ToString();
                nextRoti.Price       = Convert.ToDecimal(parent["Price"]);
                nextRoti.Stat        = Convert.ToBoolean(parent["Stat"]);

                //Add the data item to the data list
                rotiList.Add(nextRoti);
            }

            //Dispose of the dataset
            dataSet.Dispose();
        }
예제 #4
0
        private void itemFrm_Load(object sender, EventArgs e)
        {
            //Initialize Controller
            m_AppController = new AppController();

            /* Note that the DataProvider class is static, so it doesn't
             * get instantiated. */

            // Get invoices List

            CommandGetRoti getRotis = new CommandGetRoti();

            m_List = (RotiToChooseList)m_AppController.ExecuteCommand(getRotis);

            //Bind Grids
            bindingSource1.DataSource = m_List;
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            //ReportDocument invoiceObjectReport = new ReportDocument(); ;
            //invoiceObjectReport.Load(Application.StartupPath + "\\rptInvoice.rpt");


            m_AppController = new AppController();

            CommandGetInvoices getInvoices = new CommandGetInvoices();

            m_InvoiceList = (InvoiceList)m_AppController.ExecuteCommand(getInvoices);

            CommandGettingOutlet getOutlet = new CommandGettingOutlet();

            m_OutletList = (outletList)m_AppController.ExecuteCommand(getOutlet);

            CommandGetRoti getRotis = new CommandGetRoti();

            m_RotiToChooseList = (RotiToChooseList)m_AppController.ExecuteCommand(getRotis);

            CommandGetItem getInvoiceDetai = new CommandGetItem();

            m_InvoiceDetailList = (RotiList)m_AppController.ExecuteCommand(getInvoiceDetai);


            //FieldingRw crInvoice = new FieldingRw();
            rptInvoice crInvoice = new rptInvoice();

            //rptSubReportInvoice crInvoice = new rptSubReportInvoice();

            //Set DataSource First
            crInvoice.Database.Tables["Invoice_OTC_Model_InvoiceItem"].SetDataSource(m_InvoiceList);
            crInvoice.Subreports[0].Database.Tables["Invoice_OTC_Model_RotiToChooseItem"].SetDataSource(m_RotiToChooseList);
            crInvoice.Subreports[0].Database.Tables["Invoice_OTC_Model_RotiItem"].SetDataSource(m_InvoiceDetailList);
            crInvoice.Database.Tables["Invoice_OTC_Model_OutletItem"].SetDataSource(m_OutletList);

            //Set the parameter value
            crInvoice.SetParameterValue("nomorInvoice", nomorInvoice);

            crystalReportViewer1.ReportSource = crInvoice;
            crystalReportViewer1.Refresh();
        }
예제 #6
0
        public override object Execute()
        {
            RotiToChooseList rotiList = new RotiToChooseList();

            return(rotiList);
        }
예제 #7
0
 public CommandDeleteRoti(RotiToChooseList list, RotiToChooseItem item)
 {
     m_List = list;
     m_Item = item;
 }
예제 #8
0
 public CommandSaveRotiList(RotiToChooseList list)
 {
     m_List = list;
 }