Exemplo n.º 1
0
        protected void MonthYear_Combo_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = POClass.MRPMonthYearTable();

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "PK";
            l_value.Width     = 0;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "MRPMonth";
            l_text.Caption   = "Month";
            combo.Columns.Add(l_text);

            ListBoxColumn l_text2 = new ListBoxColumn();

            l_text2.FieldName = "MRPYear";
            l_text2.Caption   = "Year";
            combo.Columns.Add(l_text2);

            combo.ValueField = "PK";
            combo.TextField  = "MRPMonth";
            combo.DataBind();
            combo.TextFormatString = "{1} {2}";
        }
Exemplo n.º 2
0
        protected void EntityCode_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = GlobalClass.EntityTable();
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;
            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 30;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer;

            //MRPClass.PrintString("exp:" + !container.Grid.IsNewRowEditing);
            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "EntityCode").ToString();
            }
        }
Exemplo n.º 3
0
        protected void ComboBoxCustomer_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOACustomer(0, 0);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 100;
            lv.FieldName = "CustAccount";
            lv.Caption   = "Customer Code";
            combo.Columns.Add(lv);

            ListBoxColumn lt1 = new ListBoxColumn();

            lt1.FieldName = "CustName";
            lt1.Caption   = "Customer Name";
            lt1.Width     = 200;
            combo.Columns.Add(lt1);

            combo.ValueField = "CustAccount";
            combo.TextField  = "CustName";
            combo.DataBind();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //combo.ValueType = typeof(String);
        }
Exemplo n.º 4
0
        protected void UserStatus_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = AccountClass.UserStatusTable();
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;

            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 0;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            l_TextField.Caption   = "STATUS";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();

            GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer;

            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "StatusKey").ToString();
            }
        }
Exemplo n.º 5
0
        protected void SCMHead_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = AccountClass.UserListTable();
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;
            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 0;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();

            combo.Value = sHeadKey.ToString();

            //GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer;
            //MRPClass.PrintString("exp:" + !container.Grid.IsNewRowEditing);
            //if (!container.Grid.IsNewRowEditing)
            //{
            //    combo.Value = DataBinder.Eval(container.DataItem, "UserKey").ToString();
            //}
        }
Exemplo n.º 6
0
        protected void BUCode_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = GlobalClass.EntBUSSUTable(sEntCode);
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;

            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 30;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            l_TextField.Caption   = "NAME";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();

            combo.Value = sBUCode;
        }
Exemplo n.º 7
0
        protected void ComboBoxCustomer_Callback(object sender, CallbackEventArgsBase e)
        {
            string       sYear    = ComboBoxYear.Text;
            string       sWeekNum = ComboBoxWeekNum.Text;
            ASPxComboBox combo    = sender as ASPxComboBox;

            if (!string.IsNullOrEmpty(sWeekNum))
            {
                combo.DataSource = HLSSOA.HLSSOACustomer(Convert.ToInt32(sYear), Convert.ToInt32(sWeekNum));
            }
            else
            {
                combo.DataSource = HLSSOA.HLSSOACustomer(Convert.ToInt32(sYear), 0);
            }

            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 100;
            lv.FieldName = "CustAccount";
            lv.Caption   = "Customer Code";
            combo.Columns.Add(lv);

            //ListBoxColumn lt1 = new ListBoxColumn();
            //lt1.FieldName = "CustName";
            //lt1.Caption = "Customer Name";
            //lt1.Width = 200;
            //combo.Columns.Add(lt1);

            combo.ValueField = "CustAccount";
            combo.TextField  = "CustName";
            combo.DataBind();
            combo.ItemStyle.Wrap   = DevExpress.Utils.DefaultBoolean.True;
            combo.TextFormatString = "{1}";
        }
        protected void Vendor_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = POClass.VendTableTable();;

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "ACCOUNTNUM";
            l_value.Caption   = "Vendor Code";
            l_value.Width     = 100;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "NAME";
            l_text.Caption   = "Vendor Name";
            l_text.Width     = 350;
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "ACCOUNTNUM";
            combo.TextField      = "NAME";
            combo.DataBind();
            //combo.TextFormatString = "{0}{1}";
        }
        protected void BUHead_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = AccountClass.UserList();
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;
            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "PK";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 0;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "CompleteName";
            l_TextField.Caption   = "Employee Name";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "PK";
            combo.TextField  = "CompleteName";
            combo.DataBind();

            GridViewEditFormTemplateContainer container = combo.NamingContainer.NamingContainer as GridViewEditFormTemplateContainer;

            //MRPClass.PrintString("exp:" + !container.Grid.IsNewRowEditing);
            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "BUHead").ToString();
            }
        }
        protected void Code_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = POClass.PO_EntityCode_Table();

            ListBoxColumn lv = new ListBoxColumn();

            lv.FieldName = "ID";
            lv.Caption   = "Code";
            lv.Width     = 50;
            combo.Columns.Add(lv);

            ListBoxColumn lt = new ListBoxColumn();

            lt.FieldName = "NAME";
            lt.Caption   = "Entity";
            lt.Width     = 250;
            combo.Columns.Add(lt);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "ID";
            combo.TextField      = "NAME";
            combo.DataBind();

            GridViewEditItemTemplateContainer container = ((ASPxComboBox)sender).NamingContainer as GridViewEditItemTemplateContainer;

            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "Code").ToString();
                combo.Text  = DataBinder.Eval(container.DataItem, "Code").ToString();
            }
        }
