コード例 #1
0
ファイル: _Insert.ascx.cs プロジェクト: marioricci/erp-luma
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();

			StockTypes clsStockTypes = new StockTypes();
			cboStockTypes.DataTextField = "StockTypeCode";
			cboStockTypes.DataValueField = "StockTypeID";
			cboStockTypes.DataSource = clsDataClass.DataReaderToDataTable(clsStockTypes.List("StockTypeCode", SortOption.Ascending)).DefaultView;
			cboStockTypes.DataBind();
			cboStockTypes.SelectedIndex = cboStockTypes.Items.Count - 1;

            Contacts clsContact = new Contacts(clsStockTypes.Connection, clsStockTypes.Transaction);
			cboSupplier.DataTextField = "ContactName";
			cboSupplier.DataValueField = "ContactID";
			cboSupplier.DataSource = clsDataClass.DataReaderToDataTable(clsContact.Suppliers(null, 0, "ContactName", SortOption.Ascending)).DefaultView;
			cboSupplier.DataBind();

            Branch clsBranch = new Branch(clsStockTypes.Connection, clsStockTypes.Transaction);
            cboBranch.DataTextField = "BranchCode";
            cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource = clsBranch.ListAsDataTable().DefaultView;
            cboBranch.DataBind();
            
            clsStockTypes.CommitAndDispose();

            cboStockTypes_SelectedIndexChanged(null, null);
            cboSupplier.SelectedIndex = 0;
            cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));

			NewTransaction();
		}
コード例 #2
0
ファイル: _Update.ascx.cs プロジェクト: marioricci/erp-luma
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();

            Banks clsBank = new Banks();
            cboBank.DataTextField = "BankCode";
            cboBank.DataValueField = "BankID";
            cboBank.DataSource = clsBank.ListAsDataTable().DefaultView;
            cboBank.DataBind();
            clsBank.CommitAndDispose();
            cboBank.SelectedIndex = 0;
            cboBank_SelectedIndexChanged(null, null);

			Contacts clsContact = new Contacts();
			cboPayee.DataTextField = "ContactCode";
			cboPayee.DataValueField = "ContactID";
			cboPayee.DataSource = clsDataClass.DataReaderToDataTable(clsContact.Suppliers(null, 0, "ContactName", SortOption.Ascending)).DefaultView;
			cboPayee.DataBind();
			clsContact.CommitAndDispose();
			cboPayee.SelectedIndex = 0;

			txtChequeDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
			lblPaymentID.Text = "0";
			lblTotalDebitAmount.Text = "0.00";
			lblTotalCreditAmount.Text = "0.00";
			lblTotalAmount.Text = "0.00";

			txtPostingDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
			LoadAccount();
		}
