Exemplo n.º 1
0
    /// <summary>
    /// 类名:EmployeeShift_Info
    /// 描述:调职单列表
    ///
    /// 作者:吴志强
    /// 创建时间:2009/04/25
    /// 最后修改时间:2009/04/25
    /// </summary>
    ///
    protected void Page_Load(object sender, EventArgs e)
    {
        //页面初期表示
        if (!IsPostBack)
        {
            //新建模块ID
            hidModuleID.Value = ConstUtil.MODULE_ID_HUMAN_EMPLOYEE_SHIFT_EDIT;
            //对应调职单
            DataTable dtApply = EmplApplyNotifyBus.GetApplyInfo(true);
            ddlApply.DataSource     = dtApply;
            ddlApply.DataValueField = "EmplApplyNo";
            ddlApply.DataTextField  = "Title";
            ddlApply.DataBind();
            ListItem item = new ListItem(ConstUtil.CODE_TYPE_INSERT_TEXT, ConstUtil.CODE_TYPE_INSERT_VALUE);
            ddlApply.Items.Insert(0, item);
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //从列表过来时
            int firstIndex = requestParam.IndexOf("&");
            //返回回来时
            if (firstIndex > 0)
            {
                //获取是否查询的标识
                //string flag = Request.QueryString["Flag"];
                ////点击查询时,设置查询的条件,并执行查询
                //if ("1".Equals(flag))
                //{
                //    //调职单编号
                //    txtNotifyNo.Text = Request.QueryString["NotifyNo"];
                //    //调职单主题
                //    txtTitle.Text = Request.QueryString["Title"];
                //    //对应申请单
                //    ddlApply.SelectedValue = Request.QueryString["EmplApplyNo"];
                //    //员工
                //    hidEmployeeID.Value = Request.QueryString["EmployeeID"];
                //    UserEmployeeName.Text = Request.QueryString["EmployeeName"];

                //    //获取当前页
                //    string pageIndex = Request.QueryString["PageIndex"];
                //    //获取每页显示记录数
                //    string pageCount = Request.QueryString["PageCount"];
                //    //排序
                //    string OrderBy = Request.QueryString["OrderBy"];
                //    //执行查询
                //    ClientScript.RegisterStartupScript(this.GetType(), "DoSearch"
                //            , "<script language=javascript>this.pageCount = parseInt(" + pageCount
                //            + ");this.OrderBy = \"" + OrderBy + "\";DoSearch('" + pageIndex + "');</script>");
                //}
            }
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 类名:EmployeeShift_Edit
    /// 描述:新建调职
    ///
    /// 作者:吴志强
    /// 创建时间:2009/04/24
    /// 最后修改时间:2009/04/24
    /// </summary>
    ///
    protected void Page_Load(object sender, EventArgs e)
    {
        //页面初期表示设置
        if (!IsPostBack)
        {
            #region 新建、修改共通处理

            //获取申请单数据
            DataTable dtApply = EmplApplyNotifyBus.GetApplyInfo();
            ddlApply.DataSource     = dtApply;
            ddlApply.DataValueField = "EmplApplyNo";
            ddlApply.DataTextField  = "Title";
            ddlApply.DataBind();
            ddlApply.Attributes.Add("onchange", "DoApplyChange();");
            //添加一请选择选项
            ListItem Item = new ListItem(ConstUtil.CODE_TYPE_INSERT_TEXT, ConstUtil.CODE_TYPE_INSERT_VALUE);
            ddlApply.Items.Insert(0, Item);
            //调至岗位
            DataTable dtQuarter = DeptQuarterBus.GetQuarterInfoWithCompanyCD();
            ddlNewQuarter.DataSource     = dtQuarter;
            ddlNewQuarter.DataValueField = "ID";
            ddlNewQuarter.DataTextField  = "QuarterName";
            ddlNewQuarter.DataBind();
            //调入岗位职等
            ctNewQuaterAdmin.TypeFlag = ConstUtil.CODE_TYPE_HUMAN;
            ctNewQuaterAdmin.TypeCode = ConstUtil.CODE_TYPE_QUARTER_ADMIN;
            //获取申请单数据

            //模板列表模块ID
            hidListModuleID.Value = ConstUtil.MODULE_ID_HUMAN_EMPLOYEE_SHIFT_INFO;
            hidFastModuleID.Value = ConstUtil.MODULE_ID_HUMAN_FAST_SHIFT;
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //返回按钮可见
                btnBack.Visible = true;
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_HUMAN_EMPLOYEE_SHIFT_EDIT, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
                //迁移页面
                hidFromPage.Value = Request.QueryString["FromPage"];
            }
            else
            {
                //返回按钮不可见
                btnBack.Visible = false;
            }
            #endregion

            //获取ID
            string ID = Request.QueryString["ID"];
            //ID为空时,为新建模式
            if (string.IsNullOrEmpty(ID))
            {
                #region 新建时初期处理
                //编号初期处理
                codeRule.CodingType = ConstUtil.CODING_TYPE_HUMAN;
                codeRule.ItemTypeID = ConstUtil.CODING_HUMAN_ITEM_SHIFT;
                //设置编号不可见
                divCodeNo.Attributes.Add("style", "display:none;");
                //自动生成编号的控件设置为可见
                divCodeRule.Attributes.Add("style", "display:block;");
                //设置ID
                hidIdentityID.Value = string.Empty;
                //制单日期
                txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
                //创建人姓名
                UserCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();
                //创建人ID
                txtCreator.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID.ToString();
                //获取员工ID
                string employeeID = Request.QueryString["EmployeeID"];
                //快速调职页面迁移过来时
                if (!string.IsNullOrEmpty(employeeID))
                {
                    //设置员工信息
                    InitEmployeInfo(employeeID);
                }
                #endregion
            }
            else
            {
                #region 修改时初期处理
                //设置标题
                divTitle.InnerText = "调职单";
                //自动生成编号的控件设置不可见
                divCodeRule.Attributes.Add("style", "display:none;");
                //编号设置为可见
                divCodeNo.Attributes.Add("style", "display:block;");
                divCodeNo.Attributes.Add("style", "width:60%;");
                //获取并设置信息
                InitNotifyInfo(ID);
                //设置编辑模式
                hidIdentityID.Value = ID;
                #endregion
            }
        }
    }