Exemplo n.º 11
0
        private void VendorCombo_Data()
        {
            ASPxComboBox combo = VendorCombo as ASPxComboBox;

            combo.Columns.Clear();
            combo.DataSource = POClass.VendTableTable();;

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "ACCOUNTNUM";
            l_value.Caption   = "Vendor Code";
            l_value.Width     = 100;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "NAME";
            l_text.Caption   = "Vendor Name";
            l_text.Width     = 350;
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "ACCOUNTNUM";
            combo.TextField      = "NAME";
            combo.DataBind();
        }
Exemplo n.º 12
0
        private void WarehouseCombo_Data()
        {
            ASPxComboBox combo = WarehouseCombo as ASPxComboBox;

            combo.Columns.Clear();

            combo.Value      = "";
            combo.DataSource = POClass.InventSiteWarehouseTable(SiteCombo.Text.ToString());

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "warehouse";
            l_value.Caption   = "Warehouse";
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "NAME";
            l_text.Caption   = "Name";
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.TextField      = "NAME";
            combo.ValueField     = "warehouse";
            combo.DataBind();
            combo.ClientEnabled = true;
        }
        protected void FixedAssetID_Init(object sender, EventArgs e)
        {
            string entCode = "", procCat = "";

            entCode = CAPEXCIP.GetRowValues(CAPEXCIP.FocusedRowIndex, "EntCode").ToString();
            procCat = CAPEXCIP.GetRowValues(CAPEXCIP.FocusedRowIndex, "ProcCat").ToString();

            MRPClass.PrintString(entCode + " : " + procCat);

            DataTable    dtRecord = GlobalClass.FixedAssetIDTable(entCode, procCat);
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;
            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 125;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            l_TextField.Width     = 350;
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "ID";
            combo.DataBind();

            combo.Value = sFixedAssetID.ToString();
            combo.Text  = sFixedAssetID.ToString();
        }
Exemplo n.º 14
0
        protected void ProdCat_ListBox_Init(object sender, EventArgs e)
        {
            string docnum = MOPNum_Combo.Text.ToString();

            empty = string.IsNullOrEmpty(docnum);
            ASPxListBox list = sender as ASPxListBox;

            list.Columns.Clear();
            list.Items.Clear();

            //if (empty)
            list.DataSource = MRPClass.ProCategoryTable_WithoutAll();
            //else
            //list.DataSource = MRPClass.ProCategoryTable_Filter("");

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "NAME";
            l_value.Caption   = "Code";
            l_value.Width     = 100;
            list.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DESCRIPTION";
            l_text.Caption   = "Description";
            l_text.Width     = 350;
            list.Columns.Add(l_text);

            list.ValueField = "NAME";
            list.TextField  = "DESCRIPTION";
            list.DataBind();
            list.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            list.ClientEnabled  = false;
        }
Exemplo n.º 15
0
        protected void POUOM_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource     = MRPClass.UOMTable();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "SYMBOL";
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "description";
            combo.Columns.Add(l_text);

            combo.ValueField = "SYMBOL";
            combo.TextField  = "description";
            combo.DataBind();
            combo.TextFormatString = "{0}";

            GridViewEditItemTemplateContainer container = ((ASPxComboBox)sender).NamingContainer as GridViewEditItemTemplateContainer;

            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "POUOM").ToString();
            }
        }
Exemplo n.º 16
0
        private void LocationCombo_Data()
        {
            ASPxComboBox combo = LocationCombo as ASPxComboBox;

            combo.Columns.Clear();

            combo.Value = "";

            combo.DataSource = POClass.InventSiteLocationTable(WarehouseCombo.Text.ToString());

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "LocationCode";
            combo.Columns.Add(l_value);

            //ListBoxColumn l_text = new ListBoxColumn();
            //l_text.FieldName = "NAME";
            //Location.Columns.Add(l_text);

            //Location.TextField = "NAME";
            combo.ValueField = "LocationCode";
            combo.DataBind();
            combo.TextFormatString = "{0}";
            combo.ClientEnabled    = true;
        }
Exemplo n.º 17
0
        private void SiteCombo_Data()
        {
            ASPxComboBox combo = SiteCombo as ASPxComboBox;

            combo.Columns.Clear();
            combo.DataSource = POClass.InventSiteTable(entity);

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "SITEID";
            l_value.Caption   = "Site ID";
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "NAME";
            l_text.Width     = 200;
            l_text.Caption   = "Name";
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.TextField      = "NAME";
            combo.ValueField     = "SITEID";
            combo.DataBind();
        }
