protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
Пример #2
0
    private void BindDropdown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();


        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion


        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetCurrentMonth() - 1).ToString();

        ddl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        ddl_ApproveFlag.DataBind();
        ddl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_State.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderDeliveryState");
        ddl_State.DataBind();
        ddl_State.Items.Insert(0, new ListItem("全部", "0"));
    }
Пример #4
0
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE()");
        ddl_BeginMonth.DataBind();
        ddl_BeginMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();
    }
    protected void bt_Approve_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ForcastID"] != 0)
        {
            string wftitle = "经销商销量预估流程申请ID:";
            Save();
            if ((int)ViewState["ClientType"] == 3)
            {
                wftitle = "零售商销量预估流程申请ID:";
            }

            Org_StaffBLL bll = new Org_StaffBLL((int)Session["UserID"]);
            NameValueCollection dataobjects = new NameValueCollection();
            dataobjects.Add("ID", ViewState["ForcastID"].ToString());
            dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
            dataobjects.Add("ApplyFee", SVM_ClassifyForcastBLL.GetForcastSumPrice((int)ViewState["ForcastID"]).ToString());
            int TaskID = EWF_TaskBLL.NewTask("SVM_ClassifyForcast_Approve", (int)Session["UserID"], wftitle + ViewState["ForcastID"].ToString(), "~/SubModule/SVM/ClassifyForcastDetail.aspx?ClientID=" + ViewState["ClientID"].ToString() + "&ForcastID=" + ViewState["ForcastID"].ToString(), dataobjects);
            if (TaskID > 0)
            {
                SVM_ClassifyForcastBLL.Submit((int)ViewState["ForcastID"], TaskID);
                new EWF_TaskBLL(TaskID).Start();        //直接启动流程
            }
            bt_Approve.Enabled = false;
            Response.Redirect("~/SubModule/SVM/ClassifyForcast.aspx");
        }
    }
Пример #6
0
    private void BindDropDown()
    {
        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate <= GETDATE() AND YEAR >= 2013");
        ddl_BeginMonth.DataBind();
        ddl_BeginMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now) - 1).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate <= GETDATE() AND YEAR >= 2013");
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now) - 1).ToString();

        #region 绑定用户可管辖的管理片区
        if (Session["UserID"] != null)
        {
            int          staffid = (int)Session["UserID"];
            Org_StaffBLL staff   = new Org_StaffBLL(staffid);

            //select_Staff.SelectText = staff.Model.RealName;
            //select_Staff.SelectValue = staffid.ToString();

            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue   = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }
        }
        #endregion
    }
Пример #7
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        int forwarddays = ConfigHelper.GetConfigInt("GiftApplyForwardDays");
        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
                                                                      "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString();


        rbl_Type.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderType");
        rbl_Type.DataBind();
        rbl_Type.SelectedValue = "2";

        ddl_Publish.Items.Insert(0, new ListItem("请选择...", "0"));
        //ddl_Address.Items.Insert(0, new ListItem("请选择...", "0"));
        select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=2&ExtCondition=\"MCS_SYS.dbo.UF_Spilt(CM_Client.ExtPropertys,~|~,7)=1\"";
    }
