Exemple #1
0
        public bool FormCheck()
        {
            if (this.txtBusCardDate.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>");
                this.txtBusCardDate.Focus();
                return(false);
            }
            if (CommHelp.VerifesToDateTime(txtBusCardDate.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                return(false);
            }
            if (this.txtBusCardTotal.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填金额!');</script>");
                this.txtBusCardTotal.Focus();
                return(false);
            }


            try
            {
                Convert.ToDecimal(txtBusCardTotal.Text);
            }
            catch (Exception)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写的数字格式有误!');</script>");
                txtBusCardTotal.Focus();
                return(false);
            }

            return(true);
        }
Exemple #2
0
 private bool Check()
 {
     if (CommHelp.VerifesToNum(txtZhangQi.Text) == false || Convert.ToDecimal(txtZhangQi.Text) < 0)
     {
         base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目财务成本账期 格式有问题!');</script>");
         return(false);
     }
     if (CommHelp.VerifesToNum(txtCeSuanDian.Text) == false || Convert.ToDecimal(txtCeSuanDian.Text) < 0 || Convert.ToDecimal(txtCeSuanDian.Text) > 1)
     {
         base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('财务成本测算点 格式有问题!');</script>");
         return(false);
     }
     if (CommHelp.VerifesToNum(txtMonthLiLv.Text) == false || Convert.ToDecimal(txtMonthLiLv.Text) < 0 || Convert.ToDecimal(txtMonthLiLv.Text) > 1)
     {
         base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('财务成本月利率 格式有问题!');</script>");
         return(false);
     }
     if (txtFrom.Text == "")
     {
         base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('考核前期日期 不能为空!');</script>");
         return(false);
     }
     if (txtFrom.Text != "")
     {
         if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
         {
             base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('考核前期日期 格式错误!');</script>");
             return(false);
         }
     }
     return(true);
 }
Exemple #3
0
        public bool FormCheck()
        {
            #region 设置自己要判断的信息

            if (txtName.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写姓名!');</script>");
                txtName.Focus();

                return(false);
            }


            if (txtProName.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写项目名称!');</script>");
                txtName.Focus();

                return(false);
            }

            if (txtCreateTime.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>");
                txtCreateTime.Focus();
                return(false);
            }
            if (CommHelp.VerifesToDateTime(txtCreateTime.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                return(false);
            }


            //if (ddlPers.SelectedItem == null || ddlPers.Text == "")
            //{
            //    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择各户代表!');</script>");
            //    ddlPers.Focus();
            //    return false;
            //}


            if (ddlPers.Visible == true && ddlPers.SelectedItem == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择下一步审核人!');</script>");
                ddlPers.Focus();
                return(false);
            }
            if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写申请用户不存在!');</script>");
                txtName.Focus();

                return(false);
            }
            #endregion


            return(true);
        }
Exemple #4
0
        private void ShowOil()
        {
            string sql = " 1=1 ";

            if (txtOilFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtOilFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('加油日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and MaintenanceTime>='{0} 00:00:00'", txtOilFrom.Text);
            }

            if (txtOilTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtOilTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('加油日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and MaintenanceTime<='{0} 23:59:59'", txtOilTo.Text);
            }


            if (ddlOilCarNo.Text != "")
            {
                sql += string.Format(" and CardNo like '%{0}%'", ddlOilCarNo.Text);
            }


            if (txtFromChongZhi.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFromChongZhi.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('充值时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and ChongZhiDate>='{0} 00:00:00'", txtFromChongZhi.Text);
            }

            if (txtToChongZhi.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtToChongZhi.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('充值时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and ChongZhiDate<='{0} 23:59:59'", txtToChongZhi.Text);
            }

            List <TB_CarOilMaintenance> cars = this.CarOilSer.GetListArray(sql);

            AspNetPager2.RecordCount = cars.Count;
            this.gvOil.PageIndex     = AspNetPager2.CurrentPageIndex - 1;
            this.gvOil.DataSource    = cars;
            this.gvOil.DataBind();
        }
Exemple #5
0
        //(NO.4)
        public bool FormCheck()
        {
            #region 设置自己要判断的信息
            if (txtDepartName.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写部门!');</script>");
                txtDepartName.Focus();

                return(false);
            }
            if (txtName.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写姓名!');</script>");
                txtName.Focus();

                return(false);
            }

            if (txtDateTime.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写日期!');</script>");
                txtDateTime.Focus();

                return(false);
            }
            else
            {
                if (CommHelp.VerifesToDateTime(txtDateTime.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>");
                    return(false);
                }
            }

            if (txtToolName.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请填写工具名称!');</script>");
                txtToolName.Focus();
                return(false);
            }

            if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写申请用户不存在!');</script>");
                txtName.Focus();
                return(false);
            }
            #endregion
            if (ddlPers.Visible == true && ddlPers.SelectedItem == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择下一步审核人!');</script>");
                ddlPers.Focus();

                return(false);
            }

            return(true);
        }
Exemple #6
0
        private void Show()
        {
            string where = "";
            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                where += string.Format(" and CG_POOrder.PODate>='{0} 00:00:00'", txtFrom.Text);
            }
            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                where += string.Format(" and CG_POOrder.PODate<='{0} 23:59:59'", txtTo.Text);
            }
            if (ddlCompany.Text == "-1" && ddlUser.Text != "-1")
            {
                where += string.Format(" and exists (select id from tb_User where ID={0} and CG_POOrder.appName=id)", ddlUser.Text);
            }
            if (ddlCompany.Text != "-1")
            {
                string where1 = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[0]);

                if (ddlUser.Text != "-1")
                {
                    where1 += string.Format(" and ID={0} ", ddlUser.Text);
                }
                where += string.Format(" and exists (select id from tb_User where {0} and CG_POOrder.appName=id)", where1);
            }
            if (ddlIsClose.Text != "-1")
            {
                where += " and IsClose=" + ddlIsClose.Text;
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                where += " and JieIsSelected=" + ddlJieIsSelected.Text;
            }
            if (ddlSpecial.Text != "-1")
            {
                where += string.Format(" and CG_POOrder.IsSpecial={0}", ddlSpecial.Text);
            }
            ds = DBHelp.getDataSet(GetSql("").ToString());
            noSellAndCaiGoodsList = new RuSellReportService().getHT(where);

            resut_SellGoodsList = new Model.HashTableModel().HashTableToList(noSellAndCaiGoodsList);
            resut_SellGoodsList.Sort();

            dt_Fund = DBHelp.getDataTable(GetFundWrong());
            GetSumPOTotal();
            //dt_GetSumPOTotal = DBHelp.getDataTable();
        }
Exemple #7
0
        private void Show()
        {
            string sql = " 1=1 ";

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CreateTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CreateTime<='{0} 23:59:59'", txtTo.Text);
            }

            if (txtProName.Text != "")
            {
                sql += string.Format(" and ProName like '%{0}%'", txtProName.Text);
            }


            if (txtProNo.Text != "")
            {
                sql += string.Format(" and ProNo like '%{0}%'", txtProNo.Text);
            }


            sql += " and UserId=" + Session["currentUserId"].ToString();

//            sql += string.Format(@" and id in (select allE_id from tb_EForm where proId in (
//select pro_Id from A_ProInfo where pro_Type='工程材料审计清单') and state='通过')");


            List <Tb_ProjectInvs> pos = this.proInvSer.GetListArray_Rep(sql);

            decimal total = 0;

            foreach (Tb_ProjectInvs model in pos)
            {
                total += model.Total == null?0:Convert.ToDecimal(model.Total);
            }
            lblTotal.Text = total.ToString();


            this.gvList.DataSource = pos;
            this.gvList.DataBind();
        }
Exemple #8
0
        private void Show()
        {
            string sql = " 1=1 ";

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保养日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and MaintenanceTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保养日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and MaintenanceTime<='{0} 23:59:59'", txtTo.Text);
            }


            if (ddlCarNo.Text != "")
            {
                sql += string.Format(" and CardNo like '%{0}%'", ddlCarNo.Text);
            }


            sql += string.Format(@" and TB_CarMaintenance.id in (select allE_id from tb_EForm where proId in (
select pro_Id from A_ProInfo where pro_Type='车辆保养申请表') and state='通过')");


            List <TB_CarMaintenance> cars = this.CarSer.GetListArray(sql);

            decimal total = 0;

            foreach (var model in cars)
            {
                if (model.Total != null)
                {
                    total += Convert.ToDecimal(model.Total);
                }
            }
            lbltotal.Text = total.ToString();

            AspNetPager1.RecordCount = cars.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;

            this.gvList.DataSource = cars;
            this.gvList.DataBind();
        }
Exemple #9
0
        private void Show()
        {
            string sql = " 1=1 ";

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('违章时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and BreakTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('违章时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and BreakTime<='{0} 23:59:59'", txtTo.Text);
            }

            if (ddlCarNo.Text != "")
            {
                sql += string.Format(" and CarNo like '%{0}%'", ddlCarNo.Text);
            }


            if (txtDriver.Text != "")
            {
                sql += string.Format(" and Driver like '%{0}%'", txtDriver.Text);
            }

            if (ddlState.Text != "")
            {
                sql += string.Format(" and state like '%{0}%'", ddlState.Text);
            }



            List <TB_BreakRulesCar> cars = this.braRuleCarSer.GetListArray(sql);

            AspNetPager1.RecordCount = cars.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = cars;
            this.gvList.DataBind();
        }
        private void select()
        {
            string sql = " 1=1 ";


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DisDate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DisDate<='{0} 23:59:59'", txtTo.Text);
            }



            if (txtOutDispater.Text != "")
            {
                sql += string.Format(" and loginName like '%{0}%'", txtOutDispater.Text);
            }

            if (txtDispatcher.Text != "")
            {
                sql += string.Format(" and Dispatcher like '%{0}%'", txtDispatcher.Text);
            }

            if (txtSuiTong.Text != "")
            {
                sql += string.Format(" and SuiTongRen like '%{0}%'", txtSuiTong.Text);
            }
            List <DispatchingRep> users = this.DispatchingSer.GetListArrayReport(sql);

            //AspNetPager1.RecordCount = users.Count;
            //this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource = users;
            this.gvList.DataBind();
        }
