Exemplo n.º 1
0
        private void CustomerEdit_Load(object sender, EventArgs e)
        {
            try
            {
                string strfill2 = "select [State_Code] FROM [State_Code_Master] order by [State_Code] asc";
                dr = ObjCon.getData(strfill2);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbState.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string strfill3 = "select [CustName] FROM [Customer] order by [CustId] asc ";
                dr = ObjCon.getData(strfill3);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbName.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Exemplo n.º 2
0
        private void SupplierEdit_Load(object sender, EventArgs e)
        {
            try
            {
                string strfill2 = "select [State_Code] FROM [State_Code_Master] order by [State_Code] asc";
                dr = ObjCon.getData(strfill2);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbState.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string strfill3 = "select [SupName] FROM [Supplier] order by [SupId] asc";
                dr = ObjCon.getData(strfill3);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        comboBox2.Items.Add(dr[0].ToString());
                    }
                }
                dr.Close();
            }
            catch { }
        }
        public bool Validation()
        {
            try
            {
                string strfill = "select [User_Name] FROM [User_Master] where [User_Name] = '" + txtusername.Text + "'";
                dr = ObjCon.getData(strfill);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        user = dr[0].ToString();
                    }
                }
                dr.Close();

                string strfill1 = "select [Password] FROM [User_Master] where [Password] = '" + txtpassword.Text + "'";
                dr = ObjCon.getData(strfill1);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        pass = dr[0].ToString();
                    }
                }
                dr.Close();
            }
            catch { }
            if (txtusername.Text == user)
            {
                MessageBox.Show("User already exists.");
                this.ActiveControl = txtusername;
                return(false);
            }
            if (txtpassword.Text == pass)
            {
                MessageBox.Show("Password already exixts for another user.");
                this.ActiveControl = txtpassword;
                return(false);
            }
            if (txtusername.Text == "")
            {
                MessageBox.Show("User Name cannot be blank.");
                this.ActiveControl = txtusername;
                return(false);
            }
            if (txtpassword.Text == "")
            {
                MessageBox.Show("Password cannot be blank.");
                this.ActiveControl = txtpassword;
                return(false);
            }
            if (cmbrole.Text == "")
            {
                MessageBox.Show("Select Role for user.");
                this.ActiveControl = cmbrole;
                return(false);
            }
            return(true);
        }
Exemplo n.º 4
0
        private void Rack_Master_Load(object sender, EventArgs e)
        {
            string query = "select [Name] from [WareHouse_Master]";

            dr = objCon.getData(query);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    CmbWarehouse.Items.Add(dr["Name"].ToString().ToUpper());
                }
            }
            dr.Close();
        }
        private void Saleable_Item_Screen_Load(object sender, EventArgs e)
        {
            string str9 = "select [Name] FROM [WareHouse_Master] order by [GID] asc";

            dr = ObjCon.getData(str9);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    cmbwarehouse.Items.Add(dr[0].ToString().ToUpper());
                }
            }
            dr.Close();
        }
Exemplo n.º 6
0
        private void Size_Modify_Load(object sender, EventArgs e)
        {
            string str2 = "SELECT [size_name] FROM [Item_size_Master] order by [size_pk] asc";

            dr = objCon.getData(str2);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    cmbName.Items.Add(dr[0].ToString().ToUpper());
                }
            }
            dr.Close();
            cmbName.SelectedIndex = -1;
        }
Exemplo n.º 7
0
        private void ItemGroup_modify_Load(object sender, EventArgs e)
        {
            string str2 = "SELECT distinct [group_name] FROM [Item_Group_Master]";

            dr = objCon.getData(str2);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    comboBox1.Items.Add(dr[0].ToString().ToUpper());
                }
            }
            dr.Close();
            comboBox1.SelectedIndex = -1;
        }
Exemplo n.º 8
0
        public void fillArea()
        {
            string strfill2 = "select [State_Code] FROM [State_Code_Master] order by [State_Code] asc";

            dr = ObjCon.getData(strfill2);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    cmbState.Items.Add(dr[0].ToString().ToUpper());
                }
            }
            dr.Close();
            cmbState.SelectedIndex = 26;
        }
