コード例 #1
0
ファイル: SearchRole.aspx.cs プロジェクト: iQuartz/SPW
        protected void btnAddFunction_Click(object sender, EventArgs e)
        {
            var cmdFunc = new FunctionService();
            List<ROLE_FUNCTION> list = new List<ROLE_FUNCTION>();

            for (int i = 0; i < gridSelectFunction.Rows.Count; i++)
            {
                if (((CheckBox)gridSelectFunction.Rows[i].Cells[0].FindControl("check")).Checked)
                {
                    if (ViewState["RoleId"] != null && DataSouceRoleFunction.Where(x => x.FUNCTION_ID == Convert.ToInt32(gridSelectFunction.DataKeys[i].Value.ToString())).FirstOrDefault() == null)
                    {
                        ROLE_FUNCTION obj = new ROLE_FUNCTION();
                        obj.Action = ActionEnum.Create;
                        obj.ROLE_ID = Convert.ToInt32(ViewState["RoleId"].ToString());
                        obj.FUNCTION_ID = Convert.ToInt32(gridSelectFunction.DataKeys[i].Value.ToString());
                        obj.CREATE_DATE = DateTime.Now;
                        obj.CREATE_EMPLOYEE_ID = 0;
                        obj.UPDATE_DATE = DateTime.Now;
                        obj.UPDATE_EMPLOYEE_ID = 0;
                        obj.SYE_DEL = true;
                        list.Add(obj);
                    }
                    else if (DataSouceNewRoleFunction.Where(x => x.FUNCTION_ID == Convert.ToInt32(gridSelectFunction.DataKeys[i].Value.ToString())).FirstOrDefault() == null)
                    {
                        ROLE_FUNCTION obj = new ROLE_FUNCTION();
                        obj.Action = ActionEnum.Create;
                        obj.ROLE_ID = 0;
                        obj.FUNCTION_ID = Convert.ToInt32(gridSelectFunction.DataKeys[i].Value.ToString());
                        obj.CREATE_DATE = DateTime.Now;
                        obj.CREATE_EMPLOYEE_ID = 0;
                        obj.UPDATE_DATE = DateTime.Now;
                        obj.UPDATE_EMPLOYEE_ID = 0;
                        obj.SYE_DEL = true;
                        DataSouceNewRoleFunction.Add(obj);
                    }
                }
            }

            if (list.Count > 0)
            {
                var cmd = new RoleFunctionService(list);
                cmd.AddList();
            }

            InitialDataPopup();
            this.popup.Show();
        }
コード例 #2
0
ファイル: SearchRole.aspx.cs プロジェクト: iQuartz/SPW
 private void InitialDataPopupFunction()
 {
     var cmd = new FunctionService();
     gridSelectFunction.DataSource = cmd.GetALL();
     gridSelectFunction.DataBind();
 }