Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                //txtStartTime.Text = (DateTime.Now.Year - 1) + "-1-1";


                List <TB_BasePoType> basePoTypeList  = new TB_BasePoTypeService().GetListArray("");
                List <TB_BasePoType> basePoTypeList1 = new TB_BasePoTypeService().GetListArray("");
                cbKaoList.DataSource = basePoTypeList1;
                cbKaoList.DataBind();
                cbKaoList.DataTextField  = "BasePoType";
                cbKaoList.DataValueField = "Id";

                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";



                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                //主单
                List <JXC_REPORTTotal> pOOrderList = new List <JXC_REPORTTotal>();
                this.gvMain.DataSource = pOOrderList;
                this.gvMain.DataBind();

                //if (VAN_OA.JXC.SysObj.IfShowAll(SysObj.JXC_REPORTTotalList, Session["currentUserId"]) == false)
                //{
                //    ViewState["showAll"] = false;
                //}


                bool showAll = true;
                if (QuanXian_ShowAll("销售KPI 量化指标") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("销售KPI 量化指标", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();
                    Show();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _modelList = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                this.gvModel.DataSource = modelService.GetListArray("");;
                this.gvModel.DataBind();

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();
                if (NewShowAll_textName("项目归类", "关闭可编辑") == false)
                {
                    ViewState["isCloseEdist"] = false;
                    btnSaveIsClose.Visible    = false;
                }
                if (NewShowAll_textName("项目归类", "特殊可编辑") == false)
                {
                    ViewState["isSpecialEdit"] = false;
                }
                if (NewShowAll_textName("项目归类", "项目模型可编辑") == false)
                {
                    ViewState["isModelEdit"] = false;
                }
                if (NewShowAll_textName("项目归类", "项目类型可编辑") == false)
                {
                    ViewState["isPOType"] = false;
                }
                if (NewShowAll_textName("项目归类", "含税可编辑") == false)
                {
                    ViewState["isFaxEdist"] = false;
                }
                if (NewShowAll_textName("项目归类", "发票类型可编辑") == false)
                {
                    ViewState["isFPTypeEdist"] = false;
                }
                if (NewShowAll_textName("项目归类", "选中可编辑") == false)
                {
                    ViewState["cbIsSelected"] = false;
                    btnIsSelected.Visible     = false;
                }
                if (NewShowAll_textName("项目归类", "结算选中可编辑") == false)
                {
                    ViewState["IsJieIsSelected"] = false;
                    btnJieIsSelected.Visible     = false;
                }

                if (NewShowAll_textName("项目归类", "财务成本计量可编辑") == false)
                {
                    ViewState["isChengBenJiLiang"] = false;
                }
                if (NewShowAll_textName("项目归类", "计划完工天数可编辑") == false)
                {
                    ViewState["isPlanDays"] = false;
                }
                if (NewShowAll_textName("项目归类", "客户类型可编辑") == false)
                {
                    ViewState["isGuestType"] = false;
                    btnGuestType.Visible     = false;
                }
                if (NewShowAll_textName("项目归类", "客户属性可编辑") == false)
                {
                    ViewState["isGuestPro"] = false;
                    btnGuestPro.Visible     = false;
                }
                var user    = new List <Model.User>();
                var userSer = new Dal.SysUserService();

                //主单
                var pOOrderList = new List <CG_POOrderService>();
                gvMain.DataSource = pOOrderList;
                gvMain.DataBind();

                if (QuanXian_ShowAll("项目归类") == false)
                {
                    ViewState["showAll"] = false;
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }
                else
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                var fpTypeBaseInfoService        = new FpTypeBaseInfoService();
                List <FpTypeBaseInfo> fpTypeList = fpTypeBaseInfoService.GetListArray("");
                fpTypeList.Insert(0, new FpTypeBaseInfo {
                    FpType = "全部", Id = -1
                });
                fpTypeList.Add(new FpTypeBaseInfo {
                    Id = 999, FpType = ""
                });
                dllFPstye.DataSource = fpTypeList;
                dllFPstye.DataBind();
                dllFPstye.DataTextField  = "FpType";
                dllFPstye.DataValueField = "Id";

                dllFPstye.Items[fpTypeList.Count - 1].Attributes.Add("style", "background-color: red");

                List <FpTypeBaseInfo> newFpTypeList = new List <FpTypeBaseInfo>();
                foreach (var fp in fpTypeList)
                {
                    newFpTypeList.Add(new FpTypeBaseInfo {
                        Id = fp.Id, FpType = fp.FpType
                    });
                }

                newFpTypeList.Add(new FpTypeBaseInfo {
                    Id = 1000, FpType = "其他"
                });
                ddlFPType.DataSource = newFpTypeList;
                ddlFPType.DataBind();
                ddlFPType.DataTextField  = "FpType";
                ddlFPType.DataValueField = "Id";

                ddlFPType.Items[newFpTypeList.Count - 2].Attributes.Add("style", "background-color: red");


                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = ""
                });
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });

                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -1
                });
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2,
                });

                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                DataTable carInfos = DBHelp.getDataTable("select ''as CarNO union select CarNO from TB_CarInfo");
                ddlCarNo.DataSource = carInfos;
                ddlCarNo.DataBind();
                ddlCarNo.Text = "";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";



                ddlGuestTypeList1.DataSource = dalList;
                ddlGuestTypeList1.DataBind();
                ddlGuestTypeList1.DataTextField  = "GuestType";
                ddlGuestTypeList1.DataValueField = "GuestType";


                ddlGuestProList1.DataSource = proList;
                ddlGuestProList1.DataBind();
                ddlGuestProList1.DataTextField  = "GuestProString";
                ddlGuestProList1.DataValueField = "GuestPro";

                //List<VAN_OA.Model.User> user = new List<VAN_OA.Model.User>();
                //VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                //user = userSer.getAllUserByPOList();
                //user.Insert(0, new VAN_OA.Model.User() { LoginName = "全部", Id = -1 });
                //ddlUser.DataSource = user;
                //ddlUser.DataBind();
                //ddlUser.DataTextField = "LoginName";
                //ddlUser.DataValueField = "Id";
                bool showAll = true;
                if (QuanXian_ShowAll("用车统计") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }
                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("用车统计", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }
                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                ddlAE.DataSource = user;
                ddlAE.DataBind();
                ddlAE.DataTextField  = "LoginName";
                ddlAE.DataValueField = "Id";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();


                dllCompayList.DataSource = comList;
                dllCompayList.DataBind();


                List <TB_UseCarDetail> UseCarServices = new List <TB_UseCarDetail>();
                this.gvList.DataSource = UseCarServices;
                this.gvList.DataBind();


                List <tb_UseCar> UseCarServices_Si = new List <tb_UseCar>();
                this.GvSi.DataSource = UseCarServices_Si;
                this.GvSi.DataBind();
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtStartTime.Text = (DateTime.Now.Year - 1) + "-1-1";
                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Add(new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                //主单
                List <JXC_REPORTTotal> pOOrderList = new List <JXC_REPORTTotal>();
                this.gvMain.DataSource = pOOrderList;
                this.gvMain.DataBind();

                //if (VAN_OA.JXC.SysObj.IfShowAll(SysObj.JXC_REPORTTotalList, Session["currentUserId"]) == false)
                //{
                //    ViewState["showAll"] = false;
                //}


                bool showAll = true;
                if (QuanXian_ShowAll(SysObj.JXC_REPORTTotalList) == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll(SysObj.JXC_REPORTTotalList, Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByLoginName("");
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='可导出'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='销售报表汇总') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("销售报表汇总", "可导出"))
                {
                    btnExcel.Visible = true;
                }
                else
                {
                    btnExcel.Visible = false;
                }

                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();
                    Show();
                }
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtFrom.Text = DateTime.Now.Year + "-1-1";
                txtTo.Text   = DateTime.Now.ToString("yyyy-MM-dd");
                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComCode += "," + m.ComSimpName;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComCode = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                bool showAll = true;
                if (QuanXian_ShowAll("销售统计报表") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }
                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("销售统计报表", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }


                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";
            }
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                DataTable cardInfo = DBHelp.getDataTable("select '' as CardNo union select BusNo as CardNo from Base_BusInfo");

                ddlCardNo.DataSource = cardInfo;
                ddlCardNo.DataBind();

                ddlCardNo1.DataSource = cardInfo;
                ddlCardNo1.DataBind();

                List <TB_BusCardRecord> BusCardRecordList = new List <TB_BusCardRecord>();
                this.gvCardRecordList.DataSource = BusCardRecordList;
                this.gvCardRecordList.DataBind();


                List <TB_BusCardUse> BusCardUseList = new List <TB_BusCardUse>();
                this.gvCardNOUse.DataSource = BusCardUseList;
                this.gvCardNOUse.DataBind();

                List <VAN_OA.Model.User> aeList = new List <VAN_OA.Model.User>();
                bool showAll = true;
                if (QuanXian_ShowAll("公交卡充值/使用记录") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }
                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("公交卡充值/使用记录", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    aeList = userSer.getAllUserByPOList();
                    aeList.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    aeList = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    aeList.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    aeList.Insert(0, model);
                }
                ddlAE.DataSource = aeList;
                ddlAE.DataBind();
                ddlAE.DataTextField  = "LoginName";
                ddlAE.DataValueField = "Id";
                #region 是否有删除功能
                if (Session["currentUserId"] != null)
                {
                    VAN_OA.Dal.TB_AdminDeleteService deleteSer = new VAN_OA.Dal.TB_AdminDeleteService();
                    if (deleteSer.CheckIsExistByUserId(Convert.ToInt32(Session["currentUserId"])) == false)
                    {
                        gvCardRecordList.Columns[1].Visible = false;
                        gvCardNOUse.Columns[1].Visible      = false;
                    }
                }
                if (NewShowAll_textName("公交卡充值/使用记录", "编辑") == false)
                {
                    gvCardNOUse.Columns[0].Visible      = false;
                    gvCardRecordList.Columns[0].Visible = false;
                }
                if (NewShowAll_textName("公交卡充值/使用记录", "删除") == false)
                {
                    gvCardNOUse.Columns[1].Visible      = false;
                    gvCardRecordList.Columns[1].Visible = false;
                }
                #endregion

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                gvDiXiao.DataSource = new List <SupplierToInvoiceView>();
                gvDiXiao.DataBind();

                var fpTypeBaseInfoService           = new FpTypeBaseInfoService();
                List <FpTypeBaseInfo> gooQGooddList = fpTypeBaseInfoService.GetListArray("");
                gooQGooddList.Insert(0, new FpTypeBaseInfo {
                    Id = -1, FpType = "全部"
                });
                gooQGooddList.Add(new FpTypeBaseInfo {
                    Id = -2, FpType = "不含税"
                });
                dllFPstye.DataSource = gooQGooddList;
                dllFPstye.DataBind();
                dllFPstye.DataTextField  = "FpType";
                dllFPstye.DataValueField = "Id";

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='查看所有'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='支付单列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                if (QuanXian_ShowAll("支付单列表") == false)
                {
                    ViewState["showAll"] = false;
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }
                else
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='不能编辑'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='支付单列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("支付单列表", "不能编辑") == false)
                {
                    gvMain.Columns[0].Visible = false;
                }
                var             sql        = @"select CreateName from (