Exemplo n.º 18
0
        protected void CreatorStatus_Init(object sender, EventArgs e)
        {
            DataTable    dtRecord = AccountClass.UserStatusTable();
            ASPxComboBox combo    = sender as ASPxComboBox;

            combo.DataSource = dtRecord;

            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "ID";
            l_ValueField.Caption   = "CODE";
            l_ValueField.Width     = 0;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "NAME";
            l_TextField.Caption   = "STATUS";
            combo.Columns.Add(l_TextField);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();

            combo.Value = sBUSSUCreatorStatusKey.ToString();
        }
Exemplo n.º 19
0
        private void TermsCombo_Data()
        {
            //string query = "SELECT PAYMTERMID, DESCRIPTION FROM[dbo].[vw_AXVendTable] WHERE [ACCOUNTNUM] = '" + VendorCombo.Text.ToString() + "'";
            string       query = "SELECT dbo.vw_AXVendTable.PAYMTERMID, ISNULL(dbo.vw_AXPaymTerm.DESCRIPTION, N'') AS DESCRIPTION, dbo.vw_AXVendTable.ACCOUNTNUM FROM dbo.vw_AXVendTable LEFT OUTER JOIN  dbo.vw_AXPaymTerm ON dbo.vw_AXVendTable.PAYMTERMID = dbo.vw_AXPaymTerm.PAYMTERMID WHERE(dbo.vw_AXVendTable.ACCOUNTNUM = '" + VendorCombo.Text.ToString() + "')";
            ASPxComboBox combo = TermsCombo as ASPxComboBox;

            combo.Columns.Clear();

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();
            SqlCommand cmd = new SqlCommand(query, conn);
            //SqlDataReader reader = cmd.ExecuteReader();
            //while (reader.Read())
            //{
            //    combo.Value = reader["PAYMTERMID"].ToString();
            //}
            //reader.Close();

            string        value = "", text = "";
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                value = reader["PAYMTERMID"].ToString();
                text  = reader["DESCRIPTION"].ToString();
            }
            reader.Close();
            conn.Close();

            combo.DataSource = null;
            combo.DataSource = POClass.PaymTermTable();

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "PAYMTERMID";
            l_value.Width     = 100;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DESCRIPTION";
            l_text.Width     = 250;
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "PAYMTERMID";
            combo.TextField      = "DESCRIPTION";
            combo.DataBind();
            combo.ClientEnabled = true;

            combo.Value = value;
            combo.Text  = value;

            combo.IsValid = (!string.IsNullOrEmpty(value)) ? true : false;

            TermsLbl.Text = text;   //set text label of terms
        }
Exemplo n.º 20
0
        //protected void ProdCategory_Combo_Init(object sender, EventArgs e)
        //{
        //    ASPxComboBox combo = sender as ASPxComboBox;
        //    combo.DataSource = MRPClass.ProCategoryTable();

        //    ListBoxColumn l_value = new ListBoxColumn();
        //    l_value.FieldName = "NAME";
        //    l_value.Caption = "CODE";
        //    l_value.Width = 100;
        //    combo.Columns.Add(l_value);

        //    ListBoxColumn l_text = new ListBoxColumn();
        //    l_text.FieldName = "DESCRIPTION";
        //    l_text.Width = 350;
        //    combo.Columns.Add(l_text);

        //    combo.ValueField = "NAME";
        //    combo.TextField = "DESCRIPTION";
        //    combo.DataBind();
        //    combo.TextFormatString = "{1}";
        //}

        private void ProdCat_DataBind()
        {
            ASPxListBox list = ProdCat_ListBox as ASPxListBox;

            list.Columns.Clear();
            list.Items.Clear();

            string monthyear = MonthYear_Combo.Text;

            //if (!string.IsNullOrEmpty(monthyear) && ((MOPNum_Combo.Value != null) || (CheckboxAll.Checked)))
            //if ((!string.IsNullOrEmpty(monthyear) && MOPNum_Combo.Value != null) || (!string.IsNullOrEmpty(monthyear) && CheckboxAll.Checked))
            if (!string.IsNullOrEmpty(monthyear))
            {
                if (!string.IsNullOrEmpty(MOPNum_Combo.Text.ToString()) || CheckboxAll.Checked)
                {
                    string[] strarr     = monthyear.Split(' ');
                    string   month      = strarr[0].ToString();
                    string   year       = strarr[1].ToString();
                    string   docnum     = "";
                    int      monthindex = Convertion.MONTH_TO_INDEX(month);
                    if (!string.IsNullOrEmpty(MOPNum_Combo.Text.ToString()))
                    {
                        docnum = MOPNum_Combo.Text.ToString();
                    }

                    //MRPClass.PrintString("pass");

                    //MRPClass.PrintString(docnum);

                    list.DataSource = MRPClass.ProCategoryTable_Filter_SelectItemPO(Convert.ToInt32(year), monthindex, docnum);


                    ListBoxColumn l_value = new ListBoxColumn();
                    l_value.FieldName = "NAME";
                    l_value.Caption   = "Code";
                    l_value.Width     = 100;
                    list.Columns.Add(l_value);

                    ListBoxColumn l_text = new ListBoxColumn();
                    l_text.FieldName = "DESCRIPTION";
                    l_text.Caption   = "Description";
                    l_text.Width     = 350;
                    list.Columns.Add(l_text);

                    list.ValueField = "NAME";
                    list.TextField  = "DESCRIPTION";
                    list.DataBind();
                    list.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
                    list.ClientEnabled  = true;
                }
            }
        }
        protected void TaxGroup_Init(object sender, EventArgs e)
        {
            ASPxComboBox comboBox = (ASPxComboBox)sender;

            comboBox.DataSource = POClass.TaxGroupTable();

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "TaxGroup";
            comboBox.Columns.Add(l_value);

            comboBox.ValueField = "TaxGroup";
            comboBox.TextField  = "TaxGroup";
            comboBox.DataBind();
        }