Пример #8
0
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        ddl_CityLevel.DataSource = DictionaryBLL.GetDicCollections("Addr_OrganizeCityLevel");
        ddl_CityLevel.DataBind();
        ddl_CityLevel.Items.Insert(0, new ListItem("请选择", "0"));
        ddl_CityLevel.SelectedValue = "4";

        tr_Position.DataSource  = Org_PositionBLL.GetAllPostion();
        tr_Position.SelectValue = staff.Model.Position.ToString();
    }
    private void BindDropdown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_CityLevel.DataSource = DictionaryBLL.GetDicCollections("Addr_OrganizeCityLevel");
        ddl_CityLevel.DataBind();
        ddl_CityLevel.Items.Insert(0, new ListItem("请选择", "0"));
        ddl_CityLevel.SelectedValue = "4";

        ddl_Classify.DataSource = DictionaryBLL.GetDicCollections("PM_PromotorClassify");
        ddl_Classify.DataBind();
        ddl_Classify.Items.Insert(0, new ListItem("不限制类别", "0"));
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        if (Request.QueryString["OrganizeCity"] != null)
        {
            tr_OrganizeCity.SelectValue = Request.QueryString["OrganizeCity"].ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.ToString("yyyy-MM-dd") +
            "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now) - 1).ToString();
        if (Request.QueryString["AccountMonth"] != null)
        {
            ddl_Month.SelectedValue = Request.QueryString["AccountMonth"].ToString();
        }
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        tr_OrganizeCity_Selected(null, null);

        if (Request.QueryString["OrganizeCity"] != null)
        {
            tr_OrganizeCity.SelectValue = Request.QueryString["OrganizeCity"].ToString();
        }
        #endregion

        ddl_RTChannel.DataSource = DictionaryBLL.GetDicCollections("CM_RT_Channel");
        ddl_RTChannel.DataBind();
        ddl_RTChannel.Items.Insert(0, new ListItem("所有", "0"));
        ddl_RTChannel.SelectedValue = "0";
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.ToString("yyyy-MM-dd") +
            "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-10)).ToString();

        ddl_ActiveFlag.DataSource = DictionaryBLL.GetDicCollections("CM_ActiveFlag");
        ddl_ActiveFlag.DataBind();
        ddl_ActiveFlag.Items.Insert(0, new ListItem("所有", "0"));
        ddl_ActiveFlag.SelectedValue = "1";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["Type"] = Request.QueryString["Type"] == null ? 0 : int.Parse(Request.QueryString["Type"]); //客户类型,1:公司仓库 2:经销商 3:终端门店

            #region 设置页面Title
            if ((int)ViewState["Type"] == 1)
                lb_PageTitle.Text = "办事处出货查询";
            else if ((int)ViewState["Type"] == 2)
                lb_PageTitle.Text = "经销商出货查询";
            else if ((int)ViewState["Type"] == 3)
                lb_PageTitle.Text = "零售商销量查询";
            else if ((int)ViewState["Type"] == 4)
                lb_PageTitle.Text = "办事处进货查询";
            #endregion

            AdvancedSearch1.ExtCondition = "SVM_SalesVolume.Type=" + ViewState["Type"].ToString();

            #region 判断当前可查询的范围
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

            if (staff.Model.OrganizeCity > 1)
            {
                Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity, true);
                string orgcitys = orgcity.GetAllChildNodeIDs();
                if (orgcitys != "") orgcitys += ",";
                orgcitys += staff.Model.OrganizeCity.ToString();

                AdvancedSearch1.ExtCondition += " AND SVM_SalesVolume.OrganizeCity IN (" + orgcitys + ")";
            }
            #endregion
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            tbx_begin.Text = DateTime.Now.AddMonths(-3).ToShortDateString();
            tbx_end.Text = DateTime.Now.ToShortDateString();

            #region 绑定用户可管辖的片区
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }
            #endregion
            tr_Position.DataSource = Org_PositionBLL.GetAllPostion();

            BindData();
        }
    }
 private void Bind()
 {
     int StaffID = int.Parse(ViewState["StaffID"].ToString());
     if (StaffID <= 0)
         StaffID = int.Parse(Session["UserID"].ToString());
     Org_StaffBLL _staff = new Org_StaffBLL(StaffID);
     switch (ViewState["Type"].ToString())
     {
         case "4":
             p_headr.InnerText = "已录进货的零售店数(成品)-未完成";
             gv_Detail.DataSource = _staff.GetFillProcessDetail(4);
             break;
         case "5":
             p_headr.InnerText = "已录销量的零售店数(成品)-未完成";
             gv_Detail.DataSource = _staff.GetFillProcessDetail(5);
             break;
         case "2":
             p_headr.InnerText = "返利费用申请门店数-未完成";
             gv_Detail.DataSource = _staff.GetFillProcessDetail(2);
             break;
         case "3":
             p_headr.InnerText = "导购工资申请导购数-未完成";
             gv_Detail.DataSource = _staff.GetFillProcessDetail(3);
             break;
         case "1":
         default:
             p_headr.InnerText = "陈列费用申请门店数-未完成";
             gv_Detail.DataSource = _staff.GetFillProcessDetail(1);
             break;
     }
     gv_Detail.DataBind();
     gv_Detail.BindGrid();
 }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType");
        ddl_FeeType.DataBind();
        ddl_FeeType.Items.Insert(0, new ListItem("全部", "0"));
        //if (ddl_FeeType.Items.FindByValue("1") != null) ddl_FeeType.SelectedValue = "1";

        ddl_State.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeWriteOffState");
        ddl_State.DataBind();
        ddl_State.Items.Insert(0, new ListItem("全部", "0"));
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        tr_OrganizeCity_Selected(null, null);
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<=GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name);
        ddl_FeeType.DataBind();
        ddl_FeeType.Items.Insert(0, new ListItem("全部", "0"));

        tr_AccountTitle.SelectValue = "1";
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);

        tr_Position.DataSource = Org_PositionBLL.GetAllPostion();

        #region 如果非总部职位,其只能选择自己职位及以下职位
        Org_Position p = new Org_PositionBLL(staff.Model.Position).Model;
        if (p != null && p.IsHeadOffice != "Y" && p.Remark != "OfficeHR")
        {
            //tr_Position.RootValue = staff.Model.Position.ToString();// p.SuperID.ToString();
            tr_Position.RootValue   = p.SuperID.ToString();
            tr_Position.SelectValue = staff.Model.Position.ToString();
        }
        else
        {
            tr_Position.RootValue = "1";
            //tr_Position.SelectValue = "1";
        }
        tr_Position.SelectValue = tr_Position.RootValue;
        #endregion
        ddl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        ddl_ApproveFlag.DataBind();
        ddl_ApproveFlag.Items.Insert(0, new ListItem("请选择", "0"));
    }