select CreateName from TB_SupplierAdvancePayment
union 
select CreateName from TB_SupplierInvoice) AS TB WHERE CreateName<>'ADMIN' ORDER BY CreateName ";
                List <ListItem> createList = new List <ListItem>();
                createList.Add(new ListItem {
                    Text = "全部", Value = "全部"
                });
                createList.Add(new ListItem {
                    Text = "不含Admin", Value = "不含Admin"
                });
                foreach (DataRow dr in DBHelp.getDataTable(sql).Rows)
                {
                    createList.Add(new ListItem {
                        Text = dr[0].ToString(), Value = dr[0].ToString()
                    });
                }
                ddlCreateName.DataSource = createList;
                ddlCreateName.DataBind();

                if (Request["Ids"] != null)
                {
                    ddlStatue.Text = "通过";
                    ddlType.Text   = "0";
                    Show();
                }
                else
                {
                    if (Request["PayIds"] != null)
                    {
                        ddlStatue.Text = "通过";
                        ddlType.Text   = "1";
                        Show();
                    }
                    else
                    {
                        //主单
                        List <SupplierToInvoiceView> pOOrderList = new List <SupplierToInvoiceView>();
                        this.gvMain.DataSource = pOOrderList;
                        this.gvMain.DataBind();
                    }
                }
            }
        }