Exemplo n.º 22
0
        private void CurrencyCombo_Data()
        {
            ASPxComboBox combo = CurrencyCombo as ASPxComboBox;

            combo.Columns.Clear();

            string query = "SELECT dbo.vw_AXVendTable.VENDGROUP, dbo.vw_AXVendTable.PAYMTERMID, dbo.vw_AXVendTable.CURRENCY, dbo.vw_AXCurrency.TXT FROM dbo.vw_AXVendTable LEFT OUTER JOIN dbo.vw_AXCurrency ON dbo.vw_AXVendTable.CURRENCY = dbo.vw_AXCurrency.CURRENCYCODE WHERE[ACCOUNTNUM] = '" + VendorCombo.Text.ToString() + "'";

            SqlConnection conn = new SqlConnection(GlobalClass.SQLConnString());

            conn.Open();
            SqlCommand    cmd = new SqlCommand(query, conn);
            string        value = "", text = "";
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                value = reader["CURRENCY"].ToString();
                text  = reader["TXT"].ToString();
            }
            reader.Close();
            conn.Close();

            combo.DataSource = POClass.CurrencyTable();;

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "CURRENCYCODE";
            l_value.Caption   = "Currency Code";
            l_value.Width     = 100;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "TXT";
            l_text.Width     = 250;
            l_text.Caption   = "Currency Name";
            combo.Columns.Add(l_text);

            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            combo.ValueField     = "CURRENCYCODE";
            combo.TextField      = "TXT";
            combo.DataBind();
            combo.ClientEnabled = true;

            combo.Value = value;
            combo.Text  = value + ";" + text;
        }
Exemplo n.º 23
0
        protected void ComboBoxWeekNum_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOAWeekNum(0);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 0;
            lv.FieldName = "sWeekNum";
            lv.Caption   = "Select Week Number";
            combo.Columns.Add(lv);

            combo.ValueField = "sWeekNum";
            combo.TextField  = "sWeekNum";
            combo.DataBind();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
        }