Пример #19
0
    private void BindDropDown()
    {
        IList<EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(" EnableFlag='Y' ");
        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        #region 绑定当前操作员所能查看的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_FinishStatus.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_FinishStatus");
        ddl_FinishStatus.DataBind();
        ddl_FinishStatus.Items.Insert(0, new ListItem("全部", "0"));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取页面参数
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            int _relateclient = 0;
            if (staff.Model["RelateClient"] != "" && int.TryParse(staff.Model["RelateClient"], out _relateclient))
            {
                ViewState["ClientID"] = _relateclient;
                select_Client.Enabled = false;
            }
            else
            {
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                    Session["ClientID"] = ViewState["ClientID"];
                }
                else if (Session["ClientID"] != null && Request.QueryString["State"] == null && Request.QueryString["ApproveFlag"] == null)
                {
                    ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
                }
            }
            #endregion

            if (ViewState["ClientID"] != null)
            {
                CM_ClientBLL client = new CM_ClientBLL((int)ViewState["ClientID"]);
                select_Client.SelectValue = ViewState["ClientID"].ToString();
                select_Client.SelectText = client.Model.FullName;

            }
        }
    }
    private void BindDropDown()
    {
        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate <= GETDATE() AND YEAR >= 2013");
        ddl_BeginMonth.DataBind();
        ddl_BeginMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now) - 1).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate <= GETDATE() AND YEAR >= 2013");
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now) - 1).ToString();

        #region 绑定用户可管辖的管理片区
        if (Session["UserID"] != null)
        {
            int staffid = (int)Session["UserID"];
            Org_StaffBLL staff = new Org_StaffBLL(staffid);

            //select_Staff.SelectText = staff.Model.RealName;
            //select_Staff.SelectValue = staffid.ToString();

            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }

        }
        #endregion
    }
Пример #22
0
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        ddl_FLType.DataSource = DictionaryBLL.GetDicCollections("RT_FLType");
        ddl_FLType.DataBind();
        ddl_FLType.Items.Insert(0, new ListItem("全部", "0"));

        ddl_FLTypeDetail.DataSource = DictionaryBLL.GetDicCollections("RT_FLType");
        ddl_FLTypeDetail.DataBind();

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("Year>=" + (DateTime.Now.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = "0";
        if (ViewState["AccountMonth"] != null)
        {
            ddl_Month.SelectedValue = ViewState["AccountMonth"].ToString();
        }
    }
    private void BindDropDown()
    {
        string condition            = " EnableFlag='Y' ";
        string CantApproveAlone_EWF = ConfigHelper.GetConfigString("CantApproveAlone_EWF");

        if (!string.IsNullOrEmpty(CantApproveAlone_EWF))
        {
            condition += " AND Code NOT IN ( " + CantApproveAlone_EWF + ")";
        }
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(condition);

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = "0";
        }
    }
    protected void tr_Position_Selected(object sender, MCSControls.MCSWebControls.SelectedEventArgs e)
    {
        if (tr_Position.SelectValue != "0")
        {
            string positions = "";
            if (cb_IncludeChild.Checked)
            {
                Org_PositionBLL pos = new Org_PositionBLL(int.Parse(tr_Position.SelectValue));
                positions = pos.GetAllChildPosition();
                if (positions != "")
                {
                    positions += ",";
                }
                positions += tr_Position.SelectValue;
            }
            else
            {
                positions = tr_Position.SelectValue;
            }

            DataTable dt = Org_StaffBLL.GetRealNameAndUserNameByPosition(positions);

            listAccount.Items.Clear();

            foreach (DataRow row in dt.Rows)
            {
                listAccount.Items.Add(new ListItem((string)row["UserName"] + "[" + (string)row["RealName"] + "]", (string)row["UserName"]));
            }
        }
    }