Exemple #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                var user    = new List <Model.User>();
                var userSer = new Dal.SysUserService();
                if (QuanXian_ShowAll("预期报销单列表") == false)
                {
                    ViewState["showAll"] = false;
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }
                else
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }

                if (!NewShowAll_textName("预期报销单列表", "编辑"))
                {
                    gvList.Columns[0].Visible = false;
                }

                if (!NewShowAll_textName("预期报销单列表", "编辑发票号"))
                {
                    gvList.Columns[1].Visible = false; btnExcel.Visible = false;
                }
                else
                {
                    btnExcel.Visible = true;
                }
                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                var dispatchList = new List <Tb_DispatchList>();
                gvList.DataSource = dispatchList;
                gvList.DataBind();

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";
            }
        }
Exemple #9
0
        private void Show()
        {
            GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();

            GetListArray  = dal.GetListArray("");
            allGuestTypes = GetListArray.Select(t => t.GuestType).ToList();


            GuestProBaseInfoService guestProDal = new GuestProBaseInfoService();

            GetGuestProListArray = guestProDal.GetListArray("");
            allGuestPros         = GetGuestProListArray.Select(t => t.GuestPro.ToString()).ToList();

            string sql = " 1=1 ";

            QuerySession.QueryGuestTrack QGuestTrack = new VAN_OA.QuerySession.QueryGuestTrack();
            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('登记日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and Time>='{0} 00:00:00'", txtFrom.Text);
                QGuestTrack.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 Time<='{0} 23:59:59'", txtTo.Text);
                QGuestTrack.ToTime = txtTo.Text;
            }

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


            if (ddlAE.Text != "" && ddlAE.Text != "0")
            {
                sql += string.Format(" and AE={0}", ddlAE.SelectedItem.Value);
                //QGuestTrack.Apper = txtLoginName.Text;
            }

            if (ddlINSIDE.Text != "" && ddlINSIDE.Text != "0")
            {
                sql += string.Format(" and INSIDE={0}", ddlINSIDE.SelectedItem.Value);
                //QGuestTrack.Apper = txtLoginName.Text;
            }


            if (txtProNo.Text.Trim() != "")
            {
                if (CheckProNo(txtProNo.Text) == false)
                {
                    return;
                }
                sql += string.Format(" and ProNo like '%{0}%'", txtProNo.Text.Trim());
            }
            if (ddlJidu.Text != "")
            {
                sql += string.Format(" and QuartNo='{1}' and YearNo='{0}' ", ddlSelectYears.Text, ddlJidu.Text);
            }
            if (ddlSpecial.Text != "-1")
            {
                sql += string.Format(" and IsSpecial ={0}", ddlSpecial.Text);
            }
            if (ddlGuestTypeList.Text != "-1")
            {
                sql += string.Format(" and MyGuestType ='{0}'", ddlGuestTypeList.Text);
            }
            if (ddlGuestProList.Text != "-1")
            {
                sql += string.Format(" and MyGuestPro like '%{0}%'", ddlGuestProList.Text);
            }
            if (txtPhone.Text != "")
            {
                sql += string.Format(" and Phone like '%{0}%'", txtPhone.Text);
            }
            if (txtLikeMan.Text != "")
            {
                sql += string.Format(" and LikeMan like '%{0}%'", txtLikeMan.Text);
            }
            sql += string.Format(@" and (TB_GuestTrack.id in (select allE_id from tb_EForm where proId in (
select pro_Id from A_ProInfo where pro_Type='客户联系跟踪表') and state='通过') or TB_GuestTrack.id not in (select allE_id from tb_EForm where proId in (
select pro_Id from A_ProInfo where pro_Type='客户联系跟踪表') ))");

            List <TB_GuestTrack> GuestTracks = this.GuestTrackSer.GetListArrayGuilei(sql, dllAddGuest.Text, ddlDiffMyGuestType.Text, dllDiffMyGuestPro.Text,
                                                                                     ddlSelectYears.Text, ddlJidu.Text);

            AspNetPager1.RecordCount = GuestTracks.Count;
            this.gvList.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            Session[Query]           = QGuestTrack;
            this.gvList.DataSource   = GuestTracks;
            this.gvList.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                List <CashFlowReport> poseModels = new List <CashFlowReport>();
                this.gvList.DataSource = poseModels;
                this.gvList.DataBind();

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                user = userSer.getAllUserByPOList();
                user.Insert(0, new VAN_OA.Model.User()
                {
                    LoginName = "全部", Id = -1
                });

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";
                if (Request["PONo"] != null)
                {
                    txtPONO.Text = Request["PONo"].ToString();
                    Show();
                }
            }
        }