Exemplo n.º 24
0
        protected void ComboBoxWeekNum_Callback(object sender, CallbackEventArgsBase e)
        {
            int          sYear = Convert.ToInt32(ComboBoxYear.Text);
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOAWeekNum(sYear);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 0;
            lv.FieldName = "sWeekNum";
            lv.Caption   = "Select Week Number";
            combo.Columns.Add(lv);

            combo.ValueField = "sWeekNum";
            combo.TextField  = "sWeekNum";
            combo.DataBind();
            combo.ItemStyle.Wrap   = DevExpress.Utils.DefaultBoolean.True;
            combo.TextFormatString = "{0}";
        }
        protected void BUCallback_Callback(object sender, CallbackEventArgsBase e)
        {
            //MRPClass.PrintString("callback");
            string var = MRPmonthyear.Text.ToString();

            pk = MRPmonthyear.Value.ToString();
            int spaceindex   = var.IndexOf(" ");
            int secondlength = var.Length - (spaceindex + 1);

            string monthvar   = var.Substring(0, spaceindex);
            int    monthIndex = Convert.ToDateTime("01-" + monthvar + "-2011").Month;

            month = monthIndex.ToString();
            year  = var.Substring(spaceindex + 1, secondlength);


            ASPxComboBox combo = BUCombo as ASPxComboBox;

            combo.Text = "";
            combo.Columns.Clear();
            combo.Items.Clear();
            combo.DataSource = CapexCIP.BusinessUnit(EntityCombo.Value.ToString(), monthIndex, year);

            ListBoxColumn lv = new ListBoxColumn();

            lv.FieldName = "ID";
            lv.Caption   = "Code";
            lv.Width     = 50;
            combo.Columns.Add(lv);

            ListBoxColumn lt = new ListBoxColumn();

            lt.FieldName = "NAME";
            lt.Caption   = "Name";
            combo.Columns.Add(lt);

            combo.ValueField = "ID";
            combo.TextField  = "NAME";
            combo.DataBind();
            combo.TextFormatString = "{1}";
            combo.ItemStyle.Wrap   = DevExpress.Utils.DefaultBoolean.True;
        }
        protected void ProCategory_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = MRPClass.ProCategoryTable();

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "NAME";
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DESCRIPTION";
            combo.Columns.Add(l_text);

            combo.ValueField = "NAME";
            combo.TextField  = "DESCRIPTION";
            combo.DataBind();
            combo.SelectedIndex = 0;
        }
        protected void LocationCallback_Callback(object sender, CallbackEventArgsBase e)
        {
            Location.Value = "";

            Location.DataSource = POClass.InventSiteLocationTable(Warehouse.Text.ToString());

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "LocationCode";
            Location.Columns.Add(l_value);

            //ListBoxColumn l_text = new ListBoxColumn();
            //l_text.FieldName = "NAME";
            //Location.Columns.Add(l_text);

            //Location.TextField = "NAME";
            Location.ValueField = "LocationCode";
            Location.DataBind();
            Location.TextFormatString = "{0}";
            Location.ClientEnabled    = true;
        }
        protected void DocNumber_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo    = sender as ASPxComboBox;
            DataTable    dtRecord = MRPClass.Master_MRP_List_DOCNUM();

            combo.DataSource = dtRecord;

            ListBoxColumn l_ValueField = new ListBoxColumn();

            l_ValueField.FieldName = "DocNumber";
            l_ValueField.Caption   = "MRP#";
            l_ValueField.Width     = 150;
            combo.Columns.Add(l_ValueField);

            ListBoxColumn l_TextField = new ListBoxColumn();

            l_TextField.FieldName = "MRPMonth";
            l_TextField.Caption   = "Month/Year";
            l_TextField.Width     = 75;
            combo.Columns.Add(l_TextField);

            ListBoxColumn l_TextField2 = new ListBoxColumn();

            l_TextField2.FieldName = "EntityCode";
            l_TextField2.Caption   = "Entity";
            l_TextField2.Width     = 150;
            combo.Columns.Add(l_TextField2);

            ListBoxColumn l_TextField3 = new ListBoxColumn();

            l_TextField3.FieldName = "BUCode";
            l_TextField3.Caption   = "BU";
            l_TextField3.Width     = 250;
            combo.Columns.Add(l_TextField3);

            combo.ValueField = "DocNumber";
            combo.TextField  = "DocNumber";
            combo.DataBind();
            combo.TextFormatString = "{0}";
        }
Exemplo n.º 29
0
        protected void TaxItemGroup_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = (ASPxComboBox)sender;

            combo.DataSource = POClass.TaxItemGroupTable();

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "TaxItemGroup";
            combo.Columns.Add(l_value);

            combo.ValueField = "TaxItemGroup";
            combo.TextField  = "TaxItemGroup";
            combo.DataBind();

            GridViewEditItemTemplateContainer container = combo.NamingContainer as GridViewEditItemTemplateContainer;

            if (!container.Grid.IsNewRowEditing)
            {
                combo.Value = DataBinder.Eval(container.DataItem, "TaxItemGroup").ToString();
            }
        }
Exemplo n.º 30
0
        protected void MOPNum_Combo_Callback(object sender, CallbackEventArgsBase e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            string monthyear = MonthYear_Combo.Text;

            if (!string.IsNullOrEmpty(monthyear))
            {
                string[] strarr = monthyear.Split(' ');
                string   month  = strarr[0].ToString();
                string   year   = strarr[1].ToString();

                int monthindex = Convertion.MONTH_TO_INDEX(month);

                combo.DataSource = POClass.DocumentNumber_By_Month_Year(monthindex, year);
            }
            else
            {
                combo.DataSource = POClass.DocumentNumber_By_Month_Year(0, "");
            }

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "PK";
            l_value.Caption   = "PK";
            l_value.Width     = 0;
            combo.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DocumentNumber";
            l_text.Caption   = "Document Number";
            combo.Columns.Add(l_text);

            combo.Value = "PK";
            combo.Text  = "DocumentNumber";
            combo.DataBind();
            combo.TextFormatString = "{1}";
        }