Пример #25
0
    private void BindDropDown()
    {
        int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays");

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
                                                               "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = (int)ViewState["AccountMonth"] == 0 ? AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString() : ViewState["AccountMonth"].ToString();

        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        if ((int)ViewState["OrganizeCity"] > 0)
        {
            tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString();
        }
        tr_OrganizeCity_Selected(null, null);
        #endregion
    }
Пример #26
0
    private void BindDropDown()
    {
        IList <EWF_Flow_App> apps = EWF_Flow_AppBLL.GetModelList(" EnableFlag='Y' ");

        ddl_App.DataSource = apps;
        ddl_App.DataBind();
        ddl_App.Items.Insert(0, new ListItem("请选择...", "0"));

        #region 绑定当前操作员所能查看的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_FinishStatus.DataSource = DictionaryBLL.GetDicCollections("EWF_Flow_FinishStatus");
        ddl_FinishStatus.DataBind();
        ddl_FinishStatus.Items.Insert(0, new ListItem("全部", "0"));
    }
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }

        Org_StaffBLL bll = new Org_StaffBLL((int)ViewState["ID"]);
        if (Org_StaffNumberLimitBLL.CheckAllowAdd(bll.Model.OrganizeCity, bll.Model.Position) < 0)
        {
            MessageBox.Show(this, "对不起当前城市该职位员工人数满额,要想继续新增请与人事经理联系");
            return;
        }
        int budget = Org_StaffNumberLimitBLL.CheckOverBudget(bll.Model.OrganizeCity, bll.Model.Position);

        NameValueCollection dataobjects = new NameValueCollection();
        dataobjects.Add("ID", ViewState["ID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("Position", bll.Model.Position.ToString());
        dataobjects.Add("SalaryFlag", bll.Model["SalaryFlag"].ToString());
        dataobjects.Add("StaffName", bll.Model.RealName.ToString());
        dataobjects.Add("IsOverBudget", budget < 0 ? "1" : "2");

        int TaskID = EWF_TaskBLL.NewTask("Add_Staff", (int)Session["UserID"], "人员入职流程,姓名:" + bll.Model.RealName, "~/SubModule/StaffManage/StaffDetail.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);
        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"] = "2";
            bll.Update();
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        select_Staff.SelectText  = staff.Model.RealName;
        select_Staff.SelectValue = staff.Model.ID.ToString();

        ddl_Transport.DataSource = DictionaryBLL.GetDicCollections("FNA_EvectionTransport");
        ddl_Transport.DataBind();
        ddl_Transport.Items.Insert(0, new ListItem("请选择...", "0"));

        ddl_Car.DataSource = Car_CarListBLL.GetCarListByOrganizeCity(staff.Model.OrganizeCity);
        ddl_Car.DataBind();
        ddl_Car.Items.Insert(0, new ListItem("请选择", "0"));
    }
    private void BindDropdown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetCurrentMonth() - 1).ToString();

        rbl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        rbl_ApproveFlag.DataBind();
        rbl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        rbl_ApproveFlag.SelectedValue = "0";
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);

        tr_Position.DataSource = Org_PositionBLL.GetAllPostion();

        #region 如果非总部职位,其只能选择自己职位及以下职位
        Org_Position p = new Org_PositionBLL(staff.Model.Position).Model;
        if (p != null && p.IsHeadOffice != "Y" && p.Remark != "OfficeHR")
        {
            //tr_Position.RootValue = staff.Model.Position.ToString();// p.SuperID.ToString();
            tr_Position.RootValue = p.SuperID.ToString();
            tr_Position.SelectValue = staff.Model.Position.ToString();
        }
        else
        {
            tr_Position.RootValue = "1";
            //tr_Position.SelectValue = "1";
        }
        tr_Position.SelectValue = tr_Position.RootValue;
        #endregion
        ddl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        ddl_ApproveFlag.DataBind();
        ddl_ApproveFlag.Items.Insert(0, new ListItem("请选择", "0"));
    }