コード例 #3
0
ファイル: _Insert.ascx.cs プロジェクト: marioricci/erp-luma
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();

			ProductGroup clsProductGroup = new ProductGroup();
			cboProductGroup.DataTextField = "ProductGroupName";
			cboProductGroup.DataValueField = "ProductGroupID";
			cboProductGroup.DataSource = clsProductGroup.ListAsDataTable(SortField:"ProductGroupName").DefaultView;
			cboProductGroup.DataBind();
			cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1;

            Data.Unit clsUnit = new Data.Unit(clsProductGroup.Connection, clsProductGroup.Transaction);
			cboProductUnit.DataTextField = "UnitName";
			cboProductUnit.DataValueField = "UnitID";
			cboProductUnit.DataSource = clsUnit.ListAsDataTable(SortField:"UnitName").DefaultView;
			cboProductUnit.DataBind();
			cboProductUnit.SelectedIndex = cboProductUnit.Items.Count - 1;

            ContactColumns clsContactColumns = new ContactColumns();
            clsContactColumns.ContactID = true;
            clsContactColumns.ContactName = true;

            ContactColumns clsContactSearchColumns = new ContactColumns();

			Contacts clsContact = new Contacts(clsProductGroup.Connection , clsProductGroup.Transaction);
			cboSupplier.DataTextField = "ContactName";
			cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource = clsContact.Suppliers(clsContactColumns, 0, System.Data.SqlClient.SortOrder.Ascending, clsContactSearchColumns, string.Empty, 0, false, "ContactName", System.Data.SqlClient.SortOrder.Ascending).DefaultView;
			cboSupplier.DataBind();
			cboSupplier.SelectedIndex = cboSupplier.Items.Count - 1;

            //// Added July 9, 2010
            // Remove Nov 22, 2011 - overwritten when a subgroup is selected
            //Terminal clsTerminal = new Terminal(clsProductGroup.Connection, clsProductGroup.Transaction);
            //TerminalDetails clsTerminalDetails = clsTerminal.Details(1);
            //txtWSPriceMarkUp.Text = clsTerminalDetails.WSPriceMarkUp.ToString();
            //txtMargin.Text = clsTerminalDetails.RETPriceMarkUp.ToString();
            //txtVAT.Text = clsTerminalDetails.VAT.ToString("###.#0");
            //txtEVAT.Text = clsTerminalDetails.EVAT.ToString("###.#0");
            //txtLocalTax.Text = clsTerminalDetails.LocalTax.ToString("###.#0");

			clsProductGroup.CommitAndDispose();	

			cboProductGroup_SelectedIndexChanged(null, null);
		}
コード例 #4
0
ファイル: _Update.ascx.cs プロジェクト: marioricci/erp-luma
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();
			Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"],Session.SessionID));

			ProductGroup clsProductGroup = new ProductGroup();
			cboProductGroup.DataTextField = "ProductGroupName";
			cboProductGroup.DataValueField = "ProductGroupID";
			cboProductGroup.DataSource = clsProductGroup.ListAsDataTable(SortField:"ProductGroupName").DefaultView;
			cboProductGroup.DataBind();
			cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1;

            Data.Unit clsUnit = new Data.Unit(clsProductGroup.Connection, clsProductGroup.Transaction);
			cboProductUnit.DataTextField = "UnitName";
			cboProductUnit.DataValueField = "UnitID";
			cboProductUnit.DataSource = clsUnit.ListAsDataTable(SortField:"UnitName").DefaultView;
			cboProductUnit.DataBind();
			cboProductUnit.SelectedIndex = cboProductUnit.Items.Count - 1;
			clsUnit.CommitAndDispose();

            ContactColumns clsContactColumns = new ContactColumns();
            clsContactColumns.ContactID = true;
            clsContactColumns.ContactName = true;

            ContactColumns clsContactSearchColumns = new ContactColumns();

            Contacts clsContact = new Contacts(clsProductGroup.Connection, clsProductGroup.Transaction);
            cboSupplier.DataTextField = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource = clsContact.Suppliers(clsContactColumns, 0, System.Data.SqlClient.SortOrder.Ascending, clsContactSearchColumns, string.Empty, 0, false, "ContactName", System.Data.SqlClient.SortOrder.Ascending).DefaultView;
            cboSupplier.DataBind();
            cboSupplier.SelectedIndex = cboSupplier.Items.Count - 1;

			ProductUnitsMatrix clsUnitMatrix = new ProductUnitsMatrix(clsProductGroup.Connection, clsProductGroup.Transaction);
			ProductUnitsMatrixDetails clsUnitDetails = clsUnitMatrix.LastDetails(iID);

			if (clsUnitDetails.BottomUnitName == null)
			{
				cboProductUnit.Enabled = true;
			}

            // Added July 9, 2010
            Terminal clsTerminal = new Terminal(clsProductGroup.Connection, clsProductGroup.Transaction);
            TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());
            txtWSPriceMarkUp.Text = clsTerminalDetails.WSPriceMarkUp.ToString();
            txtMargin.Text = clsTerminalDetails.RETPriceMarkUp.ToString();

			clsProductGroup.CommitAndDispose();	
		}