Exemplo n.º 31
0
    // private DAL_ DAL = DAL_.Instance;
    protected void Page_Load(object sender, EventArgs e)
    {
        errorhandling.Visible = false;
        Success.Visible = false;
        if (!IsPostBack)
        {

            //ddlIndustry.cxBindCombo(DAL.Key.DbData.DataTable.Get_FromSP("FilterIndustrySp", "FilterIndustrySp", true), "IDIndustry", "Industry");
            //ddlCompany.cxBindCombo(DAL.Key.DbData.DataTable.Get_FromSP("sp_LoadEventCompany", "sp_LoadEventCompany", true, "", new object[] { ddlIndustry.SelectedValue }), "IDCompany", "Company");

            if (ddlCompany.Items.Count != 0)
            {

                //ddlSite.cxBindCombo(DAL.Key.DbData.DataTable.Get_FromSP("FilterSiteSp", "FilterSiteSp", true, "", new object[] { ddlCompany.SelectedValue }), "IDSite", "Site");
            }
            else
            {
                ddlCompany.Items.Add("No Company Available");
                ddlSite.Items.Clear();
                ddlSite.Items.Add("No Sites Available");
            }

            if (ddlCompany.Text != "No Company Available")
            {
                //ddlProduct.cxBindCombo(DAL.Key.DbData.DataTable.Get_FromSP("FilterProductsSp", "FilterProductsSp", true, "", new object[] { ddlCompany.SelectedValue }), "ProductID", "Product");
            }
            else
            {
                ddlProduct.Items.Clear();
                ddlProduct.Items.Add("No Products Available");
            }

            if (ddlSite.Text != "No Sites Available")
            {
                //ddlDepartment.cxBindCombo(DAL.Key.DbData.DataTable.Get_FromSP("FilterDepartmentSp", "FilterDepartmentSp", true, "", new object[] { ddlSite.SelectedValue }), "IDDepartment", "Department");
            }
            else
            {
                ddlDepartment.Items.Clear();
                ddlDepartment.Items.Add("No Departments Available");
            }

            if (ddlProduct.Items.Count == 0)
            {
                ddlProduct.Items.Add("No Products Available");
            }

            if (ddlProduct.Text != "No Products Available")
            {
                //txtValue.Text = DAL.Key.DbData.DataTable.Get("FilterProductsSp").Rows[0][3].ToString();
                txtValue.ReadOnly = true;
            }
            else
            {
                txtValue.Text = "";
            }

            //if (DAL.Key.DbData.DataTable.Exists("FilterProductSp")) if (DAL.Key.DbData.DataTable.Get("FilterProductsSp").Rows.Count > 0)
            //{
            //    txtValue.Text = DAL.Key.DbData.DataTable.Get("FilterProductsSp").Rows[0][3].ToString();
            //    txtValue.ReadOnly = true;
            //}
            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);

            lblPerson.Visible = false;
            ScreenName.Visible = false;

        }
        //ScreenName.DataSource = DAL.Key.DbData.DataTable.Get("contactPerson");
        //ScreenName.TextField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns["ScreenName"].ToString();
        //ScreenName.ValueField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns[0].ToString();
        //ScreenName.DataBind();
    }
Exemplo n.º 32
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (DAL.Key.DbData == null)
            DAL.Setup(null, new OleDbConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString), loadTableSchemas: true);

        if (!IsPostBack)
        {

            //Databind Title ddl
            DAL.Key.DbData.DataTable.Get_FromSP("FilterTitleSp", "FilterTitleSp");
            ddlTitle.DataSource = DAL.Key.DbData.DataTable.Get("FilterTitleSp");
            ddlTitle.DataTextField = DAL.Key.DbData.DataTable.Get("FilterTitleSp").Columns[1].ToString();
            ddlTitle.DataValueField = DAL.Key.DbData.DataTable.Get("FilterTitleSp").Columns[0].ToString();
            ddlTitle.DataBind();

            //string loginUser = (string) Session["login"];

            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);
        }
        ScreenName.DataSource = DAL.Key.DbData.DataTable.Get("contactPerson",true,true);
        ScreenName.TextField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns["ScreenName"].ToString();
        ScreenName.ValueField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns[0].ToString();
        ScreenName.DataBind();

        ChangePass = false;
        confirmLabel.Visible = false;
        UserConfirmP.Visible = false;
        passwordLabel.Visible = false;
        UserPassword.Visible = false;
        //    ddlDepartment.DataBind();
    }
