Example #1
0
        private void btnAddPerson_Click(object sender, EventArgs e)
        {
            ItRolePresenter rolePresenter = new ItRolePresenter();

            var role   = (SdItRoleDto)this.iGridRoles.CurrentRow.DataRow;
            var expert = (SdItExpertDto)this.iGridExperts.CurrentRow.DataRow;

            if (role != null && expert != null)
            {
                UCWeight frm = new UCWeight();
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(frm, "وزن انجام کار", FormBorderStyle.FixedDialog);
                if (frm.DialogResult != DialogResult.OK)
                {
                    return;
                }
                SdItRoleExpertDto roleExpert = new SdItRoleExpertDto()
                {
                    Weight   = frm.Weight,
                    Itroleid = role.RoleId,
                    Expertid = expert.ItExpertId,
                    Role     = role,
                    Expert   = expert,
                    Personel = expert.Personel
                };
                if (rolePresenter.AddRoleExpert(roleExpert) != null)
                {
                    roleExpertBs.Add(roleExpert);
                }
            }
        }
Example #2
0
        private void btnChangeweight_Click(object sender, EventArgs e)
        {
            var row = (SdItRoleExpertDto)this.igridPersonToRole.CurrentRow.DataRow;

            if (row != null)
            {
                UCWeight frm = new UCWeight(row.Weight.Value);
                ISE.UILibrary.Utils.UIUtils.SetFrmTrans(frm, "وزن انجام کار", FormBorderStyle.FixedDialog);
                if (frm.DialogResult != DialogResult.OK)
                {
                    return;
                }
                row.Weight = frm.Weight;
                ItRolePresenter rolePresenter = new ItRolePresenter();
                if (rolePresenter.UpdateRoleExpert(row))
                {
                    roleExpertBs.EndEdit();
                    roleExpertBs.ResetBindings(false);
                }
            }
        }