Пример #31
0
 private void BindDropDown()
 {
     ddl_Salesman.DataSource = Org_StaffBLL.GetStaffList("Org_Staff.ID IN (SELECT SalesMan FROM MCS_PBM.dbo.PBM_Order WHERE Supplier=" + Session["OwnerClient"].ToString() +
                                                         " AND InsertTime>DATEADD(MONTH,-6,GETDATE()) ) AND Org_Staff.Dimission = 1");
     ddl_Salesman.DataBind();
     ddl_Salesman.Items.Insert(0, new ListItem("请选择...", "0"));
 }
Пример #32
0
    protected void bt_AddApply_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }

        Org_StaffBLL bll = new Org_StaffBLL((int)ViewState["ID"]);

        NameValueCollection dataobjects = new NameValueCollection();

        dataobjects.Add("ID", ViewState["ID"].ToString());
        dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
        dataobjects.Add("Position", bll.Model.Position.ToString());
        dataobjects.Add("SalaryFlag", bll.Model["SalaryFlag"].ToString());
        dataobjects.Add("StaffName", bll.Model.RealName.ToString());

        int TaskID = EWF_TaskBLL.NewTask("Add_Staff", (int)Session["UserID"], "人员入职流程,姓名:" + bll.Model.RealName, "~/SubModule/StaffManage/StaffDetail.aspx?ID=" + ViewState["ID"].ToString(), dataobjects);

        if (TaskID > 0)
        {
            bll.Model["TaskID"] = TaskID.ToString();
            bll.Model["State"]  = "2";
            bll.Update();
        }

        Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        tr_OrganizeCity_Selected(null, null);

        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<DateAdd(month,1,GetDate()) AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_BeginMonth.DataBind();
        ddl_BeginMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddMonths(-3)).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<DateAdd(month,1,GetDate()) AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddMonths(1)).ToString();

        rbl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        rbl_ApproveFlag.DataBind();
        rbl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        rbl_ApproveFlag.SelectedValue = "0";
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_State.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderDeliveryState");
        ddl_State.DataBind();
        ddl_State.Items.Insert(0, new ListItem("全部", "0"));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 获取参数
            ViewState["OrganizeCity"] = Request.QueryString["OrganizeCity"] == null ? 0 : int.Parse(Request.QueryString["OrganizeCity"]);
            ViewState["AccountMonth"] = Request.QueryString["AccountMonth"] == null ? 0 : int.Parse(Request.QueryString["AccountMonth"]);
            ViewState["Staff"] = Request.QueryString["Staff"] == null ? 0 : int.Parse(Request.QueryString["Staff"]);
            #endregion

            BindDropDown();

            if ((int)ViewState["OrganizeCity"] > 0) tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString();
            if ((int)ViewState["AccountMonth"] > 0) ddl_AccountMonth.SelectedValue = ViewState["AccountMonth"].ToString();
            if ((int)ViewState["Staff"] > 0)
            {
                Org_StaffBLL staff = new Org_StaffBLL((int)ViewState["Staff"]);
                if (staff.Model != null)
                {
                    select_Staff.SelectValue = staff.Model.ID.ToString();
                    select_Staff.SelectText = staff.Model.RealName;
                    tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
                }
            }

            if (select_Staff.SelectValue != "") BindGrid();
        }
    }
Пример #36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            tbx_begin.Text = DateTime.Now.AddMonths(-3).ToShortDateString();
            tbx_end.Text   = DateTime.Now.ToShortDateString();

            #region 绑定用户可管辖的片区
            Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
            tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

            if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
            {
                tr_OrganizeCity.RootValue   = "0";
                tr_OrganizeCity.SelectValue = "1";
            }
            else
            {
                tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
                tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
            }
            #endregion
            tr_Position.DataSource = Org_PositionBLL.GetAllPostion();

            BindData();
        }
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<='" + DateTime.Today.ToString("yyyy-MM-dd") +
                                                               "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-10)).ToString();

        tr_OrganizeCity_Selected(null, null);
    }
