Esempio n. 1
0
 public HDPlannerForm(MainForm frmMainIn)
 {
     InitializeComponent();
     frmMain = frmMainIn;
     dtpServiceDate.Value = DateTime.Today;
     dadAdpt = new SqlDataAdapter();
     dset    = new DataSet();
     conn    = new SqlConnection(CCFBGlobal.connectionString);
     filllvwStatus();
     clsHDRoute.openWhere(" ORDER BY RouteTitle");
     if (clsHDRoute.RowCount > 0)
     {
         cboHDRoute.DataSource    = clsHDRoute.DTable;
         cboHDRoute.DisplayMember = "RouteTitle";
         cboHDRoute.ValueMember   = "ID";
     }
     else
     {
         cboHDRoute.DataSource = null;
         cboHDRoute.Items.Add("No Selection");
     }
     CCFBGlobal.dtPopulateCombo((DataGridViewComboBoxColumn)dgvHD.Columns["clmSvcItem"], "SELECT * From HDItems", "ShortName", "ID", "Std", conn);
     //CCFBGlobal.InitCombo(cboHDRoute, CCFBGlobal.parmTbl_HomeDeliveryRoutes);
     andStatement             = " And h.HDRoute = " + cboHDRoute.SelectedValue + " ";
     cboOrderBy.SelectedIndex = 0;
     loadList();
 }
Esempio n. 2
0
        public void initForm()
        {
            loadingData      = true;
            curHHID          = clsHH.ID;
            clsVoucher       = new VoucherLog(conn);
            loadingData      = true;
            dtpTrxDate.Value = DateTime.Today;
            pnlEditVLog.Dock = DockStyle.Fill;
            pnlSelect.Dock   = DockStyle.Fill;
            setEditMode(false);

            CCFBGlobal.InitCombo(cboClientType, CCFBGlobal.parmTbl_Client);
            CCFBGlobal.dtPopulateCombo(cboNewVoucherItem, "SELECT * FROM VoucherItems ORDER BY UID", "Description", "UID", "No Selection", conn);

            foreach (TextBox tb in pnlEditVLog.Controls.OfType <TextBox>())
            {
                tb.Text = "";
                if (tb.Tag != null)
                {
                    if (tb.Tag.ToString() != "")
                    {
                        tb.Text = clsHH.GetDataString(tb.Tag.ToString());
                    }
                    tbFamData.Add(tb);
                    tb.LostFocus += new System.EventHandler(this.tbFamData_LostFocus);
                }
            }
            foreach (CheckBox chk in pnlEditVLog.Controls.OfType <CheckBox>())
            {
                chk.Checked = Convert.ToBoolean(clsHH.GetDataValue(chk.Tag.ToString()));
                chkList.Add(chk);
            }
            tbClient.Text = curHHID.ToString() + Environment.NewLine + clsHH.Name;
            cboClientType.SelectedValue = clsHH.ClientType.ToString();

            //fillClientInfo();
            loadVItmsList();
            //loadList();
            loadingData = false;
        }