Exemplo n.º 9
0
 private void Set_MRP_for_Customer_Load(object sender, EventArgs e)
 {
     try
     {
         string commandT = "select distinct [CustName] FROM [Customer]";
         dr = ObjCon.getData(commandT);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 comboBox1.Items.Add(dr[0].ToString());
             }
         }
         dr.Close();
     }
     catch { }
 }
Exemplo n.º 10
0
        private void Size_Master_Load(object sender, EventArgs e)
        {
            string cmd2 = "select [size_name] from [Item_size_Master]";

            dr = ObjCon.getData(cmd2);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    sizename.Add(dr[0].ToString());
                }
            }
            dr.Close();
            txtSize.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtSize.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtSize.AutoCompleteCustomSource = sizename;
        }
Exemplo n.º 11
0
        private void Unit_master_Load(object sender, EventArgs e)
        {
            string str = "SELECT [unit_name] FROM [Unit_Master]";

            dr = objCon.getData(str);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    unitname1.Add(dr[0].ToString());
                }
            }
            dr.Close();
            txtunit.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtunit.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtunit.AutoCompleteCustomSource = unitname1;
        }
Exemplo n.º 12
0
        private void Tax_Master_Load(object sender, EventArgs e)
        {
            string str5 = "select [Tax_Name] FROM [Tax_Master]";

            dr = objCon.getData(str5);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    tax.Add(dr[0].ToString());
                }
            }
            dr.Close();
            txtName.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtName.AutoCompleteCustomSource = tax;
        }
        private void WareHouse_Master_Load(object sender, EventArgs e)
        {
            string str5 = "select [Name] from [WareHouse_Master] ";

            dr = objCon.getData(str5);
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    warehuse.Add(dr[0].ToString());
                }
            }
            dr.Close();
            txtName.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtName.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtName.AutoCompleteCustomSource = warehuse;
        }
 private void Salesman_Edit_Load(object sender, EventArgs e)
 {
     try
     {
         string strfill = "select [Name] from [Salesman_Master] where [DeleteFlag] = 'No' order by [ID] asc";
         dr = ObjCon.getData(strfill);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 cmbName.Items.Add(dr[0].ToString().ToUpper());
             }
         }
         dr.Close();
     }
     catch { }
 }
Exemplo n.º 15
0
        private void Kit_Production_Process_Load(object sender, EventArgs e)
        {
            try
            {
                string str1 = "select distinct [kit_name] from [BOM_Master]";
                dr = ObjCon.getData(str1);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbKitName.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
            }
            catch
            { }

            try
            {
                string str1 = "select [Name] FROM [WareHouse_Master] order by [GID] asc";
                dr = ObjCon.getData(str1);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbwarehouse.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
            }
            catch
            { }
        }
Exemplo n.º 16
0
        private void TaxMasterEdit_Load(object sender, EventArgs e)
        {
            try
            {
                string Command = "select [Tax_Name] from Tax_Master order by [Pk] asc ";
                dr = objCon.getData(Command);

                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        comboBox1.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
            }
            catch { }
        }
Exemplo n.º 17
0
 private void Unit_Modify_Load(object sender, EventArgs e)
 {
     try
     {
         string str1 = "SELECT [unit_name] FROM [Unit_Master] order by [unit_pk] asc";
         dr = objCon.getData(str1);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 comboBox1.Items.Add(dr[0].ToString().ToUpper());
             }
         }
         dr.Close();
     }
     catch { }
     comboBox1.SelectedIndex = -1;
 }
Exemplo n.º 18
0
 private void Single_Barcode_Printing_Load(object sender, EventArgs e)
 {
     try
     {
         string str7 = "select [EAC_Code] from [Kit_Master] union select [EAC_Code] from [Item]";
         dr = ObjCon.getData(str7);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 barcode1.Add(dr[0].ToString());
             }
         }
         dr.Close();
         txtEac_code.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
         txtEac_code.AutoCompleteSource       = AutoCompleteSource.CustomSource;
         txtEac_code.AutoCompleteCustomSource = barcode1;
     }
     catch { }
 }
