当前位置: 首页>>代码示例>>C#>>正文


C# Org_StaffBLL.Update方法代码示例

本文整理汇总了C#中Org_StaffBLL.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Org_StaffBLL.Update方法的具体用法?C# Org_StaffBLL.Update怎么用?C# Org_StaffBLL.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Org_StaffBLL的用法示例。


在下文中一共展示了Org_StaffBLL.Update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: bt_AddApply_Click

    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());
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:34,代码来源:StaffDetail.aspx.cs

示例2: bt_DeleteUser_Click

    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");
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:11,代码来源:StaffDetail.aspx.cs

示例3: bt_CreateUser_Click

    protected void bt_CreateUser_Click(object sender, EventArgs e)
    {
        string UserName = "", Password = "", PositionName = "";

        Org_StaffBLL staff = new Org_StaffBLL((int)ViewState["ID"]);
        if (staff.Model == null) return;
        if (staff.Model.aspnetUserId != null && staff.Model.aspnetUserId != Guid.Empty) return;

        PositionName = new Org_PositionBLL(staff.Model.Position).Model.Name;

        CM_ClientBLL tdp = new CM_ClientBLL((int)Session["OwnerClient"]);
        CM_ClientManufactInfo manufactinfo = tdp.GetManufactInfo(tdp.Model.OwnerClient);
        if (tdp.Model == null) return;

        //用户名默认为当前:TDP代码-员工姓名
        if (manufactinfo != null && !string.IsNullOrEmpty(manufactinfo.Code))
            UserName = manufactinfo.Code;
        else if (!string.IsNullOrEmpty(tdp.Model.Code))
            UserName = tdp.Model.Code;
        else
            UserName = tdp.Model.ID.ToString();
        UserName += "-" + staff.Model.RealName;

        if (Membership.GetUser(UserName) != null) UserName += staff.Model.ID.ToString();

        //密码默认为员工手机号码,为空时则为123456
        Password = staff.Model.Mobile.Trim();
        if (Password == "") Password = "123456";

        //创建用户,并加入角色
        MembershipUser u = Membership.CreateUser(UserName, Password);
        foreach (string rolename in Roles.GetAllRoles().Where(p => p.StartsWith("TDP")))
        {
            if (rolename == PositionName)
            {
                Roles.AddUserToRole(u.UserName, rolename);
            }
        }

        UserBLL.Membership_SetStaffID(u.UserName, staff.Model.ID);
        staff.Model.aspnetUserId = (Guid)u.ProviderUserKey;
        staff.Update();

        MessageBox.ShowAndRedirect(this, "用户创建成功!【用户名:" + UserName + ",初始密码:" + Password + "】", "StaffList.aspx");
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:45,代码来源:StaffDetail.aspx.cs

示例4: bt_Approve_Click

    /// <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 (Org_StaffNumberLimitBLL.CheckAllowAdd(_staff.Model.OrganizeCity, _staff.Model.Position) < 0)
            {
                MessageBox.Show(this, "对不起当前城市该职位员工人数满额,要想继续新增请与人事经理联系");
                return;
            }

            _staff.Model.ApproveFlag = 1;
            _staff.Model.UpdateStaff = (int)Session["UserID"];
            _staff.Update();
            MessageBox.Show(this, "审核成功!");
            BindData();
        }
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:24,代码来源:StaffDetail.aspx.cs

示例5: bt_RevocationApply_Click

    protected void bt_RevocationApply_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            MessageBox.Show(this, "对不起,请您先保存后在发起申请");
            return;
        }
        //判断是否还有未审批流程
        if (EWF_Task_JobDecisionBLL.GetModelList("DecisionResult=1 AND RecipientStaff=" + ViewState["ID"].ToString()).Count > 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("StaffName", bll.Model.RealName.ToString());
        int TaskID = EWF_TaskBLL.NewTask("Revocation_Staff",
                                        (int)Session["UserID"],
                                        TreeTableBLL.GetSuperNameByLevel("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", bll.Model.OrganizeCity, ConfigHelper.GetConfigInt("OrganizePartCity-CityLevel")) +
                                        "  " + TreeTableBLL.GetSuperNameByLevel("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", bll.Model.OrganizeCity, ConfigHelper.GetConfigInt("OrganizeCity-CityLevel")) + " " +
                                        new Org_PositionBLL(bll.Model.Position).Model.Name + " " +
                                        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());
    }
开发者ID:fuhongliang,项目名称:GraduateProject,代码行数:35,代码来源:StaffDetail.aspx.cs


注:本文中的Org_StaffBLL.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。