Пример #38
0
    public void ReplySet(int MailID)
    {
        ML_MailBLL mailbll = new ML_MailBLL(MailID);

        string tmpStr = "<br/>" + mailbll.Model.Content.ToString();

        tmpStr = tmpStr.Replace("<br/>", "\r\n");
        this.txtSubject.Text = "回复:" + mailbll.Model.Subject.ToString();
        SendToRealName       = mailbll.Model.Sender.ToString();
        Org_StaffBLL staffbll = new Org_StaffBLL();

        SendTo = mailbll.Model.Sender.ToString();
        if (SendTo != "")
        {
            if (UserBLL.GetStaffByUsername(SendTo) != null)
            {
                SendToRealName = SendTo + "[" + UserBLL.GetStaffByUsername(SendTo).RealName + "]" + ",";
            }
            else
            {
                MessageBox.Show(this, "用户名不存在");
            }
        }
        //SendTo = mailbll.Model.CcToAddr.ToString() + ",";
        this.ckedit_content.Text  = SendToRealName + "你好!<br/><br/><br/><br/><hr/>";
        this.ckedit_content.Text += "-----------------" + mailbll.Model.SendTime.ToString("yyyy年MM月dd日 HH:mm") + ", " + SendToRealName + "在来信中写道:" + "-----------------<br/>";
        this.ckedit_content.Text += tmpStr;
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        ddl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        ddl_ApproveFlag.DataBind();
        ddl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        ddl_ApproveFlag.SelectedValue = "1";

        ddl_ActiveFlag.DataSource = DictionaryBLL.GetDicCollections("CM_ActiveFlag");
        ddl_ActiveFlag.DataBind();
        ddl_ActiveFlag.Items.Insert(0, new ListItem("所有", "0"));
        ddl_ActiveFlag.SelectedValue = "1";
    }
    private void Bind()
    {
        int StaffID = int.Parse(ViewState["StaffID"].ToString());
        if (StaffID <= 0)
            StaffID = int.Parse(Session["UserID"].ToString());
        Org_StaffBLL _staff = new Org_StaffBLL(StaffID);
        int type = 0;
        int.TryParse(ViewState["Type"].ToString(),out type);
        int city=0;
        int.TryParse(ViewState["City"].ToString(),out city);

        switch (type)
        {
            case 1:
                p_headr.InnerText = "陈列费用下游待审批";break;
            case 2:
                p_headr.InnerText = "返利费用下游待审批";break;
            case 3:
                p_headr.InnerText = "导购工资下游待审批";break;
            case 4:
                p_headr.InnerText = "费用核销下游待审批";break;
            case 5:
                p_headr.InnerText = "促销品请购下游待审批";break;
            default:
                p_headr.InnerText = "其他费用下游待审批";break;
        }
        gv_Detail.DataSource = _staff.GetLowerPositionTask(type, city, (int)ViewState["Month"]);
        gv_Detail.DataBind();
        gv_Detail.BindGrid();
    }
Пример #41
0
    private void BindDropdown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetCurrentMonth()).ToString();

        IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("IsOpponent=1");
        ddl_Brand.DataTextField  = "Name";
        ddl_Brand.DataValueField = "ID";
        ddl_Brand.DataSource     = _brandList;
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("全部", "0"));
        ddl_Classify.Items.Insert(0, new ListItem("所有", "0"));
    }
Пример #42
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_BeginMonth.DataBind();
        ddl_BeginMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddMonths(-3)).ToString();

        ddl_EndMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_EndMonth.DataBind();
        ddl_EndMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_State.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderDeliveryState");
        ddl_State.DataBind();
        ddl_State.Items.Insert(0, new ListItem("全部", "0"));

        rbl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        rbl_ApproveFlag.DataBind();
        rbl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        rbl_ApproveFlag.SelectedValue = "0";
    }
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        if (tr_OrganizeCity.SelectValue == "0")
        {
            MessageBox.Show(this, "请选择要查询的管理片区!");
            return;
        }

        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 2)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("OrganizeCity", tr_OrganizeCity.SelectValue)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
    }
