Пример #1
0
 private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
 {
     // strCombo = funs.GetStrCombo("*");
     strCombo      = funs.GetStrComboled("*");
     textBox1.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
     LoadData(funs.Select_ac_id(textBox1.Text).ToString(), gtyp);
 }
Пример #2
0
        private void textBox14_KeyPress(object sender, KeyPressEventArgs e)
        {
            string strCombo = "";

            if ((gtype == "Purchase" || gtype == "P Return" || gtype == "receive" || gtype == "RCM" || gtype == "Sale Order" || gtype == "JReceive"))
            {
                //multiloc
                //  strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') OR  (Path LIKE '1;38;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote+" and Branch_id="+Database.BranchId);
                strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') OR  (Path LIKE '1;38;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote);
            }

            else if ((gtype == "Sale" || gtype == "Return" || gtype == "issue" || gtype == "PWDebitNote" || gtype == "JIssue"))
            {
                //multiloc
                //strCombo = funs.GetStrCombonew(" (Path LIKE '8;40;%') OR  (Path LIKE '8;39;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '1;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '1;38;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id=" + Database.BranchId);
                // strCombo = funs.GetStrCombonew(" (Path LIKE '8;40;%') OR  (Path LIKE '8;39;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '1;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '1;38;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote);
                strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') or (Path LIKE '1;38;%')  OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", "   Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id='" + Database.BranchId + "' ");
            }


            textBox14.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);

            if (textBox14.Text != "")
            {
                textBox6.Text = funs.Select_TIN(textBox14.Text);
            }
            else
            {
                textBox6.Text = "";
            }
        }
Пример #3
0
 private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
 {
     Database.OpenConnection();
     strCombo      = "SELECT distinct FIRMINFO.Firm_Period_name FROM FIRMINFO where  FIRMINFO.Firm_name='" + textBox3.Text + "' order by FIRMINFO.Firm_Period_name desc";
     textBox4.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     Database.CloseConnection();
 }
Пример #4
0
 private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
 {
     Database.OpenConnection();
     strCombo      = "SELECT distinct FIRMINFO.Firm_name FROM Firminfo order by FIRMINFO.Firm_name";
     textBox3.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     Database.CloseConnection();
 }
Пример #5
0
        private void textBox30_KeyPress(object sender, KeyPressEventArgs e)
        {
            string wheresrt = "(Path LIKE '10;%') OR   (Path LIKE '9;%') or (Path LIKE '6;%') or (Path LIKE '37;%')";

            //  strCombo = funs.GetStrCombo(wheresrt);
            strCombo       = funs.GetStrCombonew(wheresrt, "1=1");
            textBox30.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
        }
Пример #6
0
        private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
        {
            string strCombo = "";

            strCombo = "select Sname As State from State order by Sname";


            textBox7.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
        }
Пример #7
0
 private void textBox14_KeyPress(object sender, KeyPressEventArgs e)
 {
     sql            = funs.GetStrCombo("in(4,5,23,3,13,22,11,20,5)");
     textBox14.Text = SelectCombo.ComboKeypress(this, e.KeyChar, sql, e.KeyChar.ToString(), 1);
     if (textBox1.Text == "")
     {
         textBox1.Text = textBox14.Text;
     }
 }
Пример #8
0
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            string strCombo = "";

            strCombo = "SELECT Name AS VoucherName FROM Vouchertype where " + Database.BMode + "='true' And active=" + access_sql.Singlequote + "True" + access_sql.Singlequote;

            char cg = ' ';

            textBox1.Text = SelectCombo.ComboKeypress(this, cg, strCombo, "", 0);
        }
Пример #9
0
 private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (textBox5.Text != "")
     {
         strCombo = "SELECT DISTINCT Pack as Packing FROM Description WHERE Description = '" + textBox5.Text + "' ORDER BY Pack";
     }
     else
     {
         strCombo = "SELECT DISTINCT Pack as Packing FROM Description ORDER BY Packing";
     }
     textBox2.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #10