Exemplo n.º 33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            depDiv.Visible = false;
            userDiv.Visible = false;
            ErrorMessage.Visible = false;
            DataTable FilterIndustrySp = new DataTable();
            using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("FilterIndustrySp", sqlcon))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(FilterIndustrySp);
                    }
                }
            }

            ddlIndustry.DataSource = FilterIndustrySp;
            ddlIndustry.DataTextField = FilterIndustrySp.Columns[1].ToString();
            ddlIndustry.DataValueField = FilterIndustrySp.Columns[0].ToString();
            ddlIndustry.DataBind();

            DataTable sp_LoadEventCompany = new DataTable();
            using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("sp_LoadEventCompany", sqlcon))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("@IndID", SqlDbType.VarChar).Value = ddlIndustry.SelectedValue;

                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(sp_LoadEventCompany);
                    }
                }
            }

            ddlCompany.DataSource = sp_LoadEventCompany;
            ddlCompany.DataTextField = sp_LoadEventCompany.Columns[1].ToString();
            ddlCompany.DataValueField = sp_LoadEventCompany.Columns[0].ToString();
            ddlCompany.DataBind();

            if (ddlCompany.Items.Count != 0)
            {
                DataTable FilterSiteSp = new DataTable();
                using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
                {
                    using (SqlCommand cmd = new SqlCommand("FilterSiteSp", sqlcon))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@CompanyID", SqlDbType.VarChar).Value = ddlCompany.SelectedValue;

                        using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                        {
                            da.Fill(FilterSiteSp);
                        }
                    }
                }

                ddlSite.DataSource = FilterSiteSp;
                ddlSite.DataTextField = FilterSiteSp.Columns[1].ToString();
                ddlSite.DataValueField = FilterSiteSp.Columns[0].ToString();
                ddlSite.DataBind();
            }
            else
            {
                ddlCompany.Items.Add("No Company Available");
                ddlSite.Items.Clear();
                ddlSite.Items.Add("No Sites Available");
            }

            if (ddlSite.Text != "No Sites Available")
            {
                DataTable FilterDepartmentSp = new DataTable();
                using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
                {
                    using (SqlCommand cmd = new SqlCommand("FilterDepartmentSp", sqlcon))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@SiteID", SqlDbType.VarChar).Value = ddlSite.SelectedValue;

                        using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                        {
                            da.Fill(FilterDepartmentSp);
                        }
                    }
                }

                ddlDepartment.DataSource = FilterDepartmentSp;
                ddlDepartment.DataTextField = FilterDepartmentSp.Columns[1].ToString();
                ddlDepartment.DataValueField = FilterDepartmentSp.Columns[0].ToString();
                ddlDepartment.DataBind();
            }
            else
            {
                ddlDepartment.Items.Clear();
                ddlDepartment.Items.Add("No Departments Available");
            }

            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);
        }
        DataTable contactPerson = new DataTable();
        using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
        {
            using (SqlCommand cmd = new SqlCommand("Select * from contactPerson", sqlcon))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    da.Fill(contactPerson);
                }
            }
        }
        ScreenName.DataSource = contactPerson;
        ScreenName.TextField = contactPerson.Columns["ScreenName"].ToString();
        ScreenName.ValueField = contactPerson.Columns[0].ToString();
        ScreenName.DataBind();
    }
Exemplo n.º 34
0
    //private DAL_ DAL = DAL_.Instance;
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (DAL.Key.DbData == null)
        //    DAL.Setup(null, new OleDbConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString), loadTableSchemas: true);

        if (!IsPostBack)
        {

            //Databind Title ddl
            DataTable FilterTitleSp = new DataTable();
            using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("FilterTitleSp", sqlcon))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        da.Fill(FilterTitleSp);
                    }
                }
            }

            ddlTitle.DataSource = FilterTitleSp;
            ddlTitle.DataTextField = FilterTitleSp.Columns[1].ToString();
            ddlTitle.DataValueField = FilterTitleSp.Columns[0].ToString();
            ddlTitle.DataBind();

            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);
        }

        DataTable contactPerson = new DataTable();
        using (SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString))
        {
            using (SqlCommand cmd = new SqlCommand("Select * from contactPerson", sqlcon))
            {
                //cmd.CommandType = CommandType.StoredProcedure;
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    da.Fill(contactPerson);
                }
            }
        }

        ScreenName.DataSource = contactPerson;
        ScreenName.TextField = contactPerson.Columns["ScreenName"].ToString();
        ScreenName.ValueField = contactPerson.Columns[0].ToString();
        ScreenName.DataBind();

        ChangePass = true;
        confirmLabel.Visible = false;
        UserConfirmP.Visible = false;
        passwordLabel.Visible = false;
        UserPassword.Visible = false;
    }
Exemplo n.º 35
0
    //private DAL_ DAL = DAL_.Instance;
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (DAL.Key.DbData == null)
        //    DAL.Setup(null, new OleDbConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString), loadTableSchemas: true);

        GridDiv.Visible = false;

        if (Request.QueryString["un"].ToLower() == "guest")
        {
            OpenEditButton.Visible = false;
            editLabel.Visible = false;
        }

        string name = Request.QueryString["un"];
        string table = (string)(Session[name + "TableName"]);
        //if (DAL.Key.DbData.DataSet.Get.Tables.Contains(table))
        //{
        //    EventGrid.DataSource = DAL.Key.DbData.DataTable.Get(table);
        //    EventGrid.DataBind();
        //    EventGrid.KeyFieldName = "IDEvent";
        //    GridDiv.Visible = true;
        //    EventGrid.Columns[0].Visible = false;
        //}

        if (ddlFilter.SelectedValue == "0")
        {
            SearchFilter.Visible = false;
            ddlSelection.Visible = false;
            GridDiv.Visible = false;
        }
        if (!IsPostBack)
        {
            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);

            lblPerson.Visible = false;
            ScreenName.Visible = false;
        }
        //ScreenName.DataSource = DAL.Key.DbData.DataTable.Get("contactPerson");
        //ScreenName.TextField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns["ScreenName"].ToString();
        //ScreenName.ValueField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns[0].ToString();
        //ScreenName.DataBind();
    }