Exemplo n.º 19
0
        public bool Validation()
        {
            if (txtGroup.Text == "")
            {
                MessageBox.Show("Please Enter Group Name!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ActiveControl = txtGroup;
                return(false);
            }

            string strfill = "SELECT [group_name] FROM [Item_Group_Master] where [group_name] = '" + txtGroup.Text + "'";

            dr = objCon.getData(strfill);
            if (dr.HasRows)
            {
                MessageBox.Show("Item Group already exists", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.ActiveControl = txtGroup;
                return(false);
            }
            dr.Close();
            return(true);
        }
Exemplo n.º 20
0
 private void USerMaster_Edit_Load(object sender, EventArgs e)
 {
     try
     {
         string strfill = "select distinct [User_Name] FROM [User_Master] where [company] = '" + company + "'";
         dr = ObjCon.getData(strfill);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 username1.Add(dr[0].ToString());
             }
         }
         dr.Close();
         txtusername.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
         txtusername.AutoCompleteSource       = AutoCompleteSource.CustomSource;
         txtusername.AutoCompleteCustomSource = username1;
     }
     catch
     { }
 }
Exemplo n.º 21
0
        private void button3_Click(object sender, EventArgs e)
        {
            login    = txtLogin.Text.ToString();
            password = txtPass.Text.ToString();

            if (comboBox1.Text == "")
            {
                MessageBox.Show("Please Enter Company Name!", "Error");
                comboBox1.Focus();
            }
            else
            {
                commandT = "select [Company_ID], [Company_Name] from [Company_Master] where [Company_Name] = '" + comboBox1.Text + "'";
                String name = null;

                dr = obj.getData(commandT);

                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        company = dr["company_Id"].ToString();
                        name    = dr["Company_Name"].ToString();
                    }
                    dr.Close();
                    userLogin();
                }
                else
                {
                    MessageBox.Show("Invalid Company Name!");
                    comboBox1.Text = "";
                    comboBox1.Focus();
                    dr.Close();
                }
            }
            txtLogin.Clear();
            txtPass.Clear();
            comboBox1.Clear();
        }
Exemplo n.º 22
0
        private void Supplier_Load(object sender, EventArgs e)
        {
            try
            {
                string strfill2 = "select [State_Code] FROM [State_Code_Master] order by [State_Code] asc";
                dr = ObjCon.getData(strfill2);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbState.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                cmbState.SelectedIndex = 26;
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Exemplo n.º 23
0
        private void Purchase_Load(object sender, EventArgs e)
        {
            try
            {
                string str5 = "select [State],[Company_Name] FROM [Company_Master] where [Company_ID] = '" + company + "'";
                dr = ObjCon.getData(str5);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        company_state = dr[0].ToString().ToUpper();
                        companyname   = dr[1].ToString().ToUpper();
                    }
                }
                dr.Close();

                commandT = "select [SupName] from [Supplier] order by [SupId] asc";
                dr       = ObjCon.getData(commandT);
                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        cmbSupName.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string commandT1 = "select [State_Code] from [State_Code_Master] order by [State_Code] asc";
                dr = ObjCon.getData(commandT1);
                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        cmbState.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
                cmbState.SelectedIndex = 26;
            }
            catch
            { }
        }
Exemplo n.º 24
0
 private void Purchase_ReturrnScreen_Load(object sender, EventArgs e)
 {
     try
     {
         string str5 = "select [State] FROM [Company_Master] where [Company_ID] = '" + company + "'";
         dr = ObjCon.getData(str5);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 company_state = dr[0].ToString().ToUpper();
             }
         }
         dr.Close();
         fillParty();
     }
     catch
     { }
 }
Exemplo n.º 25
0
 private void Sale_Bill_PrintingScreen_Load(object sender, EventArgs e)
 {
     try
     {
         string str = "select [Challan_no] from [Sales] where [DeleteFlag] = 'No' order by [SalesBillPk] desc";
         dr = objCon.getData(str);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 comboBox1.Items.Add(dr[0].ToString());
             }
         }
         dr.Close();
     }
     catch
     {}
 }