Exemple #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                int month = DateTime.Now.Month;
                int year  = DateTime.Now.Year;

                List <ListItem> allYears = new List <ListItem>();
                allYears.Add(new ListItem {
                    Text = (2011).ToString(), Value = (2011).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2012).ToString(), Value = (2012).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2013).ToString(), Value = (2013).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2014).ToString(), Value = (2014).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2015).ToString(), Value = (2015).ToString()
                });

                allYears.Add(new ListItem {
                    Text = (2016).ToString(), Value = (2016).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2017).ToString(), Value = (2017).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2018).ToString(), Value = (2018).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2019).ToString(), Value = (2019).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2020).ToString(), Value = (2020).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2021).ToString(), Value = (2021).ToString()
                });
                allYears.Add(new ListItem {
                    Text = (2022).ToString(), Value = (2022).ToString()
                });



                ddlSelectYears.DataSource = allYears;
                ddlSelectYears.DataBind();
                ddlSelectYears.SelectedValue = year.ToString();



                if (1 <= month && month <= 3)
                {
                    ddlJidu.Text = "1";
                }
                else if (4 <= month && month <= 6)
                {
                    ddlJidu.Text = "2";
                }
                else if (7 <= month && month <= 9)
                {
                    ddlJidu.Text = "3";
                }
                else if (10 <= month && month <= 12)
                {
                    ddlJidu.Text = "4";
                }



                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                List <VAN_OA.Model.User>  user    = userSer.getAllUserByLoginName("");
                user.Insert(0, new VAN_OA.Model.User());

                ddlAE.DataSource = user;
                ddlAE.DataBind();
                ddlAE.DataTextField  = "LoginName";
                ddlAE.DataValueField = "Id";

                ddlINSIDE.DataSource = user;
                ddlINSIDE.DataBind();
                ddlINSIDE.DataTextField  = "LoginName";
                ddlINSIDE.DataValueField = "Id";


                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                ddlGuestTypeList.DataSource = dal.GetListArray("");
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";
                ddlGuestTypeList.Items.Insert(0, new ListItem {
                    Text = "全部", Value = "-1"
                });

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();

                ddlGuestProList.DataSource = guestProBaseInfodal.GetListArray("");
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";
                ddlGuestProList.Items.Insert(0, new ListItem {
                    Text = "全部", Value = "-1"
                });

                WebQuerySessin Sess = new WebQuerySessin(Query);
                //加载SESSION中的数据
                if (Session[Query] != null)
                {
                    //QueryEForms
                    QuerySession.QueryGuestTrack QGuestTrack = Session[Query] as QuerySession.QueryGuestTrack;
                    if (QGuestTrack == null)
                    {
                        return;
                    }

                    if (QGuestTrack.FromTime != "")
                    {
                        txtFrom.Text = QGuestTrack.FromTime;
                    }

                    if (QGuestTrack.ToTime != "")
                    {
                        txtTo.Text = QGuestTrack.ToTime;
                    }

                    if (QGuestTrack.GuestName != "")
                    {
                        txtGuestName.Text = QGuestTrack.GuestName;
                    }

                    //if (QGuestTrack.Apper != "")
                    //{
                    //     txtLoginName.Text = QGuestTrack.Apper;
                    //}



                    Show();
                }
                else
                {
                    List <TB_GuestTrack> TB_GuestTracks = new List <TB_GuestTrack>();
                    this.gvList.DataSource = TB_GuestTracks;
                    this.gvList.DataBind();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                List <CashFlow> poseModels = new List <CashFlow>();
                this.gvList.DataSource = poseModels;
                this.gvList.DataBind();

                bool showAll = true;
                if (QuanXian_ShowAll("现金流考核") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }
                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("现金流考核", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }
                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }


                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";
                if (Request["PONo"] != null)
                {
                    txtPONO.Text = Request["PONo"].ToString();
                    Show();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComCode = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                //主单
                var pOOrderList = new List <CG_POOrderService>();
                gvMain.DataSource = pOOrderList;
                gvMain.DataBind();

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='自动选中-可选中'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='项目结算') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) > 0)
                if (NewShowAll_textName("项目结算", "自动选中-可选中") == false)
                {
                    btnSelect.Visible = false;
                }
                //                sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='自动选中-可取消'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='项目结算') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) > 0)
                if (NewShowAll_textName("项目结算", "自动选中-可取消") == false)
                {
                    btnCancel.Visible = false;
                }
                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                user = userSer.getAllUserByPOList();
                user.Insert(0, new VAN_OA.Model.User()
                {
                    LoginName = "全部", Id = -1
                });
                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";
            }
        }
        private void Show()
        {
            ddlFPType.Items[ddlFPType.Items.Count - 2].Attributes.Add("style", "background-color: red");

            _basePoTypeList = new TB_BasePoTypeService().GetListArray("");
            _basePoTypeList.Insert(0, new TB_BasePoType {
                BasePoType = "", Id = -1
            });

            _modelList = modelService.GetListArray("");
            _modelList.Insert(0, new TB_Model {
                Id = -1, ModelName = ""
            });


            _guestTypeList = dal.GetListArray("");
            _guestTypeList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                GuestType = ""
            });


            _guestProList = guestProBaseInfodal.GetListArray("");
            _guestProList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                GuestPro = -1
            });

            var fpTypeBaseInfoService = new FpTypeBaseInfoService();

            gooQGooddList = fpTypeBaseInfoService.GetListArray("");
            gooQGooddList.Add(new FpTypeBaseInfo {
                FpType = ""
            });
            allFpTypes = gooQGooddList.Select(t => t.FpType).ToList();
            var sql = "";

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

            if (txtPlanDayForm.Text != "")
            {
                if (CommHelp.VerifesToNum(txtPlanDayForm.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('计划完工天数 格式错误!');</script>");
                    return;
                }

                sql += string.Format(" and {1}{0}PlanDays", ddlPlanDayForm.Text, txtPlanDayForm.Text);
            }

            if (txtPlanDayTo.Text != "")
            {
                if (CommHelp.VerifesToNum(txtPlanDayTo.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('计划完工天数 格式错误!');</script>");
                    return;
                }

                sql += string.Format(" and PlanDays{0}{1}", ddlPlanDayTo.Text, txtPlanDayTo.Text);
            }

            if (txtFrom.Text != "")
            {
                if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目日期 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and 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 PODate<='{0} 23:59:59'", txtTo.Text);
            }

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

            if (ddlUser.Text != "-1")
            {
                var strSql = new System.Text.StringBuilder();
                int month  = DateTime.Now.Month;
                int year   = DateTime.Now.Year;
                if (1 <= month && month <= 3)
                {
                    strSql.Append(string.Format(" and QuartNo='1' and YearNo='{0}' ", year));
                }
                else if (4 <= month && month <= 6)
                {
                    strSql.Append(string.Format(" and QuartNo='2' and YearNo='{0}' ", year));
                }
                else if (7 <= month && month <= 9)
                {
                    strSql.Append(string.Format(" and QuartNo='3' and YearNo='{0}' ", year));
                }
                else if (10 <= month && month <= 12)
                {
                    strSql.Append(string.Format(" and QuartNo='4' and YearNo='{0}' ", year));
                }
                // sql += string.Format(" and AppName={0}", ddlUser.Text);
                sql += string.Format(" and AE='{0}'", ddlUser.SelectedItem.Text);
            }
            if (ddlCompany.Text != "-1")
            {
                string where = string.Format(" CompanyCode='{0}'", ddlCompany.Text.Split(',')[2]);
                sql         += string.Format(" and AE IN(select loginName from tb_User where {0})", where);
            }

            if (ddlSpecial.Text != "-1")
            {
                sql += string.Format(" and IsSpecial={0}", ddlSpecial.Text);
            }
            if (ddlNoSelected.Text != "-1")
            {
                sql += string.Format(" and IsSelected=" + ddlNoSelected.Text);
            }
            if (ddlJieIsSelected.Text != "-1")
            {
                sql += string.Format(" and JieIsSelected=" + ddlJieIsSelected.Text);
            }
            if (ddlColse.Text != "-1")
            {
                sql += string.Format(" and IsClose={0}", ddlColse.Text);
            }

            if (ddlIsPoFax.Text != "-1")
            {
                sql += string.Format(" and IsPoFax={0}", ddlIsPoFax.Text);

                if (ddlIsPoFax.Text == "1" && dllFPstye.Text != "-1")
                {
                    sql += string.Format(" and FpType='" + dllFPstye.SelectedItem.Text + "'");
                }
            }
            if (ddlPOTyle.Text != "-1")
            {
                sql += string.Format(" and POType=" + ddlPOTyle.Text);
            }
            if (ddlJiLiang.Text != "-1")
            {
                sql += string.Format(" and ChengBenJiLiang=" + ddlJiLiang.Text);
            }


            if (ddlModel.Text != "全部")
            {
                sql += string.Format(" and Model='{0}'", ddlModel.Text);
            }

            if (!string.IsNullOrEmpty(txtPoTotal.Text))
            {
                if (CommHelp.VerifesToNum(txtPoTotal.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and SumPOTotal{0}{1}", ddlFuHao.Text, txtPoTotal.Text);
            }

            if (!string.IsNullOrEmpty(txtGuestName.Text.Trim()))
            {
                sql += string.Format(" and GuestName like '%{0}%'", txtGuestName.Text.Trim());
            }
            if (ddlFPType.Text != "-1")
            {
                if (ddlFPType.SelectedItem.Text != "其他")
                {
                    sql += string.Format(" and FPType='{0}'", ddlFPType.SelectedItem.Text);
                }
                else
                {
                    sql += string.Format(" and FPType not in (select FpType from FpTypeBaseInfo) and FPType<>''");
                }
            }
            if (txtEque1.Text != "")
            {
                if (CommHelp.VerifesToNum(txtEque1.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and {1}{0}SumPOTotal", ddlEque1.Text, txtEque1.Text);
            }
            if (txtEque2.Text != "")
            {
                if (CommHelp.VerifesToNum(txtEque2.Text) == false)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('项目金额 格式错误!');</script>");
                    return;
                }
                sql += string.Format(" and SumPOTotal{0}{1}", ddlEque2.Text, txtEque2.Text);
            }

            if (ddlGuestTypeList.SelectedValue != "全部")
            {
                sql += string.Format(" and GuestType='{0}'", ddlGuestTypeList.SelectedValue);
            }
            if (ddlGuestProList.SelectedValue != "-2")
            {
                if (ddlGuestProList.SelectedValue == "-1")
                {
                    sql += string.Format(" and GuestPro not in (0,1,2)");
                }
                else
                {
                    sql += string.Format(" and GuestPro={0}", ddlGuestProList.SelectedValue);
                }
            }

            var dt = this.POSer.SetPoSpecial(sql);

            //foreach (DataRow dr in dt.Rows)
            //{
            //    if (ViewState["isCloseEdist"] != null)
            //        dr["isCloseEdist"] = false;
            //    else
            //    {
            //        dr["isCloseEdist"] = true;
            //    }

            //}
            AspNetPager1.RecordCount = dt.Rows.Count;
            this.gvMain.PageIndex    = AspNetPager1.CurrentPageIndex - 1;
            this.gvMain.DataSource   = dt;
            this.gvMain.DataBind();
        }
Exemple #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                List <TB_ToInvoice> poseModels = new List <TB_ToInvoice>();
                this.gvList.DataSource = poseModels;
                this.gvList.DataBind();

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='查看所有'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='到款单列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) > 0)
                if (NewShowAll_textName("到款单列表", "查看所有") == false)
                {
                    ViewState["showAll"] = false;
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }
                else
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }

                //                sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='不能编辑'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='到款单列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("到款单列表", "不能编辑") == false)
                {
                    gvList.Columns[0].Visible = false;
                }

                if (NewShowAll_textName("到款单列表", "删除") == false)
                {
                    gvList.Columns[1].Visible = false;
                }


                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";


                if (Request["ishebing"] != null)
                {
                    cbPOHeBing.Checked = true;
                }
                if (Request["PONo"] != null)
                {
                    txtPONO.Text      = Request["PONo"].ToString();
                    ddlNoSpecial.Text = "-1";
                    Show();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();
                //主单
                List <Sell_OrderFP> pOOrderList = new List <Sell_OrderFP>();
                this.gvMain.DataSource = pOOrderList;
                this.gvMain.DataBind();

                //子单
                List <Sell_OrderFPs> orders = new List <Sell_OrderFPs>();
                gvList.DataSource = orders;
                gvList.DataBind();

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='查看所有'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='销售发票列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                if (QuanXian_ShowAll("销售发票列表") == false)
                {
                    ViewState["showAll"] = false;
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }
                else
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='不能编辑'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='销售发票列表') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("销售发票列表", "不能编辑") == false)
                {
                    gvMain.Columns[0].Visible = false;
                }
                if (NewShowAll_textName("销售发票列表", "删除") == false)
                {
                    gvMain.Columns[2].Visible = false;
                }
                //if (VAN_OA.JXC.SysObj.IfShowAll(SysObj.Sell_OrderPFList, Session["currentUserId"]) == false)
                //{
                //    ViewState["showAll"] = false;
                //}
                var fpTypeBaseInfoService        = new FpTypeBaseInfoService();
                List <FpTypeBaseInfo> fpTypeList = fpTypeBaseInfoService.GetListArray("");
                fpTypeList.Insert(0, new FpTypeBaseInfo {
                    FpType = "全部", Id = -1
                });
                fpTypeList.Add(new FpTypeBaseInfo {
                    Id = 999, FpType = ""
                });
                fpTypeList.Add(new FpTypeBaseInfo {
                    Id = 1000, FpType = "其他"
                });
                ddlFPType.DataSource = fpTypeList;
                ddlFPType.DataBind();
                ddlFPType.DataTextField  = "FpType";
                ddlFPType.DataValueField = "Id";
                ddlFPType.Items[fpTypeList.Count - 2].Attributes.Add("style", "background-color: red");

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();
                    if (Request["Type"] != null)
                    {
                        ddlType.Text = Request["Type"].ToString();
                    }
                    Show();
                }

                if (Request["InvoiceNo"] != null)
                {
                    txtFPNo.Text = Request["InvoiceNo"].ToString();
                    Show();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";



                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";



                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComCode += "," + m.ComSimpName;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComCode = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();


                bool showAll = true;
                if (QuanXian_ShowAll("商业BI图表") == false)
                {
                    ViewState["showAll"] = false;
                    showAll            = false;
                    ddlCompany.Enabled = false;
                }



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("商业BI图表", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";


                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                for (var i = 2012; i <= DateTime.Now.Year; i++)
                {
                    ddlYear.Items.Add(new ListItem {
                        Value = i.ToString(), Text = i.ToString()
                    });

                    ddlNextYear.Items.Add(new ListItem {
                        Value = i.ToString(), Text = i.ToString()
                    });
                }
                ddlYear.SelectedValue = DateTime.Now.Year.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                List <TB_BasePoType> basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";

                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                //主单
                List <JXC_REPORTTotal> pOOrderList = new List <JXC_REPORTTotal>();
                this.gvMain.DataSource = pOOrderList;
                this.gvMain.DataBind();



                bool showAll = true;
                if (QuanXian_ShowAll("工程技术派工统计报表") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("工程技术派工统计报表", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='可导出'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='销售报表汇总') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("工程技术派工统计报表", "可导出"))
                {
                    btnExcel.Visible = true;
                }
                else
                {
                    btnExcel.Visible = false;
                }

                if (!NewShowAll_textName("工程技术派工统计报表", "编辑"))
                {
                    gvMain.Columns[0].Visible = false;
                }

                string sql = string.Format("select loginName,ID from tb_User where loginIPosition='技术部' AND loginStatus='在职' and loginName<>'';");

                List <User> getUsers = userSer.getUserReportTos(sql);
                getUsers = getUsers.FindAll(T => string.IsNullOrEmpty(T.LoginName) == false);
                getUsers.Insert(0, new Model.User {
                    Id = -1, LoginName = "全部"
                });
                getUsers.Add(new User {
                    Id = -1000, LoginName = "其他"
                });
                ddlPaiGong.DataSource = getUsers;
                ddlPaiGong.DataBind();

                ddlPaiGong.DataTextField  = "LoginName";
                ddlPaiGong.DataValueField = "Id";

                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();

                    ddlIsSpecial.Text = "-1";
                    Show();
                }
            }
        }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TB_ModelService modelService = new TB_ModelService();
                var             _modelList   = modelService.GetListArray("");
                _modelList.Insert(0, new TB_Model {
                    Id = -1, ModelName = "全部"
                });
                ddlModel.DataSource = _modelList;
                ddlModel.DataBind();
                ddlModel.DataTextField  = "ModelName";
                ddlModel.DataValueField = "ModelName";

                TB_CompanyService comSer = new TB_CompanyService();
                var comList = comSer.GetListArray("");
                foreach (var m in comList)
                {
                    m.ComSimpName += "," + m.Id + "," + m.ComCode;
                }
                comList.Insert(0, new VAN_OA.Model.BaseInfo.TB_Company()
                {
                    ComSimpName = "-1", ComName = "全部"
                });
                ddlCompany.DataSource = comList;
                ddlCompany.DataBind();

                //txtStartTime.Text = (DateTime.Now.Year - 1) + "-1-1";

                txtStartTime.Text = DateTime.Now.AddYears(-1).AddDays(-150).ToString("yyyy-MM-dd");
                List <TB_BasePoType> basePoTypeList  = new TB_BasePoTypeService().GetListArray("");
                List <TB_BasePoType> basePoTypeList1 = new TB_BasePoTypeService().GetListArray("");
                cbKaoList.DataSource = basePoTypeList1;
                cbKaoList.DataBind();
                cbKaoList.DataTextField  = "BasePoType";
                cbKaoList.DataValueField = "Id";

                basePoTypeList.Insert(0, new TB_BasePoType {
                    BasePoType = "全部", Id = -1
                });
                ddlPOTyle.DataSource = basePoTypeList;
                ddlPOTyle.DataBind();
                ddlPOTyle.DataTextField  = "BasePoType";
                ddlPOTyle.DataValueField = "Id";



                GuestTypeBaseInfoService dal = new GuestTypeBaseInfoService();
                var dalList = dal.GetListArray("");
                dalList.Insert(0, new VAN_OA.Model.BaseInfo.GuestTypeBaseInfo {
                    GuestType = "全部"
                });
                ddlGuestTypeList.DataSource = dalList;
                ddlGuestTypeList.DataBind();
                ddlGuestTypeList.DataTextField  = "GuestType";
                ddlGuestTypeList.DataValueField = "GuestType";

                GuestProBaseInfoService guestProBaseInfodal = new GuestProBaseInfoService();
                var proList = guestProBaseInfodal.GetListArray("");
                proList.Insert(0, new VAN_OA.Model.BaseInfo.GuestProBaseInfo {
                    GuestPro = -2
                });
                ddlGuestProList.DataSource = proList;
                ddlGuestProList.DataBind();
                ddlGuestProList.DataTextField  = "GuestProString";
                ddlGuestProList.DataValueField = "GuestPro";

                //主单
                List <JXC_REPORTTotal> pOOrderList = new List <JXC_REPORTTotal>();
                this.gvMain.DataSource = pOOrderList;
                this.gvMain.DataBind();

                //if (VAN_OA.JXC.SysObj.IfShowAll(SysObj.JXC_REPORTTotalList, Session["currentUserId"]) == false)
                //{
                //    ViewState["showAll"] = false;
                //}


                bool showAll = true;
                if (QuanXian_ShowAll("销售业绩帐期考核") == false)
                {
                    ViewState["showAll"] = false;
                    showAll = false;
                }



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll("销售业绩帐期考核", Session["currentUserId"], "WFScanDepartList") == true)
                {
                    ViewState["WFScanDepartList"] = false;
                    WFScanDepartList = false;
                }

                List <VAN_OA.Model.User>  user    = new List <VAN_OA.Model.User>();
                VAN_OA.Dal.SysUserService userSer = new VAN_OA.Dal.SysUserService();
                if (showAll == true)
                {
                    user = userSer.getAllUserByPOList();
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = -1
                    });
                }
                else if (WFScanDepartList == true)
                {
                    user = userSer.getAllUserByLoginName(string.Format(" and loginIPosition in (select loginIPosition from tb_User where id={0}) and loginIPosition<>''", Session["currentUserId"]));
                    user.Insert(0, new VAN_OA.Model.User()
                    {
                        LoginName = "全部", Id = 0
                    });
                }
                else
                {
                    var model = Session["userInfo"] as User;
                    user.Insert(0, model);
                }

                ddlUser.DataSource = user;
                ddlUser.DataBind();
                ddlUser.DataTextField  = "LoginName";
                ddlUser.DataValueField = "Id";

                //                string sql = string.Format(@"select COUNT(*) from role_sys_form left join sys_Object on sys_Object.FormID=role_sys_form.sys_form_Id and sys_Object.roleId=role_sys_form.role_Id and textName='可导出'
                //where  role_Id in (select roleId from Role_User where userId={0}) and sys_form_Id in(select formID from sys_form where displayName='销售报表汇总') and sys_Object.AutoID is not null", Session["currentUserId"]);
                //                if (Convert.ToInt32(DBHelp.ExeScalar(sql)) <= 0)
                if (NewShowAll_textName("销售业绩帐期考核", "可导出"))
                {
                    btnExcel.Visible = true;
                }
                else
                {
                    btnExcel.Visible = false;
                }

                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();
                    Show();
                }

                TB_ProjectCostService _projectCostService = new TB_ProjectCostService();
                var projectCosts = _projectCostService.GetListArray("");
                if (projectCosts.Count > 0)
                {
                    var model = projectCosts[0];
                    txtZhangQi.Text    = model.ZhangQi.ToString();
                    txtCeSuanDian.Text = model.CeSuanDian.ToString();
                    txtMonthLiLv.Text  = model.MonthLiLv.ToString();
                }



                List <TB_BasePoType> new_basePoTypeList = new TB_BasePoTypeService().GetListArray("");
                cbListPoType.DataSource = new_basePoTypeList;
                cbListPoType.DataBind();
                cbListPoType.DataTextField  = "BasePoType";
                cbListPoType.DataValueField = "Id";
            }
        }