Esempio n. 1
0
        public DoTaskRuleEdit(FLOW_MODELDEFINE_T system, FLOW_MODELDEFINE_T model, PlatformService.T_WF_DOTASKRULEDETAIL entity, string ruleID)
        {
            InitializeComponent();
            XmlClient = new FlowXmlDefineClient();
            string strMsgOpen = string.Empty;
            RuleID = ruleID;

            XmlClient.ListFuncTableColumnCompleted += new EventHandler<ListFuncTableColumnCompletedEventArgs>(XmlClient_ListFuncTableColumnCompleted);

            client.EditDoTaskRuleDetailCompleted += new EventHandler<EditDoTaskRuleDetailCompletedEventArgs>(client_EditDoTaskRuleDetailCompleted);
            client.AddDoTaskRuleDetailCompleted += new EventHandler<AddDoTaskRuleDetailCompletedEventArgs>(client_AddDoTaskRuleDetailCompleted);
            //加载子系统xml
            //XmlClient.ListModelCompleted += new EventHandler<ListModelCompletedEventArgs>(clientXml_ListModelCompleted);
            if (system != null && model != null)
            {
                XmlClient.ListFuncTableColumnAsync(XmlUtils.GetSystemPath(system.SYSTEMCODE), model.MODELCODE, strMsgOpen);
            }
            if (entity != null)
            {
                Entity = entity;

                InitDetail();
            }
            else
            {
                txtAvailabilityProcessDates.Text = "3";
            }
            if (chkIsMsg.IsChecked == true)
            {
                SetIsEnabled(false);
            }
        }
Esempio n. 2
0
        public DoTaskRuleEdit(FLOW_MODELDEFINE_T system, FLOW_MODELDEFINE_T model, PlatformService.T_WF_DOTASKRULEDETAIL entity, string ruleID)
        {
            InitializeComponent();
            XmlClient = new FlowXmlDefineClient();
            string strMsgOpen = string.Empty;

            RuleID = ruleID;

            XmlClient.ListFuncTableColumnCompleted += new EventHandler <ListFuncTableColumnCompletedEventArgs>(XmlClient_ListFuncTableColumnCompleted);

            client.EditDoTaskRuleDetailCompleted += new EventHandler <EditDoTaskRuleDetailCompletedEventArgs>(client_EditDoTaskRuleDetailCompleted);
            client.AddDoTaskRuleDetailCompleted  += new EventHandler <AddDoTaskRuleDetailCompletedEventArgs>(client_AddDoTaskRuleDetailCompleted);
            //加载子系统xml
            //XmlClient.ListModelCompleted += new EventHandler<ListModelCompletedEventArgs>(clientXml_ListModelCompleted);
            if (system != null && model != null)
            {
                XmlClient.ListFuncTableColumnAsync(XmlUtils.GetSystemPath(system.SYSTEMCODE), model.MODELCODE, strMsgOpen);
            }
            if (entity != null)
            {
                Entity = entity;

                InitDetail();
            }
            else
            {
                txtAvailabilityProcessDates.Text = "3";
            }
            if (chkIsMsg.IsChecked == true)
            {
                SetIsEnabled(false);
            }
        }
Esempio n. 3
0
        private void btnDetailEdit_Click(object sender, RoutedEventArgs e)
        {
            PlatformService.T_WF_DOTASKRULEDETAIL Detail = DoTaskRuleDetailDataGrid.SelectedItem as PlatformService.T_WF_DOTASKRULEDETAIL;
            if (Detail == null)
            {
                ComfirmWindow.ConfirmationBox("提示信息", "请选择一条需要修改的记录!", "确定");
                return;
            }
            if (this.cbSystemName.SelectedItem != null && this.cbModelName.SelectedItem != null)
            {
                DoTaskRuleEdit edit = new DoTaskRuleEdit(this.cbSystemName.SelectedItem as FLOW_MODELDEFINE_T, this.cbModelName.SelectedItem as FLOW_MODELDEFINE_T, Detail, Rule.DOTASKRULEID);
                edit.SaveClick += (obj, ev) =>
                {
                    client.GetDoTaskRuleDetailAsync(Rule.DOTASKRULEID);
                };
                edit.cbSystemCode.ItemsSource       = this.cbSystemName.ItemsSource;
                edit.cbModelCode.ItemsSource        = this.cbModelName.ItemsSource;
                edit.cbOtherSystemCode1.ItemsSource = this.cbSystemName.ItemsSource;
                edit.appSystem = appSystem;
                edit.appModel  = appModel;

                if (Detail != null)
                {
                    if (!string.IsNullOrEmpty(Detail.OTHERSYSTEMCODE))
                    {
                        for (int i = 0; i < this.cbSystemName.Items.Count; i++)
                        {
                            if (((this.cbSystemName.Items[i]) as AppSystem).Name == Detail.OTHERSYSTEMCODE)
                            {
                                edit.cbOtherSystemCode1.SelectedIndex = i;
                            }
                        }
                    }
                    else
                    {
                        edit.cbOtherSystemCode1.SelectedIndex = 0;
                    }
                }
                edit.cbModelCode.SelectedItem  = this.cbModelName.SelectedItem;
                edit.cbSystemCode.SelectedItem = this.cbSystemName.SelectedItem;
                edit.Show();
            }
            else
            {
                ComfirmWindow.ConfirmationBox("提示信息", "系统或者模块未选择!", "确定");
            }
        }
