Exemplo n.º 1
0
 private void btnClear_Click(object sender, RoutedEventArgs e)
 {
     if (dgCountersign.SelectedItems.Count == 1)
     {
         CounterSignRole ent = dgCountersign.SelectedItem as CounterSignRole;
         counterSignRoleList.Remove(ent);
         dgCountersign.ItemsSource = null;
         dgCountersign.ItemsSource = counterSignRoleList;
         if (counterSignRoleList.Count < 1)
         {
             counterSignRoleList = null;
         }
         _activityObject.CounterSignRoleList = counterSignRoleList;
         UpdateActivityObject(_activityObject);
     }
     else
     {
         ComfirmWindow.ConfirmationBox("提示信息", "请先选择一条需要删除的记录", "确定");
     }
 }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            if (cboInfo.SelectedItem as StateType == null)
            {
                ComfirmWindow.ConfirmationBox("提示信息", "处理角色不能为空!", "确定");
                return;
            }
            if (_counterSignRoleList == null)
            {
                _counterSignRoleList = new List <CounterSignRole>();
            }

            CounterSignRole newCondition = new CounterSignRole();

            newCondition.StateCode = (cboInfo.SelectedItem as StateType).StateCode;
            if (cbOtherCompany.IsChecked == true)
            {
                newCondition.IsOtherCompany = true;
                newCondition.OtherCompanyId = ((cboOtherCompany.SelectedItem) as SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY).COMPANYID;
            }
            else
            {
                newCondition.IsOtherCompany = false;
                newCondition.OtherCompanyId = "";
            }
            newCondition.StateName = (cboInfo.SelectedItem as StateType).StateName;
            newCondition.TypeCode  = (cboUserType.SelectedItem as UserType).TypeCode;
            newCondition.TypeName  = (cboUserType.SelectedItem as UserType).TypeName;

            _counterSignRoleList.Add(newCondition);
            dgCodition.ItemsSource = null;
            dgCodition.ItemsSource = _counterSignRoleList;
            //增加完后变空
            CompanyName              = "";
            CompanyID                = "";
            btnSearch.IsEnabled      = false;
            cbOtherCompany.IsChecked = false;
        }
Exemplo n.º 3
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (_activityObject == null)
            {
                _activityObject             = new ActivityObject();
                _activityObject.ActivityId  = _activity.UniqueID;
                _activityObject.CounterType = cboRule.SelectedIndex.ToString();
            }
            _activityObject.Remark = this.txtActivityName.Text;
            if (counterSignRoleList == null)
            {
                counterSignRoleList = new List <CounterSignRole>();
            }
            CounterSignRole newCondition = new CounterSignRole();

            if (cboUserType.SelectedItem != null)
            {
                newCondition.TypeCode = (cboUserType.SelectedItem as UserType).TypeCode;
                newCondition.TypeName = (cboUserType.SelectedItem as UserType).TypeName;
            }
            else
            {
                ComfirmWindow.ConfirmationBox("提示信息", "用户类型没有出来,请重新选择!", "确定");
                return;
            }
            _activityObject.IsCounterSign = true;
            newCondition.StateCode        = (cboCountersignRoles.SelectedItem as StateType).StateCode;
            if (cbOtherCompany.IsChecked == true)
            {
                newCondition.IsOtherCompany   = true;
                newCondition.OtherCompanyId   = ((cboOtherCompany.SelectedItem) as SMT.Saas.Tools.OrganizationWS.V_COMPANY).COMPANYID;
                newCondition.OtherCompanyName = ((cboOtherCompany.SelectedItem) as SMT.Saas.Tools.OrganizationWS.V_COMPANY).CNAME;
            }
            else
            {
                newCondition.IsOtherCompany   = false;
                newCondition.OtherCompanyId   = "";
                newCondition.OtherCompanyName = "";
            }
            newCondition.StateName = (cboCountersignRoles.SelectedItem as StateType).StateName;

            _activityObject.IsSpecifyCompany = false;
            _activityObject.OtherCompanyId   = "";
            _activityObject.OtherCompanyName = "";
            _activityObject.RoleId           = "";
            _activityObject.RoleName         = "";
            _activityObject.UserType         = "";
            _activityObject.ActivityId       = "State" + _activity.UniqueID;
            _activityObject.CounterType      = cboRule.SelectedIndex.ToString();
            var item = counterSignRoleList.Where(p => p.StateCode == (cboCountersignRoles.SelectedItem as StateType).StateCode).FirstOrDefault();

            if (item == null)
            {
                counterSignRoleList.Add(newCondition);
                dgCountersign.ItemsSource = null;
                dgCountersign.ItemsSource = counterSignRoleList;
            }
            _activityObject.CounterSignRoleList = counterSignRoleList;
            //if (_activityObject.CounterSignRoleList != null && _activityObject.CounterSignRoleList.Count > 0)
            //{//已有角色
            //    if (item == null)
            //    {
            //        counterSignRoleList.Add(newCondition);
            //        dgCountersign.ItemsSource = null;
            //        dgCountersign.ItemsSource = counterSignRoleList;
            //    }
            //}
            //else
            //{//没有角色
            //    counterSignRoleList.Add(newCondition);
            //    _activityObject.CounterSignRoleList = counterSignRoleList;
            //}
            UpdateActivityObject(_activityObject);
            if (this.chkGroupAudit.IsChecked == true)
            {
                this.txtActivityName.Text = "";
                this.txtActivityName.Text = "会签节点";
            }
        }