Esempio n. 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string Str = Where();

            _dtSearch = JReport.GetDataManager(Str);
            jJanusGrid1.bind(_dtSearch, "ReportManagerBascolShow");

            _dtTotal = JReport.GetTotalDataManager(Str);
            if (_dtTotal != null)
            {
                lblTotalPay.Text   = JMoney.StringToMoney(_dtTotal.Rows[0]["Pay"].ToString());
                lblTotalPay_h.Text = JMoney.StringToMoney(_dtTotal.Rows[0]["Pay_h"].ToString());
                lblTotalTax.Text   = JMoney.StringToMoney(_dtTotal.Rows[0]["Tax"].ToString());
                lblTotalDuty.Text  = JMoney.StringToMoney(_dtTotal.Rows[0]["Duty"].ToString());
            }
        }
Esempio n. 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            txtPrice.Text = "";
            if (chkBedehi.Checked)
            {
                jJanusGridBedehi.Visible = true;
                jJanusGrid1.Visible      = false;
            }
            else
            {
                jJanusGridBedehi.Visible = false;
                jJanusGrid1.Visible      = true;
            }
            Str = "";
            if (!(chkAllUser.Checked))
            {
                if (((_PlakNo == null)) || (_PlakNo == ""))
                {
                    if (!(chkBedehi.Checked))
                    {
                        Str = Str + " And UserPostCode=" + JMainFrame.CurrentPostCode;
                    }
                }
            }
            if (chkListBascol.CheckedItems.Count > 0)
            {
                string CodeGH = "";
                for (int i = 0; i < chkListBascol.Items.Count; i++)
                {
                    if (chkListBascol.GetItemChecked(i))
                    {
                        CodeGH = CodeGH + "" + ((ClassLibrary.JKeyValue)(chkListBascol.Items[i])).Value.ToString() + ",";
                    }
                }
                if (CodeGH != "")
                {
                    Str = Str + " And BascoolCode in (" + CodeGH + "0)";
                }
            }

            if (chklistTozin.CheckedItems.Count > 0)
            {
                string CodeGH = "";
                for (int i = 0; i < chklistTozin.Items.Count; i++)
                {
                    if (chklistTozin.GetItemChecked(i))
                    {
                        CodeGH = CodeGH + "" + ((ClassLibrary.JKeyValue)(chklistTozin.Items[i])).Value.ToString() + ",";
                    }
                }
                if (CodeGH != "")
                {
                    Str = Str + " And ProductCode in (" + CodeGH + "0)";
                }
            }

            if (chklistTrucks.CheckedItems.Count > 0)
            {
                string CodeGH = "";
                for (int i = 0; i < chklistTrucks.Items.Count; i++)
                {
                    if (chklistTrucks.GetItemChecked(i))
                    {
                        CodeGH = CodeGH + "" + ((ClassLibrary.JKeyValue)(chklistTrucks.Items[i])).Value.ToString() + ",";
                    }
                }
                if (CodeGH != "")
                {
                    Str = Str + " And TruckCode in (" + CodeGH + "0)";
                }
            }

            if (txtDate.Date != DateTime.MinValue)
            {
                Str = Str + " And Cast(WDate as Date) >= '" + txtDate.Date.ToString("yyyy/MM/dd") + "'";
            }

            if (txtEndDate.Date != DateTime.MinValue)
            {
                Str = Str + " And Cast(WDate as Date) <= '" + txtEndDate.Date.ToString("yyyy/MM/dd") + "'";
            }
            if (txtplok2.Text != "      -")
            {
                if (txtplok2.Text.Contains("ا"))
                {
                    Str = Str + " And PlokNo=N'" + txtplok2.Text.Replace("ا", "الف") + "'";
                }
                else
                {
                    Str = Str + " And PlokNo=N'" + txtplok2.Text + "'";
                }
            }

            if (chkBedehi.Checked)
            {
                lblBedehkari.Text  = "0";
                lblBestankari.Text = "0";
                DataTable tmpdt = JReport.GetDataBedehkari(Str);
                jJanusGridBedehi.bind(tmpdt, "ReportBedehi");
                foreach (DataRow dr in tmpdt.Rows)
                {
                    lblBedehkari.Text  = (Convert.ToDecimal(lblBedehkari.Text) + Convert.ToDecimal(dr["debit"])).ToString();
                    lblBestankari.Text = (Convert.ToDecimal(lblBestankari.Text) + Convert.ToDecimal(dr["crdit"])).ToString();
                }
            }
            else if (groupBox1.Enabled == true)
            {
                DataTable dtManager = JReport.GetDataManager(Str);
                jJanusGrid1.bind(dtManager, "ReportManagerBascolShow");
                lblCount.Text = "0";
                lblTotal.Text = "0";
                foreach (DataRow dr in dtManager.Rows)
                {
                    lblCount.Text = (Convert.ToDecimal(lblCount.Text) + 1).ToString();
                    lblTotal.Text = (Convert.ToDecimal(lblTotal.Text) + Convert.ToDecimal(dr["Pay"])).ToString();
                }
            }
            if (groupBox1.Enabled == false)
            {
                jJanusGrid1.bind(JReport.GetDataTop3(Str), "ReportManagerBascolShow");
                jJanusGrid1.Columns["BascoolCode"].Visible = false;
                jJanusGrid1.Columns["Code"].Visible        = false;
            }
            else if (!(chkBedehi.Checked))
            {
                jJanusGrid1.Columns["PrintNo"].Visible = false;
                //jJanusGrid1.Columns["hamrahno"].Visible = false;
                jJanusGrid1.Columns["dele"].Visible   = false;
                jJanusGrid1.Columns["verify"].Visible = false;
                jJanusGrid1.Columns["pay"].Visible    = false;
                //jJanusGrid1.Columns["pay_h"].Visible = false;
                jJanusGrid1.Columns["Duty"].Visible        = false;
                jJanusGrid1.Columns["Tax"].Visible         = false;
                jJanusGrid1.Columns["FirstWeight"].Visible = false;
                jJanusGrid1.Columns["Khales"].Visible      = false;
                jJanusGrid1.Columns["PersonName"].Visible  = false;
                //jJanusGrid1.Columns["PostName"].Visible = false;
                jJanusGrid1.Columns["UserPostCode"].Visible = false;
            }
        }