Esempio n. 4
0
 private void btnDetailDelete_Click(object sender, RoutedEventArgs e)
 {
     if (DoTaskRuleDetailDataGrid.SelectedItems.Count == 1)
     {
         string Result = "";
         PlatformService.T_WF_DOTASKRULEDETAIL Detail = DoTaskRuleDetailDataGrid.SelectedItem as PlatformService.T_WF_DOTASKRULEDETAIL;
         ComfirmWindow com = new ComfirmWindow();
         com.OnSelectionBoxClosed += (obj, result) =>
         {
             client.DeleteDoTaskRuleDetailAsync(Detail.DOTASKRULEDETAILID);
         };
         com.SelectionBox("删除确定", "你确定删除选中信息吗?", ComfirmWindow.titlename, Result);
     }
     else if (DoTaskRuleDetailDataGrid.SelectedItems.Count > 1)
     {
         ComfirmWindow.ConfirmationBox("提示信息", "只能选择一条需要删除的数据!", "确定");
     }
     else
     {
         ComfirmWindow.ConfirmationBox("提示信息", "请选择要删除的数据!", "确定");
     }
 }
Esempio n. 5
0
        private T_WF_DOTASKRULEDETAIL GetDetail(string action)
        {
            if (action == "0")
            {
                Entity = new T_WF_DOTASKRULEDETAIL();
                Entity.DOTASKRULEDETAILID = Guid.NewGuid().ToString();
            }
            Entity.DOTASKRULEID = RuleID;
            Entity.COMPANYID = Utility.CurrentUser.OWNERCOMPANYID;
            Entity.OWNERCOMPANYID = Utility.CurrentUser.OWNERCOMPANYID;
            Entity.CREATEUSERID = Utility.CurrentUser.OWNERID;
            Entity.OWNERDEPARTMENTID = Utility.CurrentUser.OWNERDEPARTMENTID;
            Entity.CREATEUSERNAME = Utility.CurrentUser.USERNAME;

            Entity.SYSTEMCODE = ((cbSystemCode.SelectedItem) as FLOW_MODELDEFINE_T).SYSTEMCODE;
            Entity.SYSTEMNAME = ((cbSystemCode.SelectedItem) as FLOW_MODELDEFINE_T).SYSTEMNAME;
            Entity.MODELCODE = ((cbModelCode.SelectedItem) as FLOW_MODELDEFINE_T).MODELCODE;
            Entity.MODELNAME = ((cbModelCode.SelectedItem) as FLOW_MODELDEFINE_T).DESCRIPTION;
            if (txtMessageBody.Text.Replace(" ", "") != "")
            {
                Entity.MESSAGEBODY = ParamOperate.MessageBodyExchange(ListTableColumn.ToList(), true, txtMessageBody.Text);
            }
            else
            {
                ComfirmWindow.ConfirmationBox("提示信息", "触发规则中消息定义不能为空!", "确定");
                return null;
            }
            if (txtAvailabilityProcessDates.Text != null)
            {
                if (Regex.IsMatch(txtAvailabilityProcessDates.Text.ToString(), @"^\d+$"))
                {
                    Entity.LASTDAYS = int.Parse(txtAvailabilityProcessDates.Text);
                }
                else
                {
                    ComfirmWindow.ConfirmationBox("提示信息", "有效处理日期格式不正确!请输入正确格式!", "确定");
                    return null;
                }
            }
            else
            {
                Entity.LASTDAYS = 3;
            }
            if (this.txtReceiveUser.Text.Trim() != "" && OrgObj != null)
            {
                Entity.OWNERPOSTID = OrgObj.ObjectID;
                Entity.RECEIVEUSERNAME = OrgObj.ObjectName;
            }
            Entity.ISDEFAULTMSG = chkIsMsg.IsChecked == true ? 1 : 0;
            Entity.APPLICATIONURL = MsgOpen;
            if (chkOther.IsChecked == true)
            {
                Entity.ISOTHERSOURCE = "1";
                Entity.OTHERSYSTEMCODE = (cbOtherSystemCode1.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE;
                Entity.OTHERMODELCODE = (cbotherModelCode1.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE;
            }
            else
            {
                Entity.ISOTHERSOURCE = "0";
                Entity.OTHERSYSTEMCODE = "";
                Entity.OTHERMODELCODE = "";
            }
            if (RowList.ItemsSource != null)
            {
                AppFunc func = this.cmbFunc.SelectedItem as AppFunc;
                if (func != null)
                {
                    Entity.FUNCTIONNAME = func.FuncName;
                    Entity.FUNCTIONPARAMTER = ParamOperate.CollectionToString(listpatrm);
                    Entity.WCFURL = func.Address;
                    Entity.WCFBINDINGCONTRACT = func.Binding;
                    Entity.PAMETERSPLITCHAR = func.SplitChar;
                }
            }
            return Entity;
        }
Esempio n. 6
0
        private T_WF_DOTASKRULEDETAIL GetDetail(string action)
        {
            if (action == "0")
            {
                Entity = new T_WF_DOTASKRULEDETAIL();
                Entity.DOTASKRULEDETAILID = Guid.NewGuid().ToString();
            }
            Entity.DOTASKRULEID      = RuleID;
            Entity.COMPANYID         = Utility.CurrentUser.OWNERCOMPANYID;
            Entity.OWNERCOMPANYID    = Utility.CurrentUser.OWNERCOMPANYID;
            Entity.CREATEUSERID      = Utility.CurrentUser.OWNERID;
            Entity.OWNERDEPARTMENTID = Utility.CurrentUser.OWNERDEPARTMENTID;
            Entity.CREATEUSERNAME    = Utility.CurrentUser.USERNAME;

            Entity.SYSTEMCODE = ((cbSystemCode.SelectedItem) as FLOW_MODELDEFINE_T).SYSTEMCODE;
            Entity.SYSTEMNAME = ((cbSystemCode.SelectedItem) as FLOW_MODELDEFINE_T).SYSTEMNAME;
            Entity.MODELCODE  = ((cbModelCode.SelectedItem) as FLOW_MODELDEFINE_T).MODELCODE;
            Entity.MODELNAME  = ((cbModelCode.SelectedItem) as FLOW_MODELDEFINE_T).DESCRIPTION;
            if (txtMessageBody.Text.Replace(" ", "") != "")
            {
                Entity.MESSAGEBODY = ParamOperate.MessageBodyExchange(ListTableColumn.ToList(), true, txtMessageBody.Text);
            }
            else
            {
                ComfirmWindow.ConfirmationBox("提示信息", "触发规则中消息定义不能为空!", "确定");
                return(null);
            }
            if (txtAvailabilityProcessDates.Text != null)
            {
                if (Regex.IsMatch(txtAvailabilityProcessDates.Text.ToString(), @"^\d+$"))
                {
                    Entity.LASTDAYS = int.Parse(txtAvailabilityProcessDates.Text);
                }
                else
                {
                    ComfirmWindow.ConfirmationBox("提示信息", "有效处理日期格式不正确!请输入正确格式!", "确定");
                    return(null);
                }
            }
            else
            {
                Entity.LASTDAYS = 3;
            }
            if (this.txtReceiveUser.Text.Trim() != "" && OrgObj != null)
            {
                Entity.OWNERPOSTID     = OrgObj.ObjectID;
                Entity.RECEIVEUSERNAME = OrgObj.ObjectName;
            }
            Entity.ISDEFAULTMSG   = chkIsMsg.IsChecked == true ? 1 : 0;
            Entity.APPLICATIONURL = MsgOpen;
            if (chkOther.IsChecked == true)
            {
                Entity.ISOTHERSOURCE   = "1";
                Entity.OTHERSYSTEMCODE = (cbOtherSystemCode1.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE;
                Entity.OTHERMODELCODE  = (cbotherModelCode1.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE;
            }
            else
            {
                Entity.ISOTHERSOURCE   = "0";
                Entity.OTHERSYSTEMCODE = "";
                Entity.OTHERMODELCODE  = "";
            }
            if (RowList.ItemsSource != null)
            {
                AppFunc func = this.cmbFunc.SelectedItem as AppFunc;
                if (func != null)
                {
                    Entity.FUNCTIONNAME       = func.FuncName;
                    Entity.FUNCTIONPARAMTER   = ParamOperate.CollectionToString(listpatrm);
                    Entity.WCFURL             = func.Address;
                    Entity.WCFBINDINGCONTRACT = func.Binding;
                    Entity.PAMETERSPLITCHAR   = func.SplitChar;
                }
            }
            return(Entity);
        }