0
 private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (textBox2.Text != "")
     {
         strCombo = "SELECT DISTINCT Description as name FROM Description WHERE Pack = '" + textBox2.Text + "' ORDER BY Description";
     }
     else
     {
         strCombo = "select distinct Description as name from Description order by Description";
     }
     textBox5.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
 }
Пример #11
0
 private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ')
     {
         String ActiveCell = "";
         if (ansGridView1.CurrentCell.OwningColumn.Name == "Pack")
         {
             ActiveCell = "Packing";
         }
         else if (ansGridView1.CurrentCell.OwningColumn.Name == "Description")
         {
             ActiveCell = "Desc";
         }
         if (ActiveCell == "Desc" && (ansGridView1.CurrentCell.OwningRow.Cells["pack"].Value == null || ansGridView1.CurrentCell.OwningRow.Cells["pack"].Value == ""))
         {
             strCombo = "select distinct(description) from description order by description";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
             ansGridView1.CurrentCell       = ansGridView1["Pack", ansGridView1.CurrentCell.RowIndex];
             if (ansGridView1.CurrentCell.Value != "")
             {
                 DataTable dt = new DataTable("Description");
                 Database.GetSqlData("select pack from Description where description='" + ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value + "' order by Description", dt);
                 if (dt.Rows.Count == 1)
                 {
                     ansGridView1.Rows[ansGridView1.CurrentCell.RowIndex].Cells["pack"].Value = dt.Rows[0][0].ToString();
                     ansGridView1.CurrentCell = ansGridView1["Qty", ansGridView1.CurrentCell.RowIndex];
                 }
             }
         }
         else if (ActiveCell == "Packing" && ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value != null && ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value.ToString() != "")
         {
             strCombo = "select pack from Description where description='" + ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value + "' order by Description";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
             ansGridView1.CurrentCell       = ansGridView1["Qty", ansGridView1.CurrentCell.RowIndex];
         }
         else if (ActiveCell == "Desc" && ansGridView1.CurrentCell.OwningRow.Cells["pack"].Value != null && ansGridView1.CurrentCell.OwningRow.Cells["pack"].Value.ToString() != "")
         {
             strCombo = "select description from description where pack='" + ansGridView1.CurrentCell.OwningRow.Cells["Pack"].Value.ToString() + "' order by description";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
             ansGridView1.CurrentCell       = ansGridView1["Qty", ansGridView1.CurrentCell.RowIndex];
         }
         else if (ActiveCell == "Packing" && (ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value == null || ansGridView1.CurrentCell.OwningRow.Cells["Description"].Value == ""))
         {
             strCombo = "select distinct(pack) from description order by Pack";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
             ansGridView1.CurrentCell       = ansGridView1["Description", ansGridView1.CurrentCell.RowIndex];
         }
         ansGridView1.CurrentCell.OwningRow.Cells["Qty"].Value  = 0;
         ansGridView1.CurrentCell.OwningRow.Cells["Rate"].Value = 0;
         ansGridView1.CurrentCell.OwningRow.Cells["Amt"].Value  = 0;
     }
 }
Пример #12
0
 private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (mode == "2Packings")
     {
         strCombo      = "select distinct description from description ";
         textBox1.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     }
     else
     {
         strCombo      = "SELECT Distinct Pack FROM Description order by Pack";
         textBox1.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     }
 }
Пример #13
0
 private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (mode == "2Packings")
     {
         strCombo      = "SELECT PACK from Description WHERE (((DESCRIPTION.Description)='" + textBox1.Text + "'))";
         textBox2.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     }
     else
     {
         strCombo      = "SELECT DESCRIPTION.Description FROM Description WHERE (((PACK)='" + textBox1.Text + "'))";
         textBox2.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
     }
 }
