Esempio n. 1
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();

                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();
                }
            }
        }
Esempio n. 2
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 (!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();
            }
        }
Esempio n. 5
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();
                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";

                TB_GoodsTypeService typeSer = new TB_GoodsTypeService();
                List <TB_GoodsType> allType = typeSer.GetListArray("");
                allType.Insert(0, new TB_GoodsType());
                ddlGoodType.DataSource = allType;
                ddlGoodType.DataBind();
                ddlGoodType.DataTextField  = "GoodTypeName";
                ddlGoodType.DataValueField = "GoodTypeName";


                TB_GoodsSmTypeService goodsSmTypeSer  = new TB_GoodsSmTypeService();
                List <TB_GoodsSmType> goodsSmTypeList = goodsSmTypeSer.GetListArrayToddl("");
                goodsSmTypeList.Insert(0, new TB_GoodsSmType());
                ddlGoodSmType.DataSource = goodsSmTypeList;
                ddlGoodSmType.DataBind();
                ddlGoodSmType.DataTextField  = "GoodTypeSmName";
                ddlGoodSmType.DataValueField = "GoodTypeSmName";


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


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



                bool WFScanDepartList = true;
                if (showAll == false && VAN_OA.JXC.SysObj.IfShowAll(SysObj.JXC_REPORTList, 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["IsSpecial"] != null)
                {
                    ddlIsSpecial.Text = Request["IsSpecial"].ToString();
                }
                if (Request["PONo"] != null)
                {
                    txtPONo.Text = Request["PONo"].ToString();
                    Show();
                }
            }
        }
Esempio n. 6
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();
                }
            }
        }
Esempio n. 7
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";

                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();
                }
            }
        }
        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";
            }
        }
Esempio n. 10
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";
            }
        }