Exemple #11
0
        private bool Check()
        {
            if (!CommHelp.VerifesToDateTime(txtFrom.Text) || !CommHelp.VerifesToDateTime(txtTo.Text) ||
                !CommHelp.VerifesToDateTime(txtpayableFrom.Text) || !CommHelp.VerifesToDateTime(txtpayableTo.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('时间格式错误!');</script>");
                return(false);
            }
            if (Convert.ToDateTime(txtFrom.Text) > Convert.ToDateTime(txtTo.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发票开始时间 必须小于等于 结束时间!');</script>");
                return(false);
            }
            if (Convert.ToDateTime(txtpayableFrom.Text) > Convert.ToDateTime(txtpayableTo.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发票开始时间 必须小于 结束时间!');</script>");
                return(false);
            }
            if (txtInvoiceDate.Text.Trim() == "" || txtpayableDate.Text.Trim() == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('运行时间不能为空!');</script>");
                return(false);
            }

            if (CommHelp.VerifesToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + txtInvoiceDate.Text.Trim()) == false ||
                CommHelp.VerifesToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " " + txtpayableDate.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('运行时间 格式错误!');</script>");
                return(false);
            }

            if (string.IsNullOrEmpty(txtIP.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('IP地址不能为空!');</script>");
                return(false);
            }
            if (string.IsNullOrEmpty(txtUserId.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('用户名不能为空!');</script>");
                return(false);
            }
            if (string.IsNullOrEmpty(txtPwd.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('密码不能为空!');</script>");
                return(false);
            }
            return(true);
        }
        public bool FormCheck()
        {
            string strErr = "";

            if (this.txtJDate.Text.Trim().Length == 0 || CommHelp.VerifesToDateTime(txtJDate.Text) == false)
            {
                strErr += "日期格式不正确!\\n";
            }

            if (strErr != "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('{0}');</script>", strErr));
                return(false);
            }
            return(true);
        }
Exemple #13
0
        private void Show()
        {
            string sql = " 1=1 ";


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DataTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DataTime<='{0} 23:59:59'", txtTo.Text);
            }
            if (txtInvName.Text != "")
            {
                sql += string.Format(" and InvName like '%{0}%'", txtInvName.Text);
            }

            if (txtSeller.Text != "")
            {
                sql += string.Format(" and Seller like '%{0}%'", txtSeller.Text);
            }

            if (txtUnitName.Text != "")
            {
                sql += string.Format(" and UnitName like '%{0}%'", txtUnitName.Text);
            }

            sql += string.Format(" and CreateUser={0}", Session["currentUserId"].ToString());
            List <TB_PO> pos = this.poSer.GetListArray(sql);

            AspNetPager1.RecordCount = pos.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = pos;
            this.gvList.DataBind();
        }
        //===
        private void ShowOld()
        {
            string sql = " 1=1 ";


            if (txtOldDateFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtOldDateFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Time>='{0} 00:00:00'", txtOldDateFrom.Text);
            }

            if (txtOldTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtOldTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Time<='{0} 23:59:59'", txtOldTo.Text);
            }

            if (txtOldGuestName.Text.Trim() != "")
            {
                sql += string.Format(" and GuestName like '%{0}%'", txtOldGuestName.Text.Trim());
            }


            if (txtLoginName.Text != "")
            {
                sql += string.Format(" and tb_User.loginName like '%{0}%'", txtLoginName.Text);
            }



            List <TB_GuestTrack> GuestTracks = this.GuestTrackSer.GetListArrayOld(sql);


            this.gvOld.DataSource = GuestTracks;
            this.gvOld.DataBind();
        }
Exemple #15
0
        private void select()
        {
            string sql = " 1=1 ";


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DateTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and DateTime<='{0} 23:59:59'", txtTo.Text);
            }

            if (txtAppName.Text != "")
            {
                sql += string.Format(" and Name like '%{0}%'", txtAppName.Text);
            }


            if (txtUnit.Text != "")
            {
                sql += string.Format(" and ContactUnit like '%{0}%'", txtUnit.Text);
            }

            List <BusContactRep> users = this.busContactSer.GetListArrayReport(sql);

            //AspNetPager1.RecordCount = users.Count;
            //this.gvList.PageIndex = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource = users;
            this.gvList.DataBind();
        }
Exemple #16
0
        public bool FormCheck()
        {
            string strErr = "";

            if (this.txtTeamLever.Text.Trim().Length == 0)
            {
                strErr += "姓名不能为空!\\n";
            }
            //if (this.txtCardNo.Text.Trim().Length == 0)
            //{
            //    strErr += "身份证号不能为空!\\n";
            //}
            if (this.txtContractStartTime.Text.Trim().Length == 0)
            {
                strErr += "合作起始时间不能为空!\\n";
            }
            if (CommHelp.VerifesToDateTime(txtContractStartTime.Text) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('合作起始时间 格式错误!');</script>");
                return(false);
            }
            if (this.txtTeamPersonCount.Text.Trim().Length == 0)
            {
                strErr += "人员规模不能为空!\\n";
            }
            if (CommHelp.VerifesToNum(txtTeamPersonCount.Text) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('人员规模 格式错误!');</script>");
                return(false);
            }
            if (!string.IsNullOrEmpty(txtPhone.Text) && txtPhone.Text.Length != 11)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('手机号码 格式错误!');</script>");
                return(false);
            }
            if (strErr != "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('{0}');</script>", strErr));
                return(false);
            }

            return(true);
        }
Exemple #17
0
        private void Show()
        {
            string sql = " 1=1 ";


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('报价日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and QuoteDate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('报价日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and QuoteDate<='{0} 23:59:59'", txtTo.Text);
            }
            if (txtQPNo.Text != "")
            {
                sql += string.Format(" and QuoteNo like '%{0}%'", txtQPNo.Text);
            }

            if (ddlGuestName.Text != "" && ddlGuestName.Text != "0")
            {
                sql += string.Format(" and GuestName='{0}'", ddlGuestName.SelectedValue);
            }


            List <tb_QuotePrice> pos = this.qpSer.GetListArray(sql);

            AspNetPager1.RecordCount = pos.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = pos;
            this.gvList.DataBind();
        }
        public bool FormCheck()
        {
            if (this.txtTime.Text.Trim().Length == 0)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期不能为空!');</script>");
                this.txtTime.Focus();
                return(false);
            }
            if (CommHelp.VerifesToDateTime(txtTime.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                return(false);
            }

            if (this.txtSupplierName.Text.Trim().Length == 0)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('供应商名称不能为空!');</script>");
                this.txtSupplierName.Focus();
                return(false);
            }

            if (this.txtSupplierSimpleName.Text.Trim().Length == 0)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('供应商简称不能为空!!');</script>");
                this.txtSupplierSimpleName.Focus();
                return(false);
            }
            if (this.txtLikeMan.Text.Trim().Length == 0)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('联系人不能为空!');</script>");
                this.txtLikeMan.Focus();
                return(false);
            }
            if (this.txtJob.Text.Trim().Length == 0)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('职务不能为空!');</script>");
                this.txtJob.Focus();
                return(false);
            }
            return(true);
        }
        protected void btnSelect_Click(object sender, EventArgs e)
        {
            if (txtFrom.Text == "" || txtTo.Text == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择日期!');</script>");
                return;
            }

            if (CommHelp.VerifesToDateTime(txtFrom.Text) == false || CommHelp.VerifesToDateTime(txtTo.Text) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('订单时间 格式错误!');</script>");
                return;
            }

            if (Convert.ToDateTime(txtFrom.Text) > Convert.ToDateTime(txtTo.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期错误,请重新填写!');</script>");
                return;
            }

            show();
        }
Exemple #20
0
        private void Show()
        {
            string sql = " 1=1 ";


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and BusCardDate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and BusCardDate<='{0} 23:59:59'", txtTo.Text);
            }


            if (ddlCardNo.Text != "")
            {
                sql += string.Format(" and BusCardNo like '%{0}%'", ddlCardNo.Text);
            }
            List <TB_BusCardRecord> pos = this.BusCardRecordSer.GetListArray(sql);

            AspNetPager2.RecordCount         = pos.Count;
            this.gvCardRecordList.PageIndex  = AspNetPager2.CurrentPageIndex - 1;
            this.gvCardRecordList.DataSource = pos;
            this.gvCardRecordList.DataBind();
        }