Exemplo n.º 26
0
        private void Main_Screen_Load(object sender, EventArgs e)
        {
            commandT = "select Company_Name from Company_Master where company_Id = '" + company + "'";
            dr       = objCon.getData(commandT);

            if (dr.HasRows == true)
            {
                while (dr.Read())
                {
                    try
                    {
                        lblcname.Text = dr[0].ToString();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            dr.Close();
            toolStripStatusLabel.Text = System.DateTime.Now.ToString("dd/MM/yyyy");
        }
Exemplo n.º 27
0
 private void Bill_Of_Master_Load(object sender, EventArgs e)
 {
     try
     {
         string strfill1 = "select [Kit_Name] FROM [Kit_Master] where [Kit_Name] not in(select [kit_name] from [BOM_Master])";
         dr = obj.getData(strfill1);
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 txtkitname.Items.Add(dr[0].ToString().ToUpper());
             }
         }
         dr.Close();
     }
     catch
     {
     }
 }
Exemplo n.º 28
0
        private void Company_Edit_Load(object sender, EventArgs e)
        {
            try
            {
                string str = "select Company_Name from Company_Master";
                dr = objCon.getData(str);
                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        CompanyName.Add(dr[0].ToString());
                    }
                }
                else
                {
                }
                dr.Close();
                compname.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                compname.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                compname.AutoCompleteCustomSource = CompanyName;

                string strfill2 = "select [sate_name] FROM [State_Code_Master] order by [State_Code] asc";
                dr = objCon.getData(strfill2);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        state.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
                txtState.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                txtState.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                txtState.AutoCompleteCustomSource = state;

                string strfill3 = "select [code] FROM [State_Code_Master] order by [State_Code] asc";
                dr = objCon.getData(strfill3);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        state.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
                txtState.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                txtState.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                txtState.AutoCompleteCustomSource = state;

                string strfill4 = "select distinct [city_name] FROM [pincode_city_master] order by [city_name] asc";
                dr = objCon.getData(strfill4);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        juri.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
                juris.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                juris.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                juris.AutoCompleteCustomSource = juri;
                city.AutoCompleteMode          = AutoCompleteMode.SuggestAppend;
                city.AutoCompleteSource        = AutoCompleteSource.CustomSource;
                city.AutoCompleteCustomSource  = juri;

                compname.Focus();
                txtState.Text          = "";
                rbtnAssesse.Checked    = true;
                rbtnnonassesse.Checked = false;
            }
            catch { }
        }
Exemplo n.º 29
0
        private void Sales_Return_Load(object sender, EventArgs e)
        {
            try
            {
                string str1 = "select distinct [CustName] FROM [Sales]";
                dr = ObjCon.getData(str1);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbCustName.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str5 = "select [State],[Company_Name] FROM [Company_Master] where [Company_ID] = '" + company + "'";
                dr = ObjCon.getData(str5);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        company_state = dr[0].ToString().ToUpper();
                        companyname   = dr[1].ToString().ToUpper();
                    }
                }
                dr.Close();

                string commandT1 = "select [State_Code] from [State_Code_Master] order by [State_Code] asc";
                dr = ObjCon.getData(commandT1);
                if (dr.HasRows == true)
                {
                    while (dr.Read())
                    {
                        cmbstate.Items.Add(dr[0].ToString().ToUpper().ToUpper());
                    }
                }
                dr.Close();
                cmbstate.SelectedIndex = 26;

                string str9 = "select [Name] FROM [WareHouse_Master] order by [GID] asc";
                dr = ObjCon.getData(str9);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbwarehouse.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str10 = "select [Name] from [Salesman_Master]";
                dr = ObjCon.getData(str10);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbMarketPlace.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                this.ActiveControl = cmbCustName;
            }
            catch { }
        }
Exemplo n.º 30
0
        private void Item_Master_Load(object sender, EventArgs e)
        {
            try
            {
                string str1 = "SELECT [unit_name] FROM [Unit_Master] order by [unit_pk] asc";
                dr = ObjCon.getData(str1);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbUnit.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str2 = "SELECT [group_name] FROM [Item_Group_Master] order by [grp_pk] asc";
                dr = ObjCon.getData(str2);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbGroup.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str3 = "SELECT [Tax_Name] FROM [Tax_Master] order by [Pk] asc";
                dr = ObjCon.getData(str3);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbTax.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str4 = "SELECT [size_name] FROM [Item_size_Master] order by [size_pk] asc";
                dr = ObjCon.getData(str4);
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        cmbsize.Items.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();

                string str111 = "select [EAC_Code] FROM [Item]";
                dr = ObjCon.getData(str111);

                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        eaccode1.Add(dr[0].ToString().ToUpper());
                    }
                }
                dr.Close();
                txtbarcodeno.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
                txtbarcodeno.AutoCompleteSource       = AutoCompleteSource.CustomSource;
                txtbarcodeno.AutoCompleteCustomSource = eaccode1;

                this.ActiveControl = txtbarcodeno;
            }
            catch { }
        }