Пример #44
0
    private void BindRelateActivity()
    {
        DateTime JournalDate  = DateTime.Parse(tbx_begindate.Text);
        int      OrganizeCity = new Org_StaffBLL((int)Session["UserID"], true).Model.OrganizeCity;

        string ConditionStr = "PlanBeginDate BETWEEN '" + JournalDate.AddDays(-15).ToString("yyyy-MM-dd") + "' AND '"
                              + JournalDate.AddDays(15).ToString("yyyy-MM-dd") + "' ";

        if (OrganizeCity != 1)
        {
            Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(OrganizeCity, true);
            string orgcitys = orgcity.GetAllChildNodeIDs();
            if (orgcitys != "")
            {
                orgcitys += ",";
            }
            orgcitys += OrganizeCity.ToString();

            if (orgcitys != "")
            {
                ConditionStr += " AND OrganizeCity IN (" + orgcitys + ") ";
            }
        }
        //if(ddl_RelateActivity!=null)
        //{
        //ddl_RelateActivity.DataSource = CAT_ActivityBLL.GetModelList(ConditionStr);
        //ddl_RelateActivity.DataBind();
        //ddl_RelateActivity.Items.Insert(0, new ListItem("请选择您参与举办的活动...", "0"));
        //ddl_RelateActivity_SelectedIndexChanged(null, null);
        //}
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        rbl_Type.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderType");
        rbl_Type.DataBind();
        rbl_Type.SelectedValue = "2";

        double DelayDays = Convert.ToDouble(System.Configuration.ConfigurationManager.AppSettings["OrderDelayDays"]);
        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-DelayDays)).ToString();

        ddl_Publish.Items.Insert(0, new ListItem("请选择...", "0"));
    }
Пример #46
0
    protected void bt_Refresh_Click(object sender, EventArgs e)
    {
        ReportViewer1.ServerReport.ReportServerCredentials = new MCSReportServerCredentials();
        ReportViewer1.ServerReport.ReportPath = ViewState["ReportPath"].ToString();
        ReportViewer1.ServerReport.ReportServerUrl = new Uri(ViewState["ReportServerUrl"].ToString());

        if (ReportViewer1.ServerReport.GetParameters().Count == 3)
        {
            int staff = 0;
            int position = new Org_StaffBLL((int)Session["UserID"]).Model.Position;
            string remark = new Org_PositionBLL(position).Model.Remark;
            if (remark != null && remark.Contains("OnlyViewSelfReport"))
            {
                staff = (int)Session["UserID"];
            }
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text),
                new ReportParameter("Staff",staff.ToString())
             };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }
        else
        {
            ReportParameter[] _parms = {
                new ReportParameter("BeginDate",tbx_begin.Text),
                new ReportParameter("EndDate", tbx_end.Text)
            };
            ReportViewer1.ServerReport.SetParameters(_parms);
        }



    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays");
        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
                                                               "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString();

        rbl_IsNKA.SelectedValue = Request.QueryString["ISNKA"] != null ? Request.QueryString["ISNKA"].ToString() : "2";
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays");
        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
            "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString();

        rbl_IsNKA.SelectedValue = Request.QueryString["ISNKA"] != null ? Request.QueryString["ISNKA"].ToString() : "2";
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);

        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetCurrentMonth().ToString();

        ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name);
        ddl_FeeType.DataBind();
        ddl_FeeType.Items.Insert(0, new ListItem("全部", "0"));

        ddl_ExtraType.DataSource = DictionaryBLL.GetDicCollections("FNA_BudgetExtraType").OrderBy(p => p.Value.Name);
        ddl_ExtraType.DataBind();
        ddl_ExtraType.Items.Insert(0, new ListItem("全部", "0"));
    }
    private void BindDropDown()
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetCurrentMonth().ToString();

        ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name);
        ddl_FeeType.DataBind();
        ddl_FeeType.Items.Insert(0, new ListItem("全部", "0"));

        ddl_ExtraType.DataSource = DictionaryBLL.GetDicCollections("FNA_BudgetExtraType").OrderBy(p => p.Value.Name);
        ddl_ExtraType.DataBind();
        ddl_ExtraType.Items.Insert(0, new ListItem("全部", "0"));
    }