Exemple #21
0
        private void Show()
        {
            string sql = " 1=1 ";

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('创建日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CreateTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('创建日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CreateTime<='{0} 23:59:59'", txtTo.Text);
            }

            if (txtGuestName.Text != "")
            {
                sql += string.Format(" and GuestName like '%{0}%'", txtGuestName.Text);
            }


            List <tb_GusetInfo> pos = this.guestSer.GetListArray(sql);

            AspNetPager1.RecordCount = pos.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = pos;
            this.gvList.DataBind();
        }
        public bool FormCheck()
        {
            string strErr = "";


            if (this.txtPONo.Text.Trim().Length == 0)
            {
                strErr += "项目编号不能为空!\\n";
            }
            //if (this.txtGuestName.Text.Trim().Length == 0)
            //{
            //    strErr += "客户名称不能为空!\\n";
            //}
            if (this.txtSalesUnit.Text.Trim().Length == 0)
            {
                strErr += "采购单位不能为空!\\n";
            }
            if (string.IsNullOrEmpty(txtName.Text))
            {
                strErr += "签呈单名称不能为空!\\n";
            }
            if (this.txtSummary.Text.Trim().Length == 0)
            {
                strErr += "签呈单摘要不能为空!\\n";
            }
            if (CommHelp.VerifesToNum(txtTotal.Text) == false)
            {
                strErr += "总金额格式错误!\\n";
            }
            if (CommHelp.VerifesToDateTime(txtSignDate.Text) == false)
            {
                strErr += "签订起始日期时间格式错误!\\n";
            }
            if (CommHelp.VerifesToNum(txtSumPages.Text) == false)
            {
                strErr += "签呈单总页数格式错误!\\n";
            }

            if (CommHelp.VerifesToNum(txtSumCount.Text) == false)
            {
                strErr += "签呈单总份数格式错误!\\n";
            }
            if (CommHelp.VerifesToNum(txtBCount.Text) == false)
            {
                strErr += "己方份数格式错误!\\n";
            }

            //if (cbIsRequire.Checked == false)
            //{
            //    if (this.txtPONo.Text.Trim().Length == 0)
            //    {
            //        strErr += "项目编号不能为空!\\n";
            //    }
            //    if (this.txtAE.Text.Trim().Length == 0)
            //    {
            //        strErr += "AE不能为空!\\n";
            //    }
            //}

            if (strErr != "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, string.Format("<script>alert('{0}');</script>", strErr));
                return(false);
            }

            return(true);
        }
        private void Show()
        {
            if (ddlFKDF.Text != "-1" && !string.IsNullOrEmpty(txtFKDF.Text))
            {
                if (CommHelp.VerifesToNum(txtFKDF.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('反馈得分 格式错误!');</script>");
                    return;
                }
            }
            if (ddlAllScore.Text != "-1" && !string.IsNullOrEmpty(txtAllScore.Text))
            {
                if (CommHelp.VerifesToNum(txtAllScore.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('综合得分 格式错误!');</script>");
                    return;
                }
            }
            string sql = " ";

            if (ddlCompany.Text != "-1")
            {
                string where = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[2]);
                sql         += string.Format(" and exists (select id from tb_User where IFZhui=0 and {0} and CG_POOrder.appName=id)", where);
            }
            if (txtPONo.Text != "")
            {
                sql += string.Format(" and CG_POOrder.PONo like '%{0}%'", txtPONo.Text);
            }


            if (ttxPOName.Text != "")
            {
                sql += string.Format(" and CG_POOrder.POName like '%{0}%'", ttxPOName.Text);
            }

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CG_POOrder.PODate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CG_POOrder.PODate<='{0} 23:59:59'", txtTo.Text);
            }


            if (txtGuestName.Text != "")
            {
                sql += string.Format(" and CG_POOrder.GuestName  like '%{0}%'", txtGuestName.Text);
            }
            var isColse = "";

            if (ddlIsClose.Text != "-1")
            {
                isColse = " and IsClose=" + ddlIsClose.Text;
            }

            if (ddlIsSelect.Text != "-1")
            {
                isColse += " and IsSelected=" + ddlIsSelect.Text;
            }
            if (ddlPOTyle.Text != "-1")
            {
                isColse += " and CG_POOrder.POType=" + ddlPOTyle.Text;
            }
            if (ddlModel.Text != "全部")
            {
                sql += string.Format(" and Model='{0}'", ddlModel.Text);
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                isColse += " and JieIsSelected=" + ddlJieIsSelected.Text;
            }
            //if (ViewState["showAll"] != null)
            //{
            //    sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO )", Session["currentUserId"]);
            //}

            //if (ddlGuestTypeList.SelectedValue != "全部")
            //{
            //    sql += string.Format(" and EXISTS (select id from TB_GuestTrack where MyGuestType='{0}' and TB_GuestTrack.id=CG_POOrder.GuestId )",ddlGuestTypeList.SelectedValue);
            //}

            if (ddlGuestTypeList.SelectedValue != "全部")
            {
                sql += string.Format(" and GuestType='{0}'", ddlGuestTypeList.SelectedValue);
            }

            if (ddlGuestProList.SelectedValue != "-2")
            {
                sql += string.Format(" and GuestPro={0}", ddlGuestProList.SelectedValue);
            }



            if (ddlUser.Text == "-1")//显示所有用户
            {
                if (ddlIsSpecial.Text != "-1")
                {
                    sql += string.Format(" and IsSpecial={1} {0} ", isColse, ddlIsSpecial.Text);
                    //sql += string.Format(" and EXISTS (select ID from CG_POOrder where IsSpecial=0 AND PONO=JXC_REPORT.PONO {0})", isColse);
                }

                //else
                //{
                //    sql += string.Format(" and EXISTS (select ID from CG_POOrder where IsSpecial=1 AND PONO=JXC_REPORT.PONO {0})", isColse);
                //}
                //var model = Session["userInfo"] as User;
                //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职') AND PONO=JXC_REPORT.PONO )", Session["currentUserId"]);
            }
            else if (ddlUser.Text == "0")//显示部门信息
            {
                var model = Session["userInfo"] as User;
                //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') AND PONO=JXC_REPORT.PONO )", model.LoginIPosition);

                if (ddlIsSpecial.Text != "-1")
                {
                    sql += string.Format(" and CG_POOrder.AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') and IsSpecial={2} {1}",
                                         model.LoginIPosition, isColse, ddlIsSpecial.Text);
                    // sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') AND PONO=JXC_REPORT.PONO and IsSpecial=0 {1})", model.LoginIPosition, isColse);
                }
                else
                {
                    sql += string.Format(" and CG_POOrder.AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}')  {1}",
                                         model.LoginIPosition, isColse);
                    //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') AND PONO=JXC_REPORT.PONO and IsSpecial=1 {1})", model.LoginIPosition, isColse);
                }
            }
            else
            {
                if (ddlIsSpecial.Text != "-1")
                {
                    sql += string.Format(" and CG_POOrder.AppName={0} and IsSpecial={2} {1} ", ddlUser.Text, isColse, ddlIsSpecial.Text);
                    //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO  and IsSpecial=0 {1})", ddlUser.Text, isColse);
                }
                else
                {
                    sql += string.Format(" and CG_POOrder.AppName={0}  {1} ", ddlUser.Text, isColse);
                    //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO  and IsSpecial=1 {1})", ddlUser.Text, isColse);
                }
                //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO )", ddlUser.Text);
            }

            if (CheckBox1.Checked || CheckBox2.Checked || CheckBox3.Checked || CheckBox4.Checked)
            {
                sql += " and exists ( select ID from CG_POOrder where PONO=JXC_REPORT.PONO";
                if (CheckBox1.Checked)
                {
                    sql += string.Format(" and POStatue='{0}'", CheckBox1.Text);
                }
                if (CheckBox2.Checked)
                {
                    sql += string.Format(" and POStatue2='{0}'", CheckBox2.Text);
                }
                if (CheckBox3.Checked)
                {
                    sql += string.Format(" and POStatue3='{0}'", CheckBox3.Text);
                }
                if (CheckBox4.Checked)
                {
                    sql += string.Format(" and POStatue4='{0}'", CheckBox4.Text);
                }

                sql += ")";
            }


            string having = " having ";

            if (CheckBox5.Checked && CheckBox6.Checked)
            {
                having += string.Format("  (avg(SellFPTotal)<> sum(goodSellTotal) or  avg(SellFPTotal) is null)  and (avg(InvoTotal)<> sum(goodSellTotal) or sum(InvoTotal) is null)");
            }
            else if (CheckBox5.Checked || CheckBox6.Checked)
            {
                if (CheckBox5.Checked)
                {
                    having += string.Format("  avg(SellFPTotal)<> sum(goodSellTotal) or  avg(SellFPTotal) is null ");
                }
                if (CheckBox6.Checked)
                {
                    having += string.Format("  avg(InvoTotal)<> sum(goodSellTotal) or sum(InvoTotal) is null ");
                }
            }
            else
            {
                having = "";
            }


            string fuhao = " where 1=1 ";

            if (ddlFKDF.Text != "-1" && !string.IsNullOrEmpty(txtFKDF.Text))
            {
                fuhao += string.Format(" and MyValue{0}{1}", ddlFKDF.Text, txtFKDF.Text);
            }
            if (ddlFuHao.Text != "-1")
            {
                fuhao = string.Format(" where SumPOTotal {0} isnull(goodSellTotal,0)", ddlFuHao.Text);
            }
            if (ddlPOFaTotal.Text != "-1")
            {
                fuhao += string.Format(" and SumPOTotal {0} isnull(SellFPTotal,0)", ddlPOFaTotal.Text);
            }
            if (ddlShiJiDaoKuan.Text != "-1")
            {
                fuhao += string.Format(" and SumPOTotal {0} isnull(InvoTotal,0)", ddlShiJiDaoKuan.Text);
            }
            if (ddlEquPOTotal.Text != "-1")
            {
                if (CommHelp.VerifesToNum(txtEquTotal.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目金额 格式错误!');</script>");
                    return;
                }
                fuhao += string.Format(" and SumPOTotal{0}{1}", ddlEquPOTotal.Text, txtEquTotal.Text);
            }



            if (ddlJingLiTotal.Text != "-1")
            {
                fuhao += string.Format(" and maoliTotal {0} (isnull(InvoTotal,0)-isnull(goodTotal,0))", ddlJingLiTotal.Text);
            }

            if (!string.IsNullOrEmpty(txtProProfit.Text) && ddlProProfit.Text != "-1")
            {
                if (CommHelp.VerifesToNum(txtProProfit.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目净利 格式错误!');</script>");
                    return;
                }
                fuhao += string.Format(" and maoliTotal {0} {1}", ddlProProfit.Text, txtProProfit.Text);
            }

            if (!string.IsNullOrEmpty(txtProTureProfit.Text) && ddlProTureProfit.Text != "-1")
            {
                if (CommHelp.VerifesToNum(txtProTureProfit.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('实际净利 格式错误!');</script>");
                    return;
                }
                fuhao += string.Format(" and InvoTotal-goodTotal {0} {1}", ddlProTureProfit.Text, txtProTureProfit.Text);
            }

            if (ddlPaiGong.Text != "-1")
            {
                //fuhao += string.Format(" and OutDispater={0}", ddlPaiGong.Text);

                if (ddlPaiGong.Text != "-1000")
                {
                    fuhao += string.Format(" and OutDispater={0}", ddlPaiGong.Text);
                }
                else
                {
                    string userIds = "";
                    foreach (ListItem item in ddlPaiGong.Items)
                    {
                        if (item.Value != "-1" && item.Value != "-1000")
                        {
                            userIds += string.Format("{0},", item.Value);
                        }
                    }
                    fuhao += string.Format(" and OutDispater not in ({0})", userIds.Trim(','));
                }
            }

            if (txtPGFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtPGFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('派工时间 格式错误!');</script>");
                    return;
                }
                fuhao += string.Format(" and DisDate>='{0} 00:00:00'", txtPGFrom.Text);
            }

            if (txtPGTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtPGTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('派工时间 格式错误!');</script>");
                    return;
                }
                fuhao += string.Format(" and DisDate<='{0} 23:59:59'", txtPGTo.Text);
            }

            if (ddlJingLi.Text != "-1" && !string.IsNullOrEmpty(txtJingLi.Text))
            {
                if (CommHelp.VerifesToNum(txtJingLi.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('净利润率 格式错误!');</script>");
                    return;
                }
            }
            List <JXC_REPORTTotal> pOOrderList = this.POSer.GetSkill_Total(sql, having, fuhao);

            if (ddlTrueZhangQI.Text != "-1")
            {
                if (ddlTrueZhangQI.Text == "1")
                {
                    pOOrderList = pOOrderList.FindAll(T => T.trueZhangQi <= 30);
                }
                if (ddlTrueZhangQI.Text == "2")
                {
                    pOOrderList = pOOrderList.FindAll(T => T.trueZhangQi > 30 && T.trueZhangQi <= 60);
                }
                if (ddlTrueZhangQI.Text == "3")
                {
                    pOOrderList = pOOrderList.FindAll(T => T.trueZhangQi > 60 && T.trueZhangQi <= 90);
                }
                if (ddlTrueZhangQI.Text == "4")
                {
                    pOOrderList = pOOrderList.FindAll(T => T.trueZhangQi > 90 && T.trueZhangQi <= 120);
                }
                if (ddlTrueZhangQI.Text == "5")
                {
                    pOOrderList = pOOrderList.FindAll(T => T.trueZhangQi > 120);
                }
            }


            if (ddlJingLi.Text != "-1" && !string.IsNullOrEmpty(txtJingLi.Text))
            {
                decimal jingLi = Convert.ToDecimal(txtJingLi.Text);
                if (ddlJingLi.Text == ">")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.JingLi > jingLi);
                }
                if (ddlJingLi.Text == "<")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.JingLi < jingLi);
                }
                if (ddlJingLi.Text == ">=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.JingLi >= jingLi);
                }
                if (ddlJingLi.Text == "<=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.JingLi <= jingLi);
                }
                if (ddlJingLi.Text == "=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.JingLi == jingLi);
                }
            }

            if (ddlAllScore.Text != "-1" && !string.IsNullOrEmpty(txtAllScore.Text))
            {
                if (CommHelp.VerifesToNum(txtAllScore.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('综合得分 格式错误!');</script>");
                    return;
                }
                fuhao = ddlAllScore.Text;
                decimal allScore = Convert.ToDecimal(txtAllScore.Text);
                if (fuhao == ">")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore > allScore);
                }
                if (fuhao == "<")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore < allScore);
                }
                if (fuhao == ">=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore >= allScore);
                }
                if (fuhao == "<=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore <= allScore);
                }
                if (fuhao == "=")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore == allScore);
                }
                if (fuhao == "<>")
                {
                    pOOrderList = pOOrderList.FindAll(t => t.allScore == allScore);
                }
            }
            //var getAllPONos = pOOrderList.Aggregate("", (current, m) => current + ("'" + m.PONo + "',")).Trim(',');
            //lblVisAllPONO.Text = getAllPONos;

            Hashtable ht  = new Hashtable();
            decimal   jlr = 0;
            decimal   sumgoodSellTotal = 0;
            decimal   sumTrueLiRun     = 0;
            decimal   sumSellFPTotal   = 0;
            decimal   sumSumPOTotal    = 0;
            decimal   sumInvoiceTotal  = 0;

            foreach (var m in pOOrderList)
            {
                if (!ht.ContainsKey(m.PONo))
                {
                    jlr += m.maoliTotal;
                    sumgoodSellTotal += m.goodSellTotal;
                    sumTrueLiRun     += m.TrueLiRun;
                    sumSellFPTotal   += m.SellFPTotal;
                    sumSumPOTotal    += m.SumPOTotal;
                    sumInvoiceTotal  += m.InvoiceTotal;
                    ht.Add(m.PONo, null);
                }
            }

            lblJLR.Text = string.Format("{0:n6}", jlr);
            lblXSE.Text = string.Format("{0:n6}", sumgoodSellTotal);
            var trueLiRun = sumTrueLiRun;

            lblSJLR.Text = string.Format("{0:n6}", trueLiRun);

            lblFP.Text = string.Format("{0:n6}", sumSellFPTotal);
            // 项目总额:XXX
            decimal allPoTotal = sumSumPOTotal;

            lblAllPoTotal.Text = string.Format("{0:n6}", allPoTotal);
            //项目总利润率:YYY = 项目净利合计/XXX
            lblAllLRLv.Text = "0";
            if (allPoTotal > 0)
            {
                lblAllLRLv.Text = string.Format("{0:f2}", (jlr / allPoTotal * 100));
            }
            // 实际总利润率:ZZZ=  实际利润合计/XXX
            lblAllTrunLv.Text = "0";
            if (allPoTotal > 0)
            {
                lblAllTrunLv.Text = string.Format("{0:f2}", (trueLiRun / allPoTotal * 100));
            }
            //项目到款总额:TTT= 实到帐的合计
            var allDaoKuan = sumInvoiceTotal;

            lblAllDaoKuan.Text = string.Format("{0:n6}", allDaoKuan);
            //到款率: VVV=TTT/XXX
            lblAllDaoKuanLv.Text = "0";
            if (allPoTotal > 0)
            {
                lblAllDaoKuanLv.Text = string.Format("{0:f2}", (allDaoKuan / allPoTotal * 100));
            }

            //开票率:LLL= 发票总额合计 /XXX
            var faPiaoTotal = sumSellFPTotal;// pOOrderList.Sum(t => t.SellFPTotal);

            lblAllFaPiaoLv.Text = "0";
            if (allPoTotal > 0)
            {
                lblAllFaPiaoLv.Text = string.Format("{0:f2}", (faPiaoTotal / allPoTotal * 100));
            }
            var sumAllScore = pOOrderList.Sum(t => t.allScore);
            var sumMyValue  = pOOrderList.Sum(t => t.MyValue);
            var count       = pOOrderList.Count(t => t.DisDate != null);

            lblAllScore.Text    = string.Format("{0:f2}", sumAllScore);
            lblFanKuiScore.Text = string.Format("{0:f2}", sumMyValue);

            if (count == 0)
            {
                lblAvgScore.Text   = string.Format("{0:f2}", 0);
                lblAvgFKscore.Text = string.Format("{0:f2}", 0);
            }
            else
            {
                lblAvgScore.Text   = string.Format("{0:f2}", sumAllScore / count);
                lblAvgFKscore.Text = string.Format("{0:f2}", sumMyValue / count);
            }


            AspNetPager1.RecordCount = pOOrderList.Count;
            this.gvMain.PageIndex    = AspNetPager1.CurrentPageIndex - 1;

            this.gvMain.DataSource = pOOrderList;
            this.gvMain.DataBind();

            //pager.TotalCount = pOOrderList.Count;
            //PagerControl page= gvMain.BottomPagerRow.Cells[0].FindControl("myPage") as PagerControl;
            //page.TotalCount = pOOrderList.Count;
            //page.BindData();
            // AspNetPager1.CustomInfoHTML = "第<font color='red'><b>%currentPageIndex%</b></font>页,共%PageCount%页,每页显示%PageSize%条记录";
        }