Пример #14
0
        private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = false;
            if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ')
            {
                if (ansGridView1.CurrentCell.OwningColumn.Name == "ChargeName")
                {
                    ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, gstrcombo, e.KeyChar.ToString(), 0);
                }

                SendKeys.Send("{Tab}");
            }
        }
Пример #15
0
 private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
 {
     //strCombo = "SELECT Name FROM ACCOUNT ORDER BY Name";
     if (frmtext == "Agent")
     {
         strCombo = "SELECT ACCOUNT.Name FROM  ACCOUNT LEFT OUTER JOIN  ACCOUNTYPE ON ACCOUNT.Act_id = ACCOUNTYPE.Act_id WHERE (ACCOUNTYPE.Name = 'Agent') ORDER BY ACCOUNT.Name";
     }
     else
     {
         strCombo = "SELECT Name FROM  Salesman order by name";
     }
     textBox3.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #16
0
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            strCombo = "select distinct '<MAIN>' as name from account union all Select Name from Account where act_id='" + funs.Select_act_id("Godown") + "' and Branch_id='" + Database.BranchId + "' order by Name";
            DataTable dtgodown = new DataTable();

            Database.GetSqlData(strCombo, dtgodown);
            if (dtgodown.Rows.Count == 1)
            {
                textBox1.Text = dtgodown.Rows[0]["name"].ToString();
            }
            else
            {
                textBox1.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
            }
            LoadData();
        }
Пример #17
0
 private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ')
     {
         if (ansGridView1.CurrentCell.OwningColumn.Name == "Packing")
         {
             strCombo = "select Distinct [pack] from Description order by Pack";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
         }
         if (ansGridView1.CurrentCell.OwningColumn.Name == "Description")
         {
             strCombo = "select description from description where pack='" + ansGridView1.CurrentCell.OwningRow.Cells["Packing"].Value.ToString() + "' order by description";
             ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
         }
     }
 }
Пример #18
0
        private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ' || Convert.ToInt32(e.KeyChar) == 13)
            {
            }
            else
            {
                return;
            }
            string wheresrt = "";
            string strCombo = "";

            if (ansGridView1.CurrentCell.OwningColumn.Name == "Accname")
            {
                wheresrt = " Path  LIKE '1;3;%'  or Path  like '1;2;%'  ";
                strCombo = funs.GetStrCombonew(wheresrt, "   Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id='" + Database.BranchId + "' ");
            }
            ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
            calc();
        }
