Exemple #1
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 (!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 #3
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";



                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();
            }
        }
Exemple #5
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 #6
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 #7
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 (!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";

                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();
                }
            }
        }
Exemple #10
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();
                }
            }
        }
Exemple #11
0
        public string DoGuestJob(DateTime date)
        {
            var content      = "开始-客户联系跟踪表";
            int currentYear  = date.Year;
            int currentMonth = date.Month;

            int nextYear  = date.AddMonths(1).Year;
            int nextMonth = date.AddMonths(1).Month;

            int currentZhangQi = GetZhouQi(currentMonth);
            int nextZhangQi    = GetZhouQi(nextMonth);
            //if (currentZhangQi == nextZhangQi && currentYear == nextYear)
            //{
            //    return;
            //}
            List <GuestProBaseInfo> guestProBaseInfos = new GuestProBaseInfoService().GetListArray("GuestPro=1");

            TB_GuestTrackService GuestTrackSer = new TB_GuestTrackService();
            string sql = string.Format(" 1=1 and QuartNo='{1}' and YearNo='{0}'", currentYear, currentZhangQi);

            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 = GuestTrackSer.GetListArray(sql);

            using (SqlConnection conn = DBHelp.getConn())
            {
                conn.Open();
                SqlTransaction tan        = conn.BeginTransaction();
                SqlCommand     objCommand = conn.CreateCommand();
                objCommand.Transaction = tan;

                try
                {
                    objCommand.Parameters.Clear();
                    foreach (var model in GuestTracks)
                    {
                        //客户属性 每个季度需要复制到下一季度,但有一个是需要 特别关注的,就是每年的四季度 如果某个客户的客户属性是 自我开拓,
                        //来年的一季度,这个客户的客户属性 必须变成 原有资源!!!
                        //if (currentZhangQi == 4)
                        //{
                        //    if (model.MyGuestProString == "自我开拓")
                        //    {
                        //        model.MyGuestPro = 2;
                        //    }
                        //}

                        model.QuartNo    = nextZhangQi.ToString();
                        model.YearNo     = nextYear.ToString();
                        model.CreateTime = date;


                        string secondUpdate = GuestTrackSer.UpdateToString(model, model.GuestId, nextYear.ToString(), nextZhangQi.ToString());
                        if (model.MyGuestProString == "自我开拓")
                        {
                            //我们的系统在每个季度的最后一天的晚上12点会自动同步客户信息到下一个季度,我们定义
                            //.  如该客户目前的属性是自我开拓,该客户从登记之日起,加上自我开拓的有效期月数数字对应的日期,
                            //如小于(<) 新季度第一天,新季度的客户的属性变成 原有资源,否则 还是自我开拓
                            if (date.Month == 3 || date.Month == 6 || date.Month == 9 || date.Month == 12)
                            {
                                if (date.Day == DateTime.DaysInMonth(date.Year, date.Month) &&
                                    model.Time.AddMonths(guestProBaseInfos[0].GuestMonth) < Convert.ToDateTime(nextYear + "-" + nextMonth + "-01"))
                                {
                                    model.MyGuestPro = 2;
                                }
                            }
                        }
                        string update = GuestTrackSer.AddToString(model);

                        string updateSql = string.Format("if not exists(select id from TB_GuestTrack where guestId='{0}' and yearNo='{1}' and QuartNo='{2}')begin {3} end else begin {4} end",
                                                         model.GuestId, nextYear.ToString(), nextZhangQi.ToString(), update, secondUpdate);
                        objCommand.CommandText = updateSql;
                        objCommand.ExecuteNonQuery();
                    }

                    tan.Commit();

                    new JobInfoService().Add(new JobInfo
                    {
                        JobTime = date,
                        JobType = 1
                    });
                    content += "结束-客户联系跟踪表";
                    //ServiceAppSetting.LoggerHander.Invoke(string.Format("执行成功! - {0}", DateTime.Now), "");
                }
                catch (Exception)
                {
                    tan.Rollback();
                    content += "【异常】账期执行失败";
                    //ServiceAppSetting.LoggerHander.Invoke(string.Format("账期执行失败! - {0}", DateTime.Now), "Error");
                }
            }
            _logger.InfoFormat(content);
            return(content);
        }
        protected void btnCopy_Click(object sender, EventArgs e)
        {
            if (ddlYears.Text + ddlOrl.Text == ddlNextYears.Text + ddlBar.Text)
            {
                base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('原季度不能等于目标季度!');</script>");
                return;
            }
            List <GuestProBaseInfo> guestProBaseInfos = new GuestProBaseInfoService().GetListArray("GuestPro=1");
            string sql = string.Format(" 1=1 and QuartNo='{1}' and YearNo='{0}' ", ddlYears.Text, ddlOrl.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.GetListArray(sql);

            using (SqlConnection conn = DBHelp.getConn())
            {
                conn.Open();
                SqlTransaction tan        = conn.BeginTransaction();
                SqlCommand     objCommand = conn.CreateCommand();
                objCommand.Transaction = tan;

                try
                {
                    objCommand.Parameters.Clear();
                    foreach (var model in GuestTracks)
                    {
                        //客户属性 每个季度需要复制到下一季度,但有一个是需要 特别关注的,就是每年的四季度 如果某个客户的客户属性是 自我开拓,
                        //来年的一季度,这个客户的客户属性 必须变成 原有资源!!!
                        //if (ddlOrl.Text == "4"&& ddlBar.Text=="1")
                        //{
                        //    if (model.MyGuestProString == "自我开拓")
                        //    {
                        //        model.MyGuestPro = 2;
                        //    }
                        //}
                        model.QuartNo = ddlBar.Text;
                        model.YearNo  = ddlNextYears.Text;

                        string update = GuestTrackSer.UpdateToString(model, model.GuestId, ddlNextYears.Text, ddlBar.Text);
                        if (model.MyGuestProString == "自我开拓")
                        {
                            //我们的系统在每个季度的最后一天的晚上12点会自动同步客户信息到下一个季度,我们定义
                            //.  如该客户目前的属性是自我开拓,该客户从登记之日起,加上自我开拓的有效期月数数字对应的日期,
                            //如小于(<) 新季度第一天,新季度的客户的属性变成 原有资源,否则 还是自我开拓
                            if (DateTime.Now.Month == 3 || DateTime.Now.Month == 6 || DateTime.Now.Month == 9 || DateTime.Now.Month == 12)
                            {
                                if (DateTime.Now.Day == DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) &&
                                    model.Time.AddMonths(guestProBaseInfos[0].GuestMonth) < Convert.ToDateTime(ddlNextYears.Text + "-" + ddlBar.Text + "-01"))
                                {
                                    model.MyGuestPro = 2;
                                }
                            }
                        }
                        string add = GuestTrackSer.AddToString(model);

                        string updateSql =
                            string.Format(
                                "if not exists(select id from TB_GuestTrack where guestId='{0}' and yearNo='{1}' and QuartNo='{2}') begin {3} end else begin {4} end ",
                                model.GuestId, ddlNextYears.Text, ddlBar.Text, add, update);
                        objCommand.CommandText = updateSql;
                        objCommand.ExecuteNonQuery();
                    }

                    tan.Commit();
                }
                catch (Exception)
                {
                    tan.Rollback();

                    base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('复制失败!');</script>");
                }
            }
            base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('复制成功!');</script>");
        }
        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";
            }
        }