Exemple #24
0
        private void Show(bool isPrint = false)
        {
            string sql = " 1=1 ";

            if (txtBusFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtBusFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('公交费发票号码 格式错误!');</script>");
                return;
            }

            if (txtRepastFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtRepastFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('餐饮发票号码 格式错误!');</script>");
                return;
            }
            if (txtHotelFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtHotelFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('住宿发票号码 格式错误!');</script>");
                return;
            }
            if (txtOilFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtOilFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('汽油发票号码 格式错误!');</script>");
                return;
            }
            if (txtGuoBeginFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtGuoBeginFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('过路费发票号码 格式错误!');</script>");
                return;
            }
            if (txtPostFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtPostFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('邮寄发票号码 格式错误!');</script>");
                return;
            }
            if (txtOtherFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtOtherFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('其它费用发票号码 格式错误!');</script>");
                return;
            }
            if (txtCaiFPNO.Text.Trim() != "" && CommHelp.VerifesToNum_NoString(txtCaiFPNO.Text.Trim()) == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('小额采购发票号码 格式错误!');</script>");
                return;
            }


            if (txtBusFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and BusFPNO like '%{0}%'", txtBusFPNO.Text.Trim());
            }

            if (txtRepastFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and RepastFPNO like '%{0}%'", txtRepastFPNO.Text.Trim());
            }
            if (txtHotelFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and HotelFPNO like '%{0}%'", txtHotelFPNO.Text.Trim());
            }
            if (txtOilFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and OilFPNO like '%{0}%'", txtOilFPNO.Text);
            }
            if (txtGuoBeginFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and GuoBeginFPNO like '%{0}%'", txtGuoBeginFPNO.Text.Trim());
            }
            if (txtPostFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and PostFPNO like '%{0}%'", txtPostFPNO.Text.Trim());
            }
            if (txtOtherFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and OtherFPNO like '%{0}%'", txtOtherFPNO.Text.Trim());
            }
            if (txtCaiFPNO.Text.Trim() != "")
            {
                sql += string.Format(" and CaiFPNO like '%{0}%'", txtCaiFPNO.Text.Trim());
            }


            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Tb_DispatchList.CreateTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Tb_DispatchList.CreateTime<='{0} 23:59:59'", txtTo.Text);
            }

            if (txtGuestName.Text.Trim() != "")
            {
                sql += string.Format(" and Tb_DispatchList.GuestName like '%{0}%'", txtGuestName.Text.Trim());
            }
            if (txtPOName.Text.Trim() != "")
            {
                sql += string.Format(" and Tb_DispatchList.POName like '%{0}%'", txtPOName.Text.Trim());
            }
            if (txtPONO.Text.Trim() != "")
            {
                if (CheckPoNO(txtPONO.Text) == false)
                {
                    return;
                }
                sql += string.Format(" and Tb_DispatchList.PONo like '%{0}%'", txtPONO.Text.Trim());
            }
            if (ddlFuHao.Text != "-1" && !string.IsNullOrEmpty(txtTotal.Text))
            {
                if (CommHelp.VerifesToNum(txtTotal.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('报销金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and ISNULL(BusTotal,0)+ISNULL(RepastTotal,0)+ISNULL(HotelTotal,0)+ISNULL(OilTotal,0)+ISNULL(GuoTotal,0)+ISNULL(PostTotal,0)+ISNULL(Tb_DispatchList.PoTotal,0)+ISNULL(OtherTotal,0) {0}{1}", ddlFuHao.Text, txtTotal.Text);
            }
            if (txtProNo.Text.Trim() != "")
            {
                if (CheckProNo(txtProNo.Text) == false)
                {
                    return;
                }
                sql += string.Format(" and Tb_DispatchList.CardNo like '%{0}%'", txtProNo.Text.Trim());
            }
            if (ddlFundType.Text != "-1")
            {
                if (ddlFundType.Text == "0")//公交费
                {
                    sql += string.Format(" and BusTotal is not null and BusTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "1")//餐饮费
                {
                    sql += string.Format(" and RepastTotal is not null and RepastTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "2")//住宿费
                {
                    sql += string.Format(" and HotelTotal is not null and HotelTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "3")//汽油补贴
                {
                    sql += string.Format(" and OilTotal is not null and OilTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "4")//过路费
                {
                    sql += string.Format(" and GuoTotal is not null and GuoTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "5")//邮寄费
                {
                    sql += string.Format(" and PostTotal is not null and PostTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "6")//小额采购
                {
                    sql += string.Format(" and Tb_DispatchList.PoTotal is not null and Tb_DispatchList.PoTotal>0", ddlFundType.Text);
                }
                else if (ddlFundType.Text == "7")//其他费用
                {
                    sql += string.Format(" and OtherTotal is not null and OtherTotal>0", ddlFundType.Text);
                }
            }
            if (ddlCompany.Text != "-1")
            {
                sql += string.Format(" and TB_Company.ComCode='{0}'", ddlCompany.Text.Split(',')[2]);
            }

            if (ddlUser.Text != "-1")
            {
                sql += string.Format(" and AE='{0}'", ddlUser.SelectedItem.Text);
            }
            if (ddlState.Text != "全部")
            {
                sql += string.Format(" and Tb_DispatchList.state='{0}'", ddlState.Text);
            }
            if (!string.IsNullOrEmpty(txtKeyWords.Text))
            {
                sql += string.Format(@" and ([BusFromAddress] like '%{0}%'
or [BusFromAddress] like '%{0}%' or [BusToAddress] like '%{0}%' or  CONVERT(varchar(100), BusFromTime, 120) like '%{0}%' or CONVERT(varchar(100), BusToTime, 120) like '%{0}%'
or [RepastAddress] like '%{0}%' or [RepastTotal] like '%{0}%' or [RepastPerNum] like '%{0}%' or [RepastPers] like '%{0}%'
or [HotelAddress] like '%{0}%' or [HotelName] like '%{0}%' or [OilFromAddress] like '%{0}%' or [OilToAddress] like '%{0}%'
or [OilLiCheng] like '%{0}%' or [GuoBeginAddress] like '%{0}%' or [GuoToAddress] like '%{0}%' or [PostFromAddress] like '%{0}%'
or [PostToAddress] like '%{0}%' or [PoContext] like '%{0}%' or [OtherContext] like '%{0}%' or [BusRemark] like '%{0}%'
or [RepastRemark] like '%{0}%' or [HotelRemark] like '%{0}%' or [OilRemark] like '%{0}%' or [GuoRemark] like '%{0}%'
or [PostRemark] like '%{0}%' or Tb_DispatchList.[PoRemark] like '%{0}%' or [OtherRemark] like '%{0}%' or [PostNo] like '%{0}%'
or [PostCompany] like '%{0}%' or [PostContext] like '%{0}%' or [PostToPer] like '%{0}%' or [Post_No] like '%{0}%')", txtKeyWords.Text);
            }

            if (ddlModel.Text != "全部")
            {
                sql += string.Format(" and Model='{0}'", ddlModel.Text);
            }
            //增加查询条件
            if (ddlGuestTypeList.SelectedValue != "全部")
            {
                sql += string.Format(" and GuestType='{0}'", ddlGuestTypeList.SelectedValue);
            }

            if (ddlGuestProList.SelectedValue != "-2")
            {
                sql += string.Format(" and GuestPro={0}", ddlGuestProList.SelectedValue);
            }

            if (ddlClose.Text != "-1")
            {
                sql += string.Format(" and CG_POOrder.IsClose={0} ", ddlClose.Text);
            }
            if (ddlIsSelect.Text != "-1")
            {
                sql += string.Format(" and CG_POOrder.IsSelected={0} ", ddlIsSelect.Text);
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                sql += string.Format(" and CG_POOrder.JieIsSelected={0} ", ddlJieIsSelected.Text);
            }
            if (ddlIsSpecial.Text != "-1")
            {
                sql += string.Format(" and CG_POOrder.IsSpecial={0} ", ddlIsSpecial.Text);
            }

            if (!string.IsNullOrEmpty(txtPOSTNO.Text.Trim()))
            {
                sql += string.Format(" and PostNo LIKE '%{0}%' ", txtPOSTNO.Text.Trim());
            }
            List <Tb_DispatchList> dispatchList = this.dispatchSer.GetListArrayReport(sql);

            if (isPrint)
            {
                Tb_DispatchList sumTotal = new Tb_DispatchList();
                sumTotal.Total = dispatchList.Sum(t => t.Total);
                dispatchList.Add(sumTotal);
            }
            lblTotal.Text = dispatchList.Sum(t => t.Total).ToString();

            AspNetPager1.RecordCount = dispatchList.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = dispatchList;
            this.gvList.DataBind();
        }
        public bool FormCheck()
        {
            #region 设置自己要判断的信息


            if (txtRuTime.Text == "")
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写出库日期!');</script>");
                txtRuTime.Focus();
                return(false);
            }
            else
            {
                if (CommHelp.VerifesToDateTime(txtRuTime.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('出库日期 格式错误!');</script>");
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(txtSellProNo.Text))
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你选择出库单号!');</script>");
                txtSellProNo.Focus();
                return(false);
            }

            try
            {
                Convert.ToDateTime(txtRuTime.Text);
            }
            catch (Exception)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写出库日期格式有误!');</script>");
                txtRuTime.Focus();
                return(false);
            }


            if (ddlPers.Visible == true && ddlPers.SelectedItem == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择下一步审核人!');</script>");
                ddlPers.Focus();

                return(false);
            }



            if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写申请用户不存在!');</script>");

                return(false);
            }

            //if (DBHelp.ExeScalar(string.Format("select ID from tb_User where loginName='{0}'", txtName.Text)) == null)
            //{
            //    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('你填写检验人不存在!');</script>");

            //    return false;
            //}

            #endregion


            if (rdoA.Checked == false && rdoB.Checked == false)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择签收状态!');</script>");
                return(false);
            }
            if (Request["allE_id"] == null)
            {
                //List<Sell_OrderOutHouseBacks> POOrders = Session["Orders"] as List<Sell_OrderOutHouseBacks>;

                //if (POOrders == null || POOrders.Count <= 0)
                //{
                //    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请添加明显信息!');</script>");
                //    return false;
                //}

                //if (POOrders.Count == 0)
                //{
                //    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('请选择销售商品!');</script>");

                //    return false;

                //}
            }
            else
            {
            }
            return(true);
        }
Exemple #26
0
        private void Show()
        {
            string sql = " 1=1 ";

            if (ddlCompany.Text != "全部")
            {
                sql += string.Format(" and tb_QuotePrice.ComName='{0}'", ddlCompany.SelectedItem.Text);
            }
            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and QuoteDate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and QuoteDate<='{0} 23:59:59'", txtTo.Text);
            }
            if (txtProno.Text != "")
            {
                sql += string.Format(" and QuoteNo like '%{0}%'", txtProno.Text);
            }

            if (txtGuestName.Text.Trim() != "")
            {
                sql += string.Format(" and GuestName like '%{0}%'", txtGuestName.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtLinkMan.Text))
            {
                sql += string.Format(" and ContactPerToInv like '%{0}%'", txtLinkMan.Text);
            }
            if (!string.IsNullOrEmpty(txtGuestAddress.Text))
            {
                sql += string.Format(" and AddressToInv like '%{0}%'", txtGuestAddress.Text);
            }
            if (!string.IsNullOrEmpty(txtZhaiYao.Text))
            {
                sql += string.Format(" and Remark like '%{0}%'", txtZhaiYao.Text);
            }

            if (!string.IsNullOrEmpty(txtGoodName.Text) || !string.IsNullOrEmpty(txtModel.Text) || !string.IsNullOrEmpty(txtGoodBrand.Text))
            {
                sql += string.Format(" and exists ( select tb_QuotePrice_InvDetails.id from tb_QuotePrice_InvDetails  where 1=1 ");

                if (!string.IsNullOrEmpty(txtGoodName.Text))
                {
                    sql += string.Format(" and InvName like '%{0}%'", txtGoodName.Text);
                }
                if (!string.IsNullOrEmpty(txtModel.Text))
                {
                    sql += string.Format(" and InvModel like '%{0}%'", txtModel.Text);
                }
                if (!string.IsNullOrEmpty(txtGoodBrand.Text))
                {
                    sql += string.Format(" and InvBrand like '%{0}%'", txtGoodBrand.Text);
                }
                sql += " and tb_QuotePrice_InvDetails.QuoteId=tb_QuotePrice.Id)";
            }

            if (ddlUser.Text == "-1")//显示所有用户
            {
            }
            else if (ddlUser.Text == "0")//显示部门信息
            {
                var model = Session["userInfo"] as User;
                sql += string.Format(" and CreateUser in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') ",
                                     model.LoginIPosition);
            }
            else
            {
                sql += string.Format(" and CreateUser={0} ", ddlUser.Text);
            }

            if (ddlType.Text != "-1")
            {
                sql += string.Format(" and QPType={0}", ddlType.Text);
            }
            List <tb_QuotePrice> pos = this.qpSer.GetListArray(sql);

            AspNetPager1.RecordCount = pos.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = pos;
            this.gvList.DataBind();
        }
        private void Show()
        {
            string sql = " 1=1 ";

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发生时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and EvTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text.Trim()) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发生时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and EvTime<='{0} 23:59:59'", txtTo.Text);
            }


            if (txtNo.Text.Trim() != "")
            {
                if (CheckProNo(txtNo.Text) == false)
                {
                    return;
                }
                sql += string.Format(" and CardNo like '%{0}%'", txtNo.Text.Trim());
            }



            sql += string.Format(" and (UserId={0} or exists(select id from CG_POOrder where CG_POOrder.PONo=Tb_DispatchList.PONo and IFZhui=0  and AE='{1}'))", Session["currentUserId"], Session["LoginName"].ToString());



            sql += string.Format(@" and Tb_DispatchList.id in (select allE_id from tb_EForm where proId in (
select pro_Id from A_ProInfo where pro_Type in ('预期报销单(油费报销)','预期报销单')) and state='通过')");



            //List<Tb_DispatchList> dispaths = this.dispathSer.GetListArray(sql);
            //decimal total = 0;
            //foreach (Tb_DispatchList model in dispaths)
            //{
            //    total += model.Total;
            //}

            string type = ddlType.Text;



            if (type == "")
            {
                gvList.Attributes.Add("Width", "300%");
                gvList.Width = Unit.Parse("300%");
                for (int i = 4; i <= 48; i++)
                {
                    gvList.Columns[i].Visible = true;
                }
            }
            else
            {
                gvList.Attributes.Add("Width", "100%");
                gvList.Width = Unit.Parse("100%");
                for (int i = 4; i <= 48; i++)
                {
                    gvList.Columns[i].Visible = false;
                }
                if (type == "公交费")
                {
                    for (int i = 4; i <= 11; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }

                    sql += string.Format(" and BusTotal is not null");
                }
                else if (type == "餐饮费")
                {
                    for (int i = 12; i <= 17; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and RepastTotal is not null");
                }
                else if (type == "住宿费")
                {
                    for (int i = 18; i <= 22; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and HotelTotal is not null");
                }
                else if (type == "汽油补贴")
                {
                    for (int i = 23; i <= 27; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and OilTotal is not null");
                }
                else if (type == "过路费")
                {
                    for (int i = 28; i <= 31; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and GuoTotal is not null");
                }
                else if (type == "邮寄费")
                {
                    for (int i = 32; i <= 41; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and PostTotal is not null");
                }
                else if (type == "小额采购")
                {
                    for (int i = 42; i <= 44; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and PoTotal is not null");
                }
                else if (type == "其它费用")
                {
                    for (int i = 45; i <= 48; i++)
                    {
                        gvList.Columns[i].Visible = true;
                    }
                    sql += string.Format(" and OtherTotal is not null");
                }
            }

            List <Tb_DispatchList> dispaths = this.dispathSer.GetListArray(sql);
            decimal total = 0;


            if (type == "")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.Total;
                }
            }
            else if (type == "公交费")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.BusTotal.Value;
                }
            }
            else if (type == "餐饮费")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.RepastTotal.Value;
                }
            }
            else if (type == "住宿费")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.HotelTotal.Value;
                }
            }
            else if (type == "汽油补贴")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.OilTotal.Value;
                }
            }
            else if (type == "过路费")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.GuoTotal.Value;
                }
            }
            else if (type == "邮寄费")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.PostTotal.Value;
                }
            }
            else if (type == "小额采购")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.PoTotal.Value;
                }
            }
            else if (type == "其它费用")
            {
                foreach (Tb_DispatchList model in dispaths)
                {
                    total += model.OtherTotal.Value;
                }
            }

            lblTotal.Text            = total.ToString();
            AspNetPager1.RecordCount = dispaths.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvList.DataSource   = dispaths;
            this.gvList.DataBind();
        }
        private void Show()
        {
            if (ddlFPType.Items.Count >= 2)
            {
                ddlFPType.Items[ddlFPType.Items.Count - 2].Attributes.Add("style", "background-color: red");
            }
            string sql = " 1=1 ";

            if (txtPONo.Text.Trim() != "")
            {
                if (CheckPoNO(txtPONo.Text.Trim()) == false)
                {
                    return;
                }
                sql += string.Format(" and Sell_OrderFP.PONo like '%{0}%'", txtPONo.Text.Trim());
            }


            if (ttxPOName.Text.Trim() != "")
            {
                sql += string.Format(" and POName like '%{0}%'", ttxPOName.Text.Trim());
            }

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and RuTime>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and RuTime<='{0} 23:59:59'", txtTo.Text);
            }


            if (ddlStatue.Text != "")
            {
                sql += string.Format(" and Status='{0}'", ddlStatue.Text);
            }
            else
            {
                sql += string.Format(" and Status<>'不通过'");
            }

            if (txtProNo.Text.Trim() != "")
            {
                if (CheckProNo(txtProNo.Text.Trim()) == false)
                {
                    return;
                }
                sql += string.Format(" and ProNo like '%{0}%'", txtProNo.Text.Trim());
            }

            if (txtGuestName.Text.Trim() != "")
            {
                sql += string.Format(" and GuestName  like '%{0}%'", txtGuestName.Text.Trim());
            }
            if (!string.IsNullOrEmpty(txtFPTotal.Text))
            {
                if (CommHelp.VerifesToNum(txtFPTotal.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('发票金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Total {0}{1}", ddlPOFaTotal.Text, txtFPTotal.Text);
            }
            if (!string.IsNullOrEmpty(txtOldFPTotal.Text))
            {
                if (CommHelp.VerifesToNum(txtOldFPTotal.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('原金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and TopTotal {0}{1}", ddlOldPOFaTotal.Text, txtOldFPTotal.Text);
            }
            if (txtOldFPNo.Text != "")
            {
                sql += string.Format(" and TopFPNo like '%{0}%'", txtOldFPNo.Text);
            }

            if (ddlIsSelect.Text != "-1" && ddlIsClose.Text != "-1" && ddlJieIsSelected.Text != "-1" && ddlIsSpecial.Text != "-1" && ddlModel.Text != "全部")
            {
                sql += string.Format(" and exists(select id from CG_POOrder where Status='通过' and IsClose={0} and IsSelected={1} and JieIsSelected={2} and IsSpecial={3} and model={4} and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlIsClose.Text, ddlIsSelect.Text, ddlJieIsSelected.Text,
                                     ddlIsSpecial.Text, ddlModel.Text);
            }
            else
            {
                if (ddlIsClose.Text != "-1")
                {
                    sql += string.Format(" and exists(select id from CG_POOrder where Status='通过' and IsClose={0} and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlIsClose.Text);
                }
                if (ddlIsSelect.Text != "-1")
                {
                    sql += string.Format("and exists(select id from CG_POOrder where Status='通过' and IsSelected={0} and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlIsSelect.Text);
                }
                if (ddlJieIsSelected.Text != "-1")
                {
                    sql += string.Format("and exists(select id from CG_POOrder where Status='通过' and JieIsSelected={0} and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlJieIsSelected.Text);
                }
                if (ddlIsSpecial.Text != "-1")
                {
                    sql += string.Format("and exists(select id from CG_POOrder where Status='通过' and IsSpecial={0} and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlIsSpecial.Text);
                }
                if (ddlModel.Text != "全部")
                {
                    sql += string.Format("and exists(select id from CG_POOrder where Status='通过' and model='{0}' and CG_POOrder.PONO=Sell_OrderFP.PONO ) ", ddlModel.Text);
                }
            }
            if (ddlUser.Text != "-1")
            {
                sql += string.Format(" and CreateUserId={0}", ddlUser.Text);
            }
            if (ddlCompany.Text != "-1")
            {
                string where = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[2]);
                sql         += string.Format(" and CreateUserId IN(select id from tb_User where {0})", where);
            }

            if (txtFPNo.Text.Trim() != "")
            {
                sql += string.Format(" and FPNo like '%{0}%'", txtFPNo.Text.Trim());
            }

            if (ddlType.Text == "0")
            {
                sql += string.Format(" and exists(select Sell_OrderFPBack.id from Sell_OrderFPBack where Status='通过' and FPNo=Sell_OrderFP.FPNo )");
            }
            if (ddlType.Text == "1")
            {
                sql += string.Format(" and not exists(select Sell_OrderFPBack.id from Sell_OrderFPBack where Status='通过' and FPNo=Sell_OrderFP.FPNo)");
            }

            if (ddlPOInvoiceState.Text == "1")//发票数<项目数
            {
                //sql += string.Format(" and exists(select PONO from POFP_View where PONO=Sell_OrderFP.PONO and SumPoTotal-TuiTotal>sumTotal )");
                sql += string.Format(" and  SumPoTotal-TuiTotal>sumTotal ");
            }
            else if (ddlPOInvoiceState.Text == "2")//发票数>项目数
            {
                //sql += string.Format(" and exists(select PONO from POFP_View where PONO=Sell_OrderFP.PONO and  SumPoTotal-TuiTotal<sumTotal )");
                sql += string.Format(" and SumPoTotal-TuiTotal<sumTotal ");
            }
            else if (ddlPOInvoiceState.Text == "3")//发票数=项目数
            {
                //sql += string.Format(" and exists(select PONO from POFP_View where PONO=Sell_OrderFP.PONO and  SumPoTotal-TuiTotal=sumTotal )");
                sql += string.Format(" and SumPoTotal-TuiTotal=sumTotal ");
            }

            if (ddlFPType.Text != "-1")
            {
                if (ddlFPType.SelectedItem.Text != "其他")
                {
                    sql += string.Format(" and FPNoStyle='{0}'", ddlFPType.SelectedItem.Text);
                }
                else
                {
                    sql += string.Format(" and FPNoStyle not in (select FpType from FpTypeBaseInfo) and FPNoStyle<>''");
                }
            }
            if (ddlGuestTypeList.SelectedValue != "全部" || ddlGuestProList.SelectedValue != "-2")
            {
                string where = "";
                if (ddlGuestTypeList.SelectedValue != "全部")
                {
                    where += string.Format(" and GuestType='{0}'", ddlGuestTypeList.SelectedValue);
                }
                if (ddlGuestProList.SelectedValue != "-2")
                {
                    where += string.Format(" and GuestPro={0}", ddlGuestProList.SelectedValue);
                }
                sql += string.Format("and exists(select id from CG_POOrder where Status='通过' {0} and CG_POOrder.PONO=Sell_OrderFP.PONO and IFZhui=0) ", where);
            }
            List <Sell_OrderFP> pOOrderList = this.POSer.GetListArray(sql);

            decimal allTotal   = 0;
            decimal allPoTotal = 0;

            System.Collections.Hashtable hs = new Hashtable();
            foreach (var m in pOOrderList)
            {
                allTotal += m.Total;

                if (!hs.Contains(m.PONo))
                {
                    allPoTotal += m.AllPoTotal;
                    hs.Add(m.PONo, null);
                }
            }
            lblAllTotal.Text         = allTotal.ToString();
            lblAllPoTotal.Text       = allPoTotal.ToString();
            AspNetPager1.RecordCount = pOOrderList.Count;
            this.gvMain.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvMain.DataSource   = pOOrderList;
            this.gvMain.DataBind();


            //if (pOOrderList.Count > 0)
            //{
            //    CG_POOrderService orderSer = new CG_POOrderService();
            //    var list = orderSer.GetOrder_ToInvoice_1(string.Format(" PONo='{0}'", pOOrderList[0].PONo));
            //    if (list.Count > 0)
            //    {

            //        lblPOTotal.Text = "项目(" + pOOrderList[0].PONo+")---" + (list[0].POTotal - list[0].TuiTotal).ToString();
            //    }
            //    else
            //    {
            //        lblPOTotal.Text = "0";
            //    }


            //lblPOTotal.Text = "";
            //}
            //子单
            List <Sell_OrderFPs> orders = new List <Sell_OrderFPs>();

            gvList.DataSource = orders;
            gvList.DataBind();
        }
Exemple #29
0
        private void select()
        {
            string sql = " 1=1 ";

            //QueryEForms
            QuerySession.QueryEForm QEForm = new VAN_OA.QuerySession.QueryEForm();


            if (ddlProType.SelectedItem != null && ddlProType.SelectedItem.Text != "")
            {
                if (ddlProType.SelectedItem.Value == "-2")
                {
                    sql += string.Format(" and proId in (26,34)");
                }
                else if (ddlProType.SelectedItem.Value == "-3")
                {
                    sql += string.Format(" and proId in (31,32)");
                }
                else
                {
                    sql += string.Format(" and proId={0}", ddlProType.SelectedItem.Value);
                }

                QEForm.ProTypeId = Convert.ToInt32(ddlProType.SelectedItem.Value);
            }
            else
            {
                sql += " and pro_Type is not null";
            }
            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('申请时间 格式错误!');</script>");
                    return;
                }
                sql            += string.Format(" and appTime>='{0} 00:00:00'", txtFrom.Text);
                QEForm.FromTime = txtFrom.Text;
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('申请时间 格式错误!');</script>");
                    return;
                }
                sql          += string.Format(" and appTime<='{0} 23:59:59'", txtTo.Text);
                QEForm.ToTime = txtTo.Text;
            }
            if (ddlState.SelectedItem.Text != "")
            {
                sql += string.Format(" and state='{0}'", ddlState.SelectedItem.Text);

                QEForm.State = ddlState.SelectedItem.Text;
            }

            if (txtSPForm.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtSPForm.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('审批时间 格式错误!');</script>");
                    return;
                }
            }
            if (txtSPTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtSPTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('审批时间 格式错误!');</script>");
                    return;
                }
            }

            if (txtSPForm.Text != "" && txtSPTo.Text != "")
            {
                sql += string.Format(" and isnull(maxDoTime,tb_EForm_View.createTime)>='{0} 00:00:00' and isnull(maxDoTime,tb_EForm_View.createTime)<='{1} 23:59:59' ",
                                     txtSPForm.Text, txtSPTo.Text);
            }
            if (txtSPForm.Text == "" && txtSPTo.Text != "")
            {
                sql += string.Format(" and isnull(maxDoTime,tb_EForm_View.createTime)<='{0} 23:59:59'",
                                     txtSPTo.Text);
            }
            if (txtSPForm.Text != "" && txtSPTo.Text == "")
            {
                sql += string.Format(" and isnull(maxDoTime,tb_EForm_View.createTime)>='{0} 00:00:00' ",
                                     txtSPForm.Text);
            }
            QEForm.SPForm = txtSPForm.Text;
            QEForm.SPTo   = txtSPTo.Text;


            if (ddlUser.Text != "-1")
            {
                sql += string.Format(" and appPer_Name like '%{0}%'", ddlUser.SelectedItem.Text);

                QEForm.Apper = ddlUser.SelectedItem.Text;
            }

            if (txtAuper.Text != "")
            {
                sql         += string.Format(" and id in (select e_Id  from EForms_View where audPer_Name like '%{0}%' or consignor_Name like '%{0}%')", txtAuper.Text);
                QEForm.Auper = txtAuper.Text;
            }

            if (txtWating.Text != "")
            {
                sql += string.Format(" and toPer_Name like '%{0}%'", txtWating.Text);
                QEForm.WatingAuper = txtWating.Text;
            }


            if (txtNo.Text.Trim() != "")
            {
                if (CheckProNo(txtNo.Text) == false)
                {
                    return;
                }
                sql        += string.Format(" and e_No like '%{0}%'", txtNo.Text.Trim());
                QEForm.E_No = txtNo.Text;
            }
            if (!string.IsNullOrEmpty(txtPOSupplier.Text.Trim()))
            {
                if (cbPiPei.Checked)
                {
                    sql += string.Format(@" and proId in (31,32,33) and exists(select 1 from (select CAI_POCai.LastSupplier,TB_SupplierAdvancePayments.Id,32 as myProId  from TB_SupplierAdvancePayments
left join CAI_POCai on TB_SupplierAdvancePayments.CaiIds=CAI_POCai.Ids
union all
select TB_SupplierInvoice.LastSupplier,TB_SupplierInvoice.Id,31 as myProId from TB_SupplierInvoice left join TB_SupplierInvoices on TB_SupplierInvoice.Id=TB_SupplierInvoices.Id
where IsYuFu=0
union all
select  TB_SupplierInvoice.LastSupplier,TB_SupplierInvoice.Id,33 as myProId  from TB_SupplierInvoice left join TB_SupplierInvoices on TB_SupplierInvoice.Id=TB_SupplierInvoices.Id
where IsYuFu=1
) as A where A.myProId=tb_EForm_View.proId and A.Id=tb_EForm_View.allE_id and LastSupplier='{0}' )", txtPOSupplier.Text.Trim());
                }
                else
                {
                    sql += string.Format(@" and proId in (31,32,33) and exists(select 1 from (select CAI_POCai.LastSupplier,TB_SupplierAdvancePayments.Id,32 as myProId  from TB_SupplierAdvancePayments
left join CAI_POCai on TB_SupplierAdvancePayments.CaiIds=CAI_POCai.Ids
union all
select TB_SupplierInvoice.LastSupplier,TB_SupplierInvoice.Id,31 as myProId from TB_SupplierInvoice left join TB_SupplierInvoices on TB_SupplierInvoice.Id=TB_SupplierInvoices.Id
where IsYuFu=0
union all
select  TB_SupplierInvoice.LastSupplier,TB_SupplierInvoice.Id,33 as myProId  from TB_SupplierInvoice left join TB_SupplierInvoices on TB_SupplierInvoice.Id=TB_SupplierInvoices.Id
where IsYuFu=1
) as A where A.myProId=tb_EForm_View.proId and A.Id=tb_EForm_View.allE_id and LastSupplier like '%{0}%' )", txtPOSupplier.Text.Trim());
                }
            }
            #region 项目查询
            string ponoSql = "";
            if (ddlAEUsers.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.AE='{0}'", ddlAEUsers.SelectedItem.Text);
            }
            if (txtPONo.Text.Trim() != "")
            {
                if (CheckPoNO(txtPONo.Text) == false)
                {
                    return;
                }
                ponoSql    += string.Format(" and CG_POOrder.PONo like '%{0}%'", txtPONo.Text.Trim());
                QEForm.PONO = txtPONo.Text;
            }
            if (ddlCompany.Text != "-1")
            {
                string where = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[2]);
                ponoSql     += string.Format(" and CG_POOrder.AE IN(select LOGINNAME from tb_User where {0})", where);
            }
            if (txtGuestName.Text.Trim() != "")
            {
                ponoSql         += string.Format(" and CG_POOrder.GuestName  like '%{0}%'", txtGuestName.Text.Trim());
                QEForm.GuestName = txtGuestName.Text.Trim();
            }
            if (CheckBox1.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue='{0}'", CheckBox1.Text);
            }
            if (CheckBox2.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue2='{0}'", CheckBox2.Text);
            }
            if (CheckBox3.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue3='{0}'", CheckBox3.Text);
            }
            if (CheckBox4.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue4='{0}'", CheckBox4.Text);
            }

            if (CheckBox5.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue5='{0}'", CheckBox5.Text);
            }

            if (CheckBox6.Checked)
            {
                ponoSql += string.Format(" and CG_POOrder.POStatue6='{0}'", CheckBox6.Text);
            }
            if (ddlClose.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.IsClose={0} ", ddlClose.Text);
            }
            if (ddlIsSelect.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.IsSelected={0} ", ddlIsSelect.Text);
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.JieIsSelected={0} ", ddlJieIsSelected.Text);
            }
            if (ddlIsSpecial.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.IsSpecial={0} ", ddlIsSpecial.Text);
            }

            if (ddlHanShui.Text != "-1")
            {
                ponoSql += string.Format(" and CG_POOrder.IsPoFax={0} ", ddlHanShui.Text);
            }
            if (ddlPrice.Text == "1")
            {
                ponoSql += " and Order_ToInvoice_1.POTotal-isnull(TuiTotal,0)>0";
            }
            if (ddlPrice.Text == "0")
            {
                ponoSql += " and Order_ToInvoice_1.POTotal-isnull(TuiTotal,0)=0";
            }
            if (ponoSql != "")
            {
                sql += string.Format(" and EXISTS (SELECT 1 FROM CG_CAI_POOrder_View as CG_POOrder left join View_AllEform on CG_POOrder.pono=View_AllEform.pono  ");
                if (ddlPrice.Text != "-1")
                {
                    sql += " left join Order_ToInvoice_1 on CG_POOrder.PONo=Order_ToInvoice_1.PONo ";
                }

                sql += string.Format("   WHERE View_AllEform.myProId=tb_EForm_View.proId and View_AllEform.Id=tb_EForm_View.allE_id {0})", ponoSql);
            }

            #endregion

            Session["QueryEForms"] = QEForm;
            tb_EFormService eformSer = new tb_EFormService();
            PagerDomain     page     = new PagerDomain();
            page.CurrentPageIndex = AspNetPager1.CurrentPageIndex;

            List <tb_EForm> allEForms = eformSer.GetListArray_2_Page(sql, page);
            AspNetPager1.RecordCount = page.TotalCount;

            string allIds = "", proIds = "", fukuandan = "0,", yufukuandan = "0,";


            for (int i = 0; i < allEForms.Count; i++)
            {
                allIds += allEForms[i].allE_id.ToString() + ",";
                proIds += allEForms[i].proId.ToString() + ",";
                if (allEForms[i].ProTyleName == "供应商付款单")
                {
                    fukuandan += allEForms[i].allE_id + ",";
                }
                if (allEForms[i].ProTyleName == "供应商预付款单")
                {
                    yufukuandan += allEForms[i].allE_id + ",";
                }
            }

            allIds = allIds.Trim(',');
            proIds = proIds.Trim(',');

            fukuandan   = fukuandan.Trim(',');
            yufukuandan = yufukuandan.Trim(',');


            if (fukuandan != "" || yufukuandan != "")
            {
                var superSer = new TB_SupplierAdvancePaymentService();
                SupplierInvoice_Names = superSer.GetSupplierName(yufukuandan, fukuandan);
            }

            if (allIds != "")
            {
                allAllWform = eformSer.GetView_AllEformList(proIds, allIds);
            }

            this.gvList.DataSource = allEForms;
            this.gvList.DataBind();
        }