Пример #19
0
        private void textBox14_KeyPress(object sender, KeyPressEventArgs e)
        {
            string strCombo = "";

            if ((gtype == "Sale" || gtype == "Return" || gtype == "Pending" || gtype == "issue" || gtype == "Sale Order"))
            {
                strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') or (Path LIKE '1;38;%')  OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", "   Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id='" + Database.BranchId + "' ");
                //strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') OR  (Path LIKE '1;38;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id=" + Database.BranchId);
            }

            else if ((gtype == "Purchase" || gtype == "P Return" || gtype == "receive" || gtype == "RCM" || gtype == "PWDebitNote"))
            {
                strCombo = funs.GetStrCombonew(" (Path LIKE '8;40;%') OR  (Path LIKE '1;3;%')  or   (Path LIKE '8;39;%')   or   (Path LIKE '1;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") or   (Path LIKE '1;38;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", "   Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id='" + Database.BranchId + "' ");
                //strCombo = funs.GetStrCombonew(" (Path LIKE '8;40;%') OR  (Path LIKE '8;39;%') OR  (Path LIKE '1;3;%')   or   (Path LIKE '1;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '1;38;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", " HAVING  Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id=" + Database.BranchId);
            }

            else if (gtype == "Opening")
            {
                strCombo = "select distinct '<MAIN>' as name from account union all SELECT ACCOUNT.Name as name FROM ACCOUNT LEFT JOIN ACCOUNTYPE ON ACCOUNT.Act_id = ACCOUNTYPE.Act_id WHERE (((ACCOUNTYPE.Name)='Godown')) GROUP BY ACCOUNT.Name";
            }
            textBox14.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
            textBox1.Text  = funs.Select_Print(textBox14.Text);

            textBox2.Text = funs.Select_Address1(textBox14.Text);

            textBox10.Text = funs.Select_city_name(funs.Select_ac_City_id(textBox14.Text));
            textBox11.Text = funs.Select_Pincode(textBox14.Text);
            textBox3.Text  = funs.Select_Address2(textBox14.Text);
            textBox4.Text  = funs.Select_Mobile(textBox14.Text);
            textBox5.Text  = funs.Select_Email(textBox14.Text);
            textBox6.Text  = funs.Select_TIN(textBox14.Text);

            textBox8.Text = funs.Select_PAN(textBox14.Text);
            textBox9.Text = funs.Select_AAdhar(textBox14.Text);;

            textBox7.Text = funs.Select_state_nm(funs.Select_ac_state_id(textBox14.Text).ToString());
        }
Пример #20
0
 private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "Select RoleName from SYS_Role order by RoleName";
     textBox3.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #21
0
 private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "select [Bname] from Branch  order by Bname";
     textBox5.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #22
0
 private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "select [name] from other where Type='" + funs.Get_Department_id() + "' order by [name]";
     textBox4.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #23
0
        private void textBox14_KeyPress(object sender, KeyPressEventArgs e)
        {
            string strCombo = funs.GetStrCombonew(" (Path LIKE '1;39;%') or (Path LIKE '1;38;%')  OR  (Path LIKE '1;3;%')   or   (Path LIKE '8;40;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ")  or   (Path LIKE '8;39;%' and  AllowPS=" + access_sql.Singlequote + "true" + access_sql.Singlequote + ") ", "   Status=" + access_sql.Singlequote + "true" + access_sql.Singlequote + " and Branch_id='" + Database.BranchId + "' ");

            textBox14.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
        }
Пример #24
0
 private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "select [name] from other where Type='SER15' order by [name]";
     textBox2.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #25
0
 private void textBox14_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo       = "select TAXCATEGORY.Category_Name From TAXCATEGORY ORDER BY TAXCATEGORY.Category_Name";
     textBox14.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #26
0
 private void t5_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo = "select distinct pack from Description order by pack";
     t5.Text  = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #27
0
        private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (dataGridView1.CurrentCell.OwningColumn.Name == "Description")
            {
                string StrSql = "";

                if (dataGridView1.CurrentCell.OwningRow.Cells["packing"].Value != null && dataGridView1.CurrentCell.OwningRow.Cells["packing"].Value != "")
                {
                    wh1 = " DESCRIPTION.Pack ='" + dataGridView1.CurrentCell.OwningRow.Cells["packing"].Value.ToString() + "' ";
                }
                if (wh1 != "")
                {
                    wh2 = " AND TAXCATEGORYDETAIL.SubCategory_Name='" + SubCategory_Name + "'";
                }
                else
                {
                    wh2 = " TAXCATEGORYDETAIL.SubCategory_Name='" + SubCategory_Name + "'";
                }
                StrSql = "SELECT DISTINCT DESCRIPTION.Description FROM (DESCRIPTION INNER JOIN TAXCATEGORY ON DESCRIPTION.Tax_Cat_id = TAXCATEGORY.Category_Id) INNER JOIN TAXCATEGORYDETAIL ON TAXCATEGORY.Category_Id = TAXCATEGORYDETAIL.Category_Id WHERE " + wh1 + wh2 + " GROUP BY DESCRIPTION.Description, DESCRIPTION.Pack_id, TAXCATEGORYDETAIL.SubCategory_Name";

                if (gtaxinvoice == true)
                {
                    StrSql = "SELECT DISTINCT DESCRIPTION.Description FROM (DESCRIPTION INNER JOIN TAXCATEGORY ON DESCRIPTION.Tax_Cat_id = TAXCATEGORY.Category_Id) INNER JOIN TAXCATEGORYDETAIL ON TAXCATEGORY.Category_Id = TAXCATEGORYDETAIL.Category_Id WHERE " + wh1 + wh2 + " GROUP BY DESCRIPTION.Description, DESCRIPTION.Pack_id, TAXCATEGORYDETAIL.SubCategory_Name HAVING (((Sum(TAXCATEGORYDETAIL.Tax_Rate))<>0))";
                }

                String retStr = SelectCombo.ComboKeypress(this, e.KeyChar, StrSql, e.KeyChar.ToString(), 0);
                if (retStr != "")
                {
                    dataGridView1.CurrentCell.Value = retStr;
                }
                else
                {
                    dataGridView1.CurrentCell.Value = "";
                    dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["description"].Value = "";
                    return;
                }

                String strCnt = "";
                if (dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["description"].Value == null || dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["description"].Value.ToString() == "")
                {
                    strCombo = "select [name] from packing";
                    strCnt   = "select count(*) from packing";
                }
                else
                {
                    strCombo = "select [name] from packing where Pack_id in (select Pack_id from description where description='" + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value.ToString() + "')";
                    strCnt   = "select count(*) from packing where Pack_id in (select Pack_id from description where description='" + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value.ToString() + "')";
                }


                int cnt;
                cnt = Database.GetScalar(strCnt);
                if (cnt == 1)
                {
                    dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Packing"].Value = Database.GetScalarText(strCombo);
                    unit = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Packing"].Value.ToString();
                }
                else if (cnt == 0)
                {
                    dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Packing"].Value = "";
                    unit = "";
                }
                desc = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value.ToString();

                dataGridView1.Select();
                SendKeys.Send("{right}");
            }
            if (dataGridView1.CurrentCell.OwningColumn.Name == "Packing")
            {
                if (dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value == null || dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value.ToString() == "")
                {
                    strCombo = "select distinct [pack] from description order by description";
                }
                else
                {
                    strCombo = "select Pack from description where description='" + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Description"].Value.ToString() + "' ";
                }
                String    packing = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
                DataTable dtDesc  = new DataTable();
                Database.GetSqlData("select description,Pack from description where shortcode='" + packing + "'", dtDesc);
                if (dtDesc.Rows.Count == 1)
                {
                    dataGridView1.CurrentCell.OwningRow.Cells["Packing"].Value     = dtDesc.Rows[0]["Pack"].ToString();
                    dataGridView1.CurrentCell.OwningRow.Cells["description"].Value = dtDesc.Rows[0]["description"];
                }
                dataGridView1.CurrentCell.Value = packing;
                if (dataGridView1.CurrentCell.OwningRow.Cells["description"].Value == null)
                {
                    dataGridView1.CurrentCell.OwningRow.Cells["description"].Value = "";
                }
                unit = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["Packing"].Value.ToString();
                dataGridView1.Select();
                SendKeys.Send("{down}");
                SendKeys.Send("{left}");
            }

            if (unit != null && desc != null)
            {
                getDescdata(desc, unit);
            }
        }
Пример #28
0
 private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "SELECT DISTINCT Pack as Packing FROM Description ORDER BY Packing";
     textBox7.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }
Пример #29
0
 private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo      = "select distinct '<MAIN>' as name from account union all SELECT ACCOUNT.Name as name FROM ACCOUNT LEFT JOIN ACCOUNTYPE ON ACCOUNT.Act_id = ACCOUNTYPE.Act_id WHERE ACCOUNTYPE.Name='Godown' and Account.Branch_id='" + Database.BranchId + "' GROUP BY ACCOUNT.Name";
     textBox4.Text = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 1);
 }
Пример #30
0
 private void t4_KeyPress(object sender, KeyPressEventArgs e)
 {
     strCombo = "Select [Name] from OTHER  where type = 'SER16' order by [Name]";
     t4.Text  = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0);
 }