コード例 #1
0
    protected void BtnSave_Click(object sender, System.EventArgs e)
    {
        bool flag  = true;
        bool flag2 = false;

        string[] array = this.hdnUserCode.Value.Substring(0, this.hdnUserCode.Value.Length - 1).Split(new char[]
        {
            ','
        });
        for (int i = 0; i < array.Length; i++)
        {
            if (!FlowRoleAction.IsSameUser(this.RoleID, array[i]))
            {
                flag = FlowRoleAction.AddUser(this.RoleID, array[i], "00");
            }
            if (!flag)
            {
                break;
            }
        }
        if (flag)
        {
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_roleuser' });");
            return;
        }
        if (flag2)
        {
            base.RegisterScript("top.ui.tabError();");
        }
    }
コード例 #2
0
 protected void btnSave_Click(object sender, System.EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["bm"]))
     {
         string text = base.Request["bm"].ToString();
         for (int i = 0; i < this.gvUser.Rows.Count; i++)
         {
             CheckBox checkBox = (CheckBox)this.gvUser.Rows[i].FindControl("cbBox");
             if (checkBox.Checked && !FlowRoleAction.IsHaveCorpUser(this.gvUser.DataKeys[i].Value.ToString(), text))
             {
                 FlowRoleAction.AddUser(0, this.gvUser.DataKeys[i].Value.ToString(), text);
             }
         }
     }
     base.RegisterScript("parent.location=parent.location;divClose(parent);");
 }
コード例 #3
0
ファイル: RoleCorpEdit.aspx.cs プロジェクト: zxl881203/src
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        string text = string.Empty;

        System.Collections.Generic.List <string> list = JsonHelper.JsonDeserialize <string[]>(this.hfldCorpCode.Value).ToList <string>();
        foreach (string current in list)
        {
            text = text + current + ",";
        }
        text = text.Substring(0, text.Length - 1);
        if (base.Request["action"].ToString() == "update")
        {
            string roleUserId = base.Request["uid"].ToString();
            if (string.IsNullOrEmpty(this.hfldUserCode.Value) || string.IsNullOrEmpty(text))
            {
                base.RegisterScript("top.ui.alert('没有选择人员或所负责的部门为空')");
                return;
            }
            bool flag = FlowRoleAction.UpdateCorpUser(roleUserId, this.hfldUserCode.Value, text);
            if (flag)
            {
                base.RegisterScript("top.ui.tabSuccess({parentName: '_rolecorpuser'});");
                return;
            }
            base.RegisterScript("top.ui.tabError();");
            return;
        }
        else
        {
            int roleId = System.Convert.ToInt32(base.Request["rid"].ToString());
            if (string.IsNullOrEmpty(this.hfldUserCode.Value) || string.IsNullOrEmpty(text))
            {
                base.RegisterScript("top.ui.alert('没有选择人员或所负责的部门为空')");
                return;
            }
            bool flag2 = FlowRoleAction.AddUser(roleId, this.hfldUserCode.Value, text);
            if (flag2)
            {
                base.RegisterScript("top.ui.tabSuccess({parentName: '_rolecorpuser'});");
                return;
            }
            base.RegisterScript("top.ui.tabError();");
            return;
        }
    }