Exemplo n.º 36
0
    //private DAL_ DAL = DAL_.Instance;
    protected void Page_Load(object sender, EventArgs e)
    {
        string name = Request.QueryString["un"];
        string tmpTableName = (string)(Session[name + "HistoryLoaded"]);

        //if (tmpTableName != null && DAL.Key.DbData.DataTable.Exists(tmpTableName))
        //{
        //    DataTable table = DAL.Key.DbData.DataTable.Get(tmpTableName);
        //    ASPxGV_History.DataSource = table;
        //}
        //if (DAL.Key.DbData == null)
        //    DAL.Setup(null, new OleDbConnection(ConfigurationManager.ConnectionStrings["ManDash"].ConnectionString), loadTableSchemas: true);

        if (!IsPostBack)
        {

            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            cbxUser.Columns.Add(clm1);
            cbxUser.Columns.Add(clm2);
            cbxUser.Columns.Add(clm3);
        }
        //cbxUser.DataSource = DAL.Key.DbData.DataTable.Get("contactPerson");
        //cbxUser.TextField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns["ScreenName"].ToString();
        //cbxUser.ValueField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns[0].ToString();
        //cbxUser.DataBind();
    }
Exemplo n.º 37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            depDiv.Visible = false;
            userDiv.Visible = false;
            ErrorMessage.Visible = false;

            DAL.Key.DbData.DataTable.Get_FromSP("FilterIndustrySp", "FilterIndustrySp");
            ddlIndustry.DataSource = DAL.Key.DbData.DataTable.Get("FilterIndustrySp");
            ddlIndustry.DataTextField = DAL.Key.DbData.DataTable.Get("FilterIndustrySp").Columns[1].ToString();
            ddlIndustry.DataValueField = DAL.Key.DbData.DataTable.Get("FilterIndustrySp").Columns[0].ToString();
            ddlIndustry.DataBind();

            DAL.Key.DbData.DataTable.Get_FromSP("sp_LoadEventCompany", "sp_LoadEventCompany", false, "",
                new object[] {ddlIndustry.SelectedValue});
            ddlCompany.DataSource = DAL.Key.DbData.DataTable.Get("sp_LoadEventCompany");
            ddlCompany.DataTextField = DAL.Key.DbData.DataTable.Get("sp_LoadEventCompany").Columns[1].ToString();
            ddlCompany.DataValueField = DAL.Key.DbData.DataTable.Get("sp_LoadEventCompany").Columns[0].ToString();
            ddlCompany.DataBind();

            if (ddlCompany.Items.Count != 0)
            {
                DAL.Key.DbData.DataTable.Get_FromSP("FilterSiteSp", "FilterSiteSp", false, "",
                    new object[] {ddlCompany.SelectedValue});
                ddlSite.DataSource = DAL.Key.DbData.DataTable.Get("FilterSiteSp");
                ddlSite.DataTextField = DAL.Key.DbData.DataTable.Get("FilterSiteSp").Columns[1].ToString();
                ddlSite.DataValueField = DAL.Key.DbData.DataTable.Get("FilterSiteSp").Columns[0].ToString();
                ddlSite.DataBind();
            }
            else
            {
                ddlCompany.Items.Add("No Company Available");
                ddlSite.Items.Clear();
                ddlSite.Items.Add("No Sites Available");
            }

            if (ddlSite.Text != "No Sites Available")
            {
                DAL.Key.DbData.DataTable.Get_FromSP("FilterDepartmentSp", "FilterDepartmentSp", false, "",
                    new object[] {ddlSite.SelectedValue});
                ddlDepartment.DataSource = DAL.Key.DbData.DataTable.Get("FilterDepartmentSp");
                ddlDepartment.DataTextField = DAL.Key.DbData.DataTable.Get("FilterDepartmentSp").Columns[1].ToString();
                ddlDepartment.DataValueField = DAL.Key.DbData.DataTable.Get("FilterDepartmentSp").Columns[0].ToString();
                ddlDepartment.DataBind();
            }
            else
            {
                ddlDepartment.Items.Clear();
                ddlDepartment.Items.Add("No Departments Available");
            }

            ListBoxColumn clm1 = new ListBoxColumn("ScreenName", "Screen Name");
            ListBoxColumn clm2 = new ListBoxColumn("PersonName", "Name");
            ListBoxColumn clm3 = new ListBoxColumn("PersonSurname", "Surame");
            ScreenName.Columns.Add(clm1);
            ScreenName.Columns.Add(clm2);
            ScreenName.Columns.Add(clm3);
        }
        ScreenName.DataSource = DAL.Key.DbData.DataTable.Get("contactPerson");
        ScreenName.TextField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns["ScreenName"].ToString();
        ScreenName.ValueField = DAL.Key.DbData.DataTable.Get("contactPerson").Columns[0].ToString();
        ScreenName.DataBind();
    }