Exemple #30
0
        private void Show()
        {
            string sql = " ";

            if (txtPONo.Text.Trim() != "")
            {
                if (CheckPoNO(txtPONo.Text) == false)
                {
                    return;
                }
                sql += string.Format(" and CG_POOrder.PONo like '%{0}%'", txtPONo.Text.Trim());
            }


            if (ttxPOName.Text.Trim() != "")
            {
                sql += string.Format(" and CG_POOrder.POName like '%{0}%'", ttxPOName.Text.Trim());
            }

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CG_POOrder.PODate>='{0} 00:00:00'", txtFrom.Text);
            }

            if (txtTo.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目时间 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and CG_POOrder.PODate<='{0} 23:59:59'", txtTo.Text);
            }


            if (txtGuestName.Text.Trim() != "")
            {
                sql += string.Format(" and CG_POOrder.GuestName  like '%{0}%'", txtGuestName.Text.Trim());
            }
            var isColse = "";

            if (ddlIsClose.Text != "-1")
            {
                isColse = " and IsClose=" + ddlIsClose.Text;
            }

            if (ddlIsSelect.Text != "-1")
            {
                isColse = " and IsSelected=" + ddlIsSelect.Text;
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                isColse = " and JieIsSelected=" + ddlJieIsSelected.Text;
            }
            if (ddlModel.Text != "全部")
            {
                sql += string.Format(" and Model='{0}'", ddlModel.Text);
            }

            //if (ViewState["showAll"] != null)
            //{
            //    sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO )", Session["currentUserId"]);
            //}


            if (ddlUser.Text == "-1")//显示所有用户
            {
                if (cbIsSpecial.Checked)
                {
                    sql += string.Format(" and EXISTS (select ID from CG_POOrder where IsSpecial=0 AND PONO=JXC_REPORT.PONO {0})", isColse);
                }
                //else
                //{
                //    sql += string.Format(" and EXISTS (select ID from CG_POOrder where IsSpecial=1 AND PONO=JXC_REPORT.PONO {0})", isColse);
                //}
                //var model = Session["userInfo"] as User;
                //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职') AND PONO=JXC_REPORT.PONO )", Session["currentUserId"]);
            }
            //else if (ddlUser.Text == "0")//显示部门信息
            //{
            //    var model = Session["userInfo"] as User;
            //    //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName in (select ID from tb_User where 1=1 and loginName<>'admin' and loginStatus<>'离职' and loginIPosition<>'' and loginIPosition='{0}') AND PONO=JXC_REPORT.PONO )", model.LoginIPosition);

            //    if (cbIsSpecial.Checked)
            //    {
            //        sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0}  AND PONO=JXC_REPORT.PONO and IsSpecial=0 {1})", model.Id, isColse);
            //    }
            //    else
            //    {
            //        sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO and IsSpecial=1 {1})", model.Id, isColse);
            //    }
            //}
            else
            {
                if (cbIsSpecial.Checked)
                {
                    sql += string.Format(" and EXISTS (select ID from CG_POOrder where AE='{0}' AND PONO=JXC_REPORT.PONO  and IsSpecial=0 {1})", ddlUser.SelectedItem.Text, isColse);
                }
                else
                {
                    sql += string.Format(" and EXISTS (select ID from CG_POOrder where AE='{0}' AND PONO=JXC_REPORT.PONO  and IsSpecial=1 {1})", ddlUser.SelectedItem.Text, isColse);
                }
                //sql += string.Format(" and EXISTS (select ID from CG_POOrder where AppName={0} AND PONO=JXC_REPORT.PONO )", ddlUser.Text);
            }

            if (ddlCompany.Text != "-1")
            {
                string where = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[2]);
                sql         += string.Format(" and EXISTS (select ID from CG_POOrder where  IFZhui=0 and AE IN(select LOGINNAME from tb_User where {0}) AND PONO=JXC_REPORT.PONO)", where);
            }
            if (CheckBox1.Checked || CheckBox2.Checked || CheckBox3.Checked || CheckBox4.Checked)
            {
                sql += " and exists ( select ID from CG_POOrder where PONO=JXC_REPORT.PONO";
                if (CheckBox1.Checked)
                {
                    sql += string.Format(" and POStatue='{0}'", CheckBox1.Text);
                }
                if (CheckBox2.Checked)
                {
                    sql += string.Format(" and POStatue2='{0}'", CheckBox2.Text);
                }
                if (CheckBox3.Checked)
                {
                    sql += string.Format(" and POStatue3='{0}'", CheckBox3.Text);
                }
                if (CheckBox4.Checked)
                {
                    sql += string.Format(" and POStatue4='{0}'", CheckBox4.Text);
                }

                sql += ")";
            }


            string having = " having ";

            if (CheckBox5.Checked && CheckBox6.Checked)
            {
                having += string.Format("  (avg(SellFPTotal)<> sum(goodSellTotal) or  avg(SellFPTotal) is null)  and (avg(InvoTotal)<> sum(goodSellTotal) or sum(InvoTotal) is null)");
            }
            else if (CheckBox5.Checked || CheckBox6.Checked)
            {
                if (CheckBox5.Checked)
                {
                    having += string.Format("  avg(SellFPTotal)<> sum(goodSellTotal) or  avg(SellFPTotal) is null ");
                }
                if (CheckBox6.Checked)
                {
                    having += string.Format("  avg(InvoTotal)<> sum(goodSellTotal) or sum(InvoTotal) is null ");
                }
            }
            else
            {
                having = "";
            }



            if (CheckBox8.Checked)
            {
                tiaoJian += "'" + CheckBox8.Text + "',";
            }
            if (CheckBox9.Checked)
            {
                tiaoJian += "'" + CheckBox9.Text + "',";
            }
            if (CheckBox10.Checked)
            {
                tiaoJian += "'" + CheckBox10.Text + "',";
            }
            if (CheckBox11.Checked)
            {
                tiaoJian += "'" + CheckBox11.Text + "',";
            }
            if (CheckBox12.Checked)
            {
                tiaoJian += "'" + CheckBox12.Text + "',";
            }
            if (CheckBox13.Checked)
            {
                tiaoJian += "'" + CheckBox13.Text + "',";
            }
            if (CheckBox14.Checked)
            {
                tiaoJian += "'" + CheckBox14.Text + "',";
            }
            if (CheckBox15.Checked)
            {
                tiaoJian += "'" + CheckBox15.Text + "',";
            }
            if (CheckBox16.Checked)
            {
                tiaoJian += "'" + CheckBox16.Text + "',";
            }
            if (CheckBox17.Checked)
            {
                tiaoJian += "'" + CheckBox17.Text + "',";
            }

            if (CheckBox7.Checked == false)
            {
                if (tiaoJian == "")
                {
                    tiaoJian = "''";
                }
            }
            List <JXC_REPORTTotal> pOOrderList = this.POSer.GetListArray_Items_Total(sql, having, tiaoJian);
            var getAllPONos = pOOrderList.Aggregate("", (current, m) => current + ("'" + m.PONo + "',")).Trim(',');

            lblVisAllPONO.Text = getAllPONos;
            decimal   HuiWuTotal    = 0;
            Hashtable hsPONo        = new Hashtable();
            decimal   allTotal      = 0;
            decimal   maoliTotal    = 0;
            decimal   goodSellTotal = 0;
            decimal   TrueLiRun     = 0;
            decimal   SellFPTotal   = 0;



            lblItemTotal.Text = pOOrderList.Sum(t => t.itemTotal).ToString();
            foreach (var m in pOOrderList)
            {
                if (!hsPONo.Contains(m.PONo))
                {
                    HuiWuTotal    += m.HuiWuTotal;
                    allTotal      += m.allItemTotal;
                    maoliTotal    += m.maoliTotal;
                    goodSellTotal += m.goodSellTotal;
                    TrueLiRun     += m.TrueLiRun;
                    SellFPTotal   += m.SellFPTotal;
                    hsPONo.Add(m.PONo, null);
                }
            }

            lblJLR.Text  = string.Format("{0:n2}", maoliTotal);
            lblXSE.Text  = string.Format("{0:n2}", goodSellTotal);
            lblSJLR.Text = string.Format("{0:n2}", TrueLiRun);
            lblFP.Text   = string.Format("{0:n2}", SellFPTotal);

            lblHuiWuTotal.Text   = string.Format("{0:n2}", HuiWuTotal);
            lblAllItemTotal.Text = string.Format("{0:n2}", allTotal);

            AspNetPager1.RecordCount = pOOrderList.Count;
            this.gvMain.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvMain.DataSource   = pOOrderList;
            this.gvMain.DataBind();
        }