Пример #51
0
    private void BindDropDown()
    {
        #region 绑定管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"], true);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        if ((int)ViewState["OrganizeCity"] > 0)
        {
            tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString();
        }
        tr_OrganizeCity_Selected(null, null);
        #endregion

        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate>DateAdd(year,-2,getdate()) AND EndDate<=Getdate()");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(-10)) - 1).ToString();
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate Between dateadd(month,-4,getdate()) AND getdate()");
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddMonths(-1)).ToString();
        #endregion
    }
    protected void bt_Add_StaffInOrganizeCity_Click(object sender, EventArgs e)
    {
        if (ddl_StaffInOrganizeCity.SelectedValue != "0" && (int)ViewState["ID"] != 0)
        {
            Org_StaffBLL _staffbll = new Org_StaffBLL((int)ViewState["ID"]);
            _staffbll.StaffInOrganizeCity_Add(int.Parse(ddl_StaffInOrganizeCity.SelectedValue));

            gv_StaffInOrganizeCity.BindGrid<Addr_OrganizeCity>(_staffbll.StaffInOrganizeCity_GetOrganizeCitys());
        }
    }
 protected void select_OrgClientManager_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
 {
     if (select_OrgClientManager.SelectValue != "")
     {
         Org_Staff staff = new Org_StaffBLL(int.Parse(select_OrgClientManager.SelectValue)).Model;
         if (staff != null)
         {
             lb_Prompt.Text = "注意:该操作将会替换所有原客户经理为【" + staff.RealName + "】的" + ((int)ViewState["ClientType"] == 2 ? "经销商" : "零售商") + ",请小心操作!";
         }
     }
 }
    protected void bt_DeleteUser_Click(object sender, EventArgs e)
    {
        Org_StaffBLL staff = new Org_StaffBLL((int)ViewState["ID"]);
        if (staff.Model == null) return;

        Membership.DeleteUser(lb_Username.Text, true);

        staff.Model.aspnetUserId = Guid.Empty;
        staff.Update();
        Response.Redirect("StaffList.aspx");
    }
    private void BindData()
    {
        Org_Staff staff = new Org_StaffBLL((int)ViewState["ClientManager"]).Model;
        if (staff != null)
        {
            select_OrgClientManager.SelectText = staff.RealName;
            select_OrgClientManager.SelectValue = staff.ID.ToString();

            lb_Prompt.Text = "注意:该操作将会替换所有原客户经理为【" + staff.RealName + "】的" + ((int)ViewState["ClientType"] == 2 ? "经销商" : "零售商") + ",请小心操作!";
        }
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_Type.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderType");
        ddl_Type.DataBind();
        ddl_Type.Items.Insert(0, new ListItem("全部", "0"));

        if ((int)ViewState["Type"] > 0)
        {
            ddl_Type.SelectedValue = ViewState["Type"].ToString();
            ddl_Type.Enabled = false;
        }
        ddl_State.DataSource = DictionaryBLL.GetDicCollections("ORD_OrderApplyState");
        ddl_State.DataBind();
        ddl_State.Items.Insert(0, new ListItem("全部", "0"));

        IList<PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("(IsOpponent IN (1) OR ID IN (4,5))");
        ddl_Brand.DataTextField = "Name";
        ddl_Brand.DataValueField = "ID";
        ddl_Brand.DataSource = _brandList;
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("全部", "0"));

        ddl_ProductType.DataSource = DictionaryBLL.GetDicCollections("ORD_ProductOrderType");
        ddl_ProductType.DataBind();
        ddl_ProductType.Items.Insert(0, new ListItem("全部", "0"));
        if ((int)ViewState["Type"] == 2)
        {
            ddl_ProductType.Enabled = false;

        }
    }
 /// <summary>
 /// 审核
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void bt_Approve_Click(object sender, EventArgs e)
 {
     if ((int)ViewState["ID"] != 0)
     {
         Org_StaffBLL _staff = new Org_StaffBLL((int)ViewState["ID"]);
         if (_staff.Model != null && _staff.Model.ApproveFlag == 2)
         {
             if (_staff.Approve() == 0)
             {
                 MessageBox.Show(this, "审核成功!");
                 BindData();
             }
         }
     }
 }
    protected DateTime _pageInitTime; //= DateTime.Now;           //用于计算页面生成时间

    #endregion Fields

    #region Methods

    protected void bt_On_Click(object sender, EventArgs e)
    {
        WT_WorkTimeBLL _bll = new WT_WorkTimeBLL();
        Org_Staff _s = new Org_StaffBLL(int.Parse(Session["UserID"].ToString())).Model;
        if (_bll.IsBeginWork(int.Parse(Session["UserID"].ToString())))
        {
            MessageBox.Show(this.Page, "你今天已经上班了!");
        }
        else
        {
            _bll.BeginWork(int.Parse(Session["UserID"].ToString()), _s.OrganizeCity);
            bt_On.Visible = false;
            bt_Out.Visible = true;
        }
    }
 private void BindData()
 {
     Org_StaffBLL bll = new Org_StaffBLL((int)ViewState["ID"]);
     panel1.BindData(bll.Model);
      if (bll.Model.OrganizeCity > 1)
      {
          gv_StaffInOrganizeCity.BindGrid<Addr_OrganizeCity>(bll.StaffInOrganizeCity_GetOrganizeCitys());
      }
      else
      {
          tr_StaffInOrganizeCity.Visible = false;
      }
     gv_List.DataSource = bll.GetUserList();
     gv_List.DataBind();
 }