Example #1
0
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         string        dJMonth = this.comboBoxYF.SelectedItem.ToString();
         string        dJType  = this.comboBoxDJZL.SelectedValue.ToString();
         string        keyWord = this.GetKeyWord();
         int           key     = this.GetKey();
         AisinoDataSet set     = this.hzBLL.QueryXSDJ(dJMonth, dJType, keyWord, this.hzBLL.Pagesize, this.hzBLL.CurrentPage, key);
         this.aisinoDataGrid1.set_DataSource(set);
         this.SelectedBH = "NoExist";
         this.aisinoDataGrid2.set_DataSource(this.hzBLL.QueryXSDJMX("NoExist", this.hzBLL.Pagesize, 1));
         this.aisinoDataGrid3.set_DataSource(this.hzBLL.QueryXSDJMX("NoExist", this.hzBLL.Pagesize, 1));
         int count = this.aisinoDataGrid2.get_Rows().Count;
         for (int i = 0; i < count; i++)
         {
             string str4 = this.aisinoDataGrid2.get_Rows()[i].Cells["SLV"].Value.ToString();
             string str5 = this.aisinoDataGrid2.get_Rows()[i].Cells["XH"].Value.ToString();
             if (((str4 != null) && (str4 != "")) && (str4 != "中外合作油气田"))
             {
                 string str6 = this.billBL.ShowSLV(this.bill, str5, str4);
                 if (str6 != "")
                 {
                     this.aisinoDataGrid2.get_Rows()[i].Cells["SLV"].Value = str6;
                 }
             }
         }
         if (set.get_Data().Rows.Count == 0)
         {
             MessageManager.ShowMsgBox("INP-272203");
         }
     }
     catch (Exception exception)
     {
         HandleException.HandleError(exception);
     }
 }
Example #2
0
        private void CheckAdd(int pagesize, int page)
        {
            int    num2;
            string str6;

            this.aisinoDataGrid1.set_DataSource(this.djcfBLL.QueryXSDJ("NoExistBH", "0", "a", "a", 10, 0));
            if (this.aisinoDataGrid1.get_DataSource() == null)
            {
                this.aisinoDataGrid1.set_DataSource(this.djcfBLL.QueryXSDJ(this.KeyWords, this.DJmonth, this.DJtype, this.JYrule, pagesize, page));
            }
            this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Clear();
            AisinoDataSet set   = this.djcfBLL.QueryXSDJ(this.KeyWords, this.DJmonth, this.DJtype, this.JYrule, pagesize, page);
            AisinoDataSet set2  = null;
            int           count = set.get_Data().Rows.Count;

            for (num2 = 0; num2 < count; num2++)
            {
                string xSDJBH = set.get_Data().Rows[num2]["BH"].ToString();
                string str2   = set.get_Data().Rows[num2]["DJZL"].ToString();
                set2 = this.djcfBLL.QueryXSDJMX(xSDJBH, 0x3e8, 1);
                int    num3  = set2.get_Data().Rows.Count;
                double round = 0.0;
                bool   flag  = false;
                for (int i = 0; i < num3; i++)
                {
                    double num11;
                    double num12;
                    string str3 = set2.get_Data().Rows[i]["DJ"].ToString();
                    string str4 = set2.get_Data().Rows[i]["SL"].ToString();
                    string str5 = set2.get_Data().Rows[i]["JE"].ToString();
                    str6 = set2.get_Data().Rows[i]["SLV"].ToString();
                    string str7 = set2.get_Data().Rows[i]["SE"].ToString();
                    double num6 = 0.0;
                    double num7 = 0.0;
                    if ((str3.Length > 0) && (str4.Length > 0))
                    {
                        num6 = Convert.ToDouble(str3);
                        num7 = Convert.ToDouble(str4);
                    }
                    double num8 = 0.0;
                    if (str5.Length > 0)
                    {
                        num8 = Convert.ToDouble(str5);
                    }
                    double num9 = 0.0;
                    if (str6.Length > 0)
                    {
                        if (str6.Equals("免税"))
                        {
                            num9 = 0.0;
                        }
                        else if (str6.Equals("中外合作油气田"))
                        {
                            num9 = 0.05;
                        }
                        else
                        {
                            num9 = Convert.ToDouble(str6);
                        }
                    }
                    double num10 = 0.0;
                    if (str7.Length > 0)
                    {
                        num10 = Convert.ToDouble(str7);
                    }
                    if (str6.Equals("中外合作油气田"))
                    {
                        num11 = 0.0;
                        if ((num6 == 0.0) && (num7 == 0.0))
                        {
                            num11 = SaleBillCtrl.GetRound((double)((num8 / 0.95) * 0.05), 2);
                        }
                        else
                        {
                            num11 = SaleBillCtrl.GetRound((double)((num6 * num7) * num9), 2);
                        }
                        num12 = SaleBillCtrl.GetRound((double)(num11 - num10), 2);
                        if (Math.Abs(num12) > 0.06)
                        {
                            this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Add(set.get_Data().Rows[num2].ItemArray);
                            flag = true;
                            break;
                        }
                        round += num12;
                    }
                    else if (num9 == 0.015)
                    {
                        num11 = 0.0;
                        num12 = SaleBillCtrl.GetRound((double)(SaleBillCtrl.GetRound((double)((num8 / 1.035) * 0.015), 2) - num10), 2);
                        if (Math.Abs(num12) > 0.06)
                        {
                            this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Add(set.get_Data().Rows[num2].ItemArray);
                            flag = true;
                            break;
                        }
                        round += num12;
                    }
                    else
                    {
                        num12 = SaleBillCtrl.GetRound((double)(SaleBillCtrl.GetRound((double)(num8 * num9), 2) - num10), 2);
                        if (Math.Abs(num12) > 0.06)
                        {
                            this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Add(set.get_Data().Rows[num2].ItemArray);
                            flag = true;
                            break;
                        }
                        round += num12;
                    }
                }
                round = SaleBillCtrl.GetRound(round, 2);
                if (!flag && (Math.Abs(round) > 1.27))
                {
                    this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Add(set.get_Data().Rows[num2].ItemArray);
                }
            }
            if (this.aisinoDataGrid1.get_DataSource().get_Data().Rows.Count > 0)
            {
                this.Grid1BH = this.aisinoDataGrid1.get_DataSource().get_Data().Rows[0]["BH"].ToString();
                set2         = this.djcfBLL.QueryXSDJMX(this.Grid1BH, this.djcfBLL.Pagesize, 1);
                this.aisinoDataGrid2.set_DataSource(set2);
                SaleBill bill  = this.billBL.Find(this.Grid1BH);
                int      num13 = this.aisinoDataGrid2.get_Rows().Count;
                for (num2 = 0; num2 < num13; num2++)
                {
                    string str8 = this.aisinoDataGrid2.get_Rows()[num2].Cells["SLV"].Value.ToString();
                    string str9 = this.aisinoDataGrid2.get_Rows()[num2].Cells["XH"].Value.ToString();
                    if (((str8 != null) && (str8 != "")) && (str8 != "中外合作油气田"))
                    {
                        str6 = this.billBL.ShowSLV(bill, str9, str8);
                        if (str6 != "")
                        {
                            this.aisinoDataGrid2.get_Rows()[num2].Cells["SLV"].Value = str6;
                        }
                    }
                }
            }
        }