Exemple #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";
        }
        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;
        }
Exemple #3
0
        /// <summary>
        /// To get list per salesman
        /// </summary>
        /// <param name="list"></param>
        /// <param name="slsmCode"></param>
        internal void ShowList(outletList list, string slsmCode)
        {
            //Build a query string
            string sql = string.Format("SELECT [OUTLCODE],[OUTLNAME],[OUTLADDRESS],[OUTLSLSM],[OUTLROUTE],[OUTLSTAT] FROM [OTF_Invoice].[dbo].[OUTLET] WHERE [OUTLSLSM] = '" + slsmCode + "'");

            //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
            outletItem nextItem = null;

            foreach (DataRow parent in rotiTable.Rows)
            {
                nextItem               = new outletItem();
                nextItem.OutletCode    = parent["OUTLCODE"].ToString();
                nextItem.OutletName    = parent["OUTLNAME"].ToString();
                nextItem.OutletAddress = parent["OUTLADDRESS"].ToString();
                nextItem.OutletRoute   = parent["OUTLROUTE"].ToString();
                nextItem.SlsmCode      = parent["OUTLSLSM"].ToString();
                nextItem.OutletStatus  = Convert.ToBoolean(parent["OUTLSTAT"]);

                //Add the data item to the data list
                if (nextItem.OutletCode == "")
                {
                    nextItem.DeleteDatabaseRecord();
                }
                list.Add(nextItem);
            }

            //Dispose of the dataset
            dataSet.Dispose();
        }
Exemple #4
0
        private void FrmOutlet_Load(object sender, EventArgs e)
        {
            m_AppController = new AppController();

            CommandGettingOutlet getOutlet = new CommandGettingOutlet();

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

            outletItemBindingSource.DataSource = m_List;
        }
        private void FrmViewInvoice_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_Outlet = (outletList)m_AppController.ExecuteCommand(getOutlets);

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

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


            invoiceItemBindingSource.DataSource = m_Invoices;


            #region [ CardView... ]

            //card.CaptionField = "OUTLETCODE";
            //card.CardSpacingWidth = 10;
            //card.CardSpacingHeight = 10;
            //card.MaxCardCols = 5;
            //card.CaptionHeight = 35;
            //card.CardBackColor = Color.Lavender;
            //card.WireGrid(this.gridDataBoundGrid1);

            #endregion

            //Assumes this.dataTable is a DataTable object with at least 2 columns named "id" and "display".



            //Sets the style properties.

            GridStyleInfo style = this.gridDataBoundGrid1.GridBoundColumns[3].StyleInfo;

            style.CellType = "ComboBox";

            style.DataSource = m_Outlet;

            //Displays in the grid cell.
            style.DisplayMember = "OutletName";

            //Values in the grid cell.
            style.ValueMember = "OutletCode";

            style.DropDownStyle = GridDropDownStyle.AutoComplete;
        }
Exemple #6
0
        private void salesmanItemBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            if (m_SalesmanList == null)
            {
                return;
            }

            m_Item = (SalesmanItem)salesmanItemBindingSource.Current;
            if (m_Item == null)
            {
                return;
            }

            CommandGetOutletBySalesman getOutlet = new CommandGetOutletBySalesman(m_Item.SlsmCode);

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

            outletItemBindingSource.DataSource = m_OutletList;
        }
        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();
        }
 public CommandDeleteOutlet(outletList list, outletItem item)
 {
     m_List = list;
     m_Item = item;
 }
        public override object Execute()
        {
            outletList list = new outletList();

            return(list);
        }