Exemple #14
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 #15
0
        public void Execute()
        {
            //OA系统每天晚上23:55,准时发起,一个任务,就是点击缓存按钮的动作,这样我们可以获得 当天的数据的快速列表印象。
            if (DateTime.Now.Hour == 22 && DateTime.Now.Minute == 00)
            {
                ServiceAppSetting.LoggerHander.Invoke(string.Format("执行-缓存! - {0}", DateTime.Now), "");
                new JXC_REPORTService().CatchData();
                ServiceAppSetting.LoggerHander.Invoke(string.Format("结束-缓存! - {0}", DateTime.Now), "");
            }
            ServiceAppSetting.LoggerHander.Invoke(string.Format("do! {0}", DateTime.Now), "");
            //每天早上1,2,3点处理最高值
            if ((DateTime.Now.Hour == 1 || DateTime.Now.Hour == 2 || DateTime.Now.Hour == 3) && DateTime.Now.Minute == 0)
            {
                ServiceAppSetting.LoggerHander.Invoke(string.Format("执行-最高金额! - {0}", DateTime.Now), "");
                CashFlowService cashFlowService = new CashFlowService();
                List <CashFlow> cashFlowList    = cashFlowService.GetListArray(" AND IsClose=0");

                using (SqlConnection conn = DBHelp.getConn())
                {
                    conn.Open();
                    SqlCommand objCommand = conn.CreateCommand();
                    try
                    {
                        objCommand.Parameters.Clear();
                        foreach (var model in cashFlowList)
                        {
                            cashFlowService.Update(model, objCommand);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                ServiceAppSetting.LoggerHander.Invoke(string.Format("结束-最高金额! - {0}", DateTime.Now), "");
            }
            if (DateTime.Now.Hour == 23 && DateTime.Now.Minute <= 5)
            {
                ServiceAppSetting.LoggerHander.Invoke(string.Format("执行一次! - {0}", DateTime.Now), "");
                int currentYear  = DateTime.Now.Year;
                int currentMonth = DateTime.Now.Month;

                int nextYear  = DateTime.Now.AddMonths(1).Year;
                int nextMonth = DateTime.Now.AddMonths(1).Month;

                int currentZhangQi = GetZhouQi(currentMonth);
                int nextZhangQi    = GetZhouQi(nextMonth);
                //if (currentZhangQi == nextZhangQi && currentYear == nextYear)
                //{
                //    return;
                //}

                List <GuestProBaseInfo> guestProBaseInfos = new GuestProBaseInfoService().GetListArray("GuestPro=1");

                TB_GuestTrackService GuestTrackSer = new TB_GuestTrackService();
                string sql = string.Format(" 1=1 and QuartNo='{1}' and YearNo='{0}' ", currentYear, currentZhangQi);
                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 = GuestTrackSer.GetListArray(sql);

                using (SqlConnection conn = DBHelp.getConn())
                {
                    conn.Open();
                    SqlTransaction tan        = conn.BeginTransaction();
                    SqlCommand     objCommand = conn.CreateCommand();
                    objCommand.Transaction = tan;

                    try
                    {
                        objCommand.Parameters.Clear();
                        foreach (var model in GuestTracks)
                        {
                            //if (currentZhangQi == 4)
                            //{
                            //    if (model.MyGuestProString == "自我开拓")
                            //    {
                            //        model.MyGuestPro = 2;
                            //    }
                            //}
                            model.QuartNo    = nextZhangQi.ToString();
                            model.YearNo     = nextYear.ToString();
                            model.CreateTime = DateTime.Now;



                            string secondUpdate = GuestTrackSer.UpdateToString(model, model.GuestId, nextYear.ToString(), nextZhangQi.ToString());
                            if (model.MyGuestProString == "自我开拓")
                            {
                                //我们的系统在每个季度的最后一天的晚上12点会自动同步客户信息到下一个季度,我们定义
                                //.  如该客户目前的属性是自我开拓,该客户从登记之日起,加上自我开拓的有效期月数数字对应的日期,
                                //如小于(<) 新季度第一天,新季度的客户的属性变成 原有资源,否则 还是自我开拓
                                if (DateTime.Now.Month == 3 || DateTime.Now.Month == 6 || DateTime.Now.Month == 9 || DateTime.Now.Month == 12)
                                {
                                    if (DateTime.Now.Day == DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month) &&
                                        model.Time.AddMonths(guestProBaseInfos[0].GuestMonth) < Convert.ToDateTime(nextYear + "-" + nextMonth + "-01"))
                                    {
                                        model.MyGuestPro = 2;
                                    }
                                }
                            }
                            string update = GuestTrackSer.AddToString(model);

                            string updateSql = string.Format("if not exists(select id from TB_GuestTrack where guestId='{0}' and yearNo='{1}' and QuartNo='{2}')begin {3} end else begin {4} end",
                                                             model.GuestId, nextYear.ToString(), nextZhangQi.ToString(), update, secondUpdate);
                            objCommand.CommandText = updateSql;
                            objCommand.ExecuteNonQuery();
                        }

                        tan.Commit();
                        ServiceAppSetting.LoggerHander.Invoke(string.Format("执行成功! - {0}", DateTime.Now), "");
                    }
                    catch (Exception)
                    {
                        tan.Rollback();
                        ServiceAppSetting.LoggerHander.Invoke(string.Format("账期执行失败! - {0}", DateTime.Now), "Error");
                    }
                }
            }

            ////增加金蝶发票处理工具
            //var kISModel = new KISService().GetKIS();
            //var invoiceDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + kISModel.InvoiceDate);
            //var payableDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + kISModel.PayableDate);

            //if (DateTime.Now.Hour == invoiceDate.Hour && DateTime.Now.Minute == invoiceDate.Minute)
            //{
            //    var invoiceJob = new Thread(delegate ()
            //    {
            //        try
            //        {
            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Invoice_Proc-开始! - {0}", DateTime.Now), "");

            //            var kisServer = new KISService();
            //            var invoicesList = kisServer.GetInvoiceErrorInfo(kISModel.AccountName);
            //            if (invoicesList.Count > 0)
            //            {
            //                ServiceAppSetting.LoggerHander.Invoke(string.Format("Invoice_Proc-存在重复发票号数据,JOB 停止!", DateTime.Now), "");
            //                return;
            //            }

            //            //获取选中的数据库连接
            //            string newConn = KISService.KISDBConn.Replace("AcctCtl", kISModel.AccountName);
            //            KISService.ExeCommand("Invoice_Proc", newConn, Convert.ToDateTime(kISModel.InvoiceFrom), Convert.ToDateTime(kISModel.InvoiceTo));
            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Invoice_Proc-结束! - {0}", DateTime.Now), "");

            //        }
            //        catch (Exception ex)
            //        {
            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Invoice_Proc-结束! - {0},执行异常,请检查!错误信息:{1}", DateTime.Now, ex.Message), "");
            //        }

            //    })
            //    { IsBackground = true };
            //    invoiceJob.Start();
            //}

            //if (DateTime.Now.Hour == payableDate.Hour && DateTime.Now.Minute == payableDate.Minute)
            //{
            //    var payableJob = new Thread(delegate ()
            //    {
            //        try
            //        {
            //            var kisServer = new KISService();
            //            var payableList = kisServer.GetPayaleErrorInfo(kISModel.AccountName);
            //            if (payableList.Count > 0)
            //            {
            //                ServiceAppSetting.LoggerHander.Invoke(string.Format("Payable_Proc-存在重复发票号数据,JOB 停止!", DateTime.Now), "");
            //                return;
            //            }

            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Payable_Proc-开始! - {0}", DateTime.Now), "");
            //            //获取选中的数据库连接
            //            string newConn = KISService.KISDBConn.Replace("AcctCtl", kISModel.AccountName);
            //            KISService.ExeCommand("Payable_Proc", newConn, Convert.ToDateTime(kISModel.PayableFrom), Convert.ToDateTime(kISModel.PayableTo));
            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Payable_Proc-结束! - {0}", DateTime.Now), "");
            //        }
            //        catch (Exception ex)
            //        {
            //            ServiceAppSetting.LoggerHander.Invoke(string.Format("Payable_Proc-结束! - {0},执行异常,请检查!错误信息:{1}", DateTime.Now, ex.Message), "");
            //        }
            //    })
            //    { IsBackground = true };
            //    payableJob.Start();
            //}
        }
Exemple #16
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 (!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 (!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";

                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();
                    }
                }
            }
        }
        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 #21
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";
            }
        }