Ejemplo n.º 1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (txtMSGCONTENT.Text.Trim() == "")
            {
                ComfirmWindow.ConfirmationBox("提示信息", "消息内容不能为空!", "确定");
                return;
            }
            FLOW_MODELDEFINE_T system = cobSYSTEMCODE.SelectedItem as FLOW_MODELDEFINE_T;
            FLOW_MODELDEFINE_T model  = cobMODELCODE.SelectedItem as FLOW_MODELDEFINE_T;

            if (system.SYSTEMCODE == "0" || model.MODELCODE == "0")
            {
                ComfirmWindow.ConfirmationBox("提示信息", "请正确选择 [系统]和[模块]!", "确定");
                return;
            }
            PlatformService.T_WF_MESSAGEBODYDEFINE entity = new PlatformService.T_WF_MESSAGEBODYDEFINE();
            entity.MESSAGEBODY = ParamOperate.MessageBodyExchange(ListTableColumn.ToList(), true, txtMSGCONTENT.Text);
            entity.MESSAGEURL  = txtURL.Text.Trim();
            entity.SYSTEMCODE  = (cobSYSTEMCODE.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE;
            entity.MODELCODE   = (cobMODELCODE.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE;
            entity.COMPANYID   = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            entity.RECEIVETYPE = this.rBRole.IsChecked == true ? 0 : 1;
            if (entity.RECEIVETYPE == 0 && OrgObjPost != null && OrgObjPost.Count > 0)
            {
                foreach (var item in OrgObjPost)
                {
                    entity.RECEIVEPOSTID   += item.ObjectID + ",";
                    entity.RECEIVEPOSTNAME += item.ObjectName + ",";
                }
                entity.RECEIVEPOSTID   = entity.RECEIVEPOSTID.TrimEnd(',');
                entity.RECEIVEPOSTNAME = entity.RECEIVEPOSTNAME.TrimEnd(',');
            }
            else if (entity.RECEIVETYPE == 1 && OrgObj != null && OrgObj.Count > 0)
            {
                foreach (var item in OrgObj)
                {
                    entity.RECEIVERUSERID   += item.ObjectID + ",";
                    entity.RECEIVERUSERNAME += item.ObjectName + ",";
                }
                entity.RECEIVERUSERID   = entity.RECEIVERUSERID.TrimEnd(',');
                entity.RECEIVERUSERNAME = entity.RECEIVERUSERNAME.TrimEnd(',');
            }
            if (ActionType == "0")
            {
                entity.DEFINEID       = Guid.NewGuid().ToString();
                entity.CREATEDATE     = DateTime.Now;
                entity.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                entity.CREATEUSERID   = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                entity.COMPANYID      = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                messageClient.AddDefaultMessgeAsync(entity);
            }
            else
            {
                entity.DEFINEID = DEFINEID;
                messageClient.EditDefaultMessgeAsync(entity);
            }
            //this.DialogResult = true;
        }
Ejemplo n.º 2
0
 private void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     PlatformService.T_WF_MESSAGEBODYDEFINE entity = DataGridDefaultMessage.SelectedItem as PlatformService.T_WF_MESSAGEBODYDEFINE;
     if (entity != null)
     {
         DefaultMessgeEdit edit = new DefaultMessgeEdit("1", entity.DEFINEID);
         edit.SaveCompleted += (obj, ev) =>
         {//保存成功,重新绑定
             BindDefaultGridData();
         };
         edit.appSystem = appSystem;
         edit.appModel  = appModel;
         edit.cobMODELCODE.ItemsSource    = this.cbModelCode.ItemsSource;
         edit.cobMODELCODE.SelectedIndex  = 0;
         edit.cobSYSTEMCODE.ItemsSource   = this.cbSystemCode.ItemsSource;
         edit.cobSYSTEMCODE.SelectedIndex = 0;
         edit.Show();
     }
     else
     {
         ComfirmWindow.ConfirmationBox("提示信息", "请选择一条记录进行修改!", "确定");
     }
 }
Ejemplo n.º 3
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (txtMSGCONTENT.Text.Trim() == "")
            {
                ComfirmWindow.ConfirmationBox("提示信息", "消息内容不能为空!", "确定");
                return;
            }
            FLOW_MODELDEFINE_T system = cobSYSTEMCODE.SelectedItem as FLOW_MODELDEFINE_T;
            FLOW_MODELDEFINE_T model = cobMODELCODE.SelectedItem as FLOW_MODELDEFINE_T;
            if (system.SYSTEMCODE == "0" || model.MODELCODE == "0")
            {
                ComfirmWindow.ConfirmationBox("提示信息", "请正确选择 [系统]和[模块]!", "确定");
                return;
            }
            PlatformService.T_WF_MESSAGEBODYDEFINE entity = new PlatformService.T_WF_MESSAGEBODYDEFINE();
            entity.MESSAGEBODY = ParamOperate.MessageBodyExchange(ListTableColumn.ToList(), true, txtMSGCONTENT.Text);
            entity.MESSAGEURL = txtURL.Text.Trim();
            entity.SYSTEMCODE = (cobSYSTEMCODE.SelectedItem as FLOW_MODELDEFINE_T).SYSTEMCODE;
            entity.MODELCODE = (cobMODELCODE.SelectedItem as FLOW_MODELDEFINE_T).MODELCODE;
            entity.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            entity.RECEIVETYPE = this.rBRole.IsChecked == true ? 0 : 1;
            if (entity.RECEIVETYPE == 0 && OrgObjPost!=null&&OrgObjPost.Count>0)
            {
                foreach (var item in OrgObjPost)
                {
                    entity.RECEIVEPOSTID += item.ObjectID + ",";
                    entity.RECEIVEPOSTNAME += item.ObjectName + ",";
                }
                entity.RECEIVEPOSTID = entity.RECEIVEPOSTID.TrimEnd(',');
                entity.RECEIVEPOSTNAME = entity.RECEIVEPOSTNAME.TrimEnd(',');
            }
            else if (entity.RECEIVETYPE == 1 && OrgObj != null && OrgObj.Count > 0)
            {
                foreach (var item in OrgObj)
                {
                    entity.RECEIVERUSERID += item.ObjectID + ",";
                    entity.RECEIVERUSERNAME += item.ObjectName + ",";
                }
                entity.RECEIVERUSERID = entity.RECEIVERUSERID.TrimEnd(',');
                entity.RECEIVERUSERNAME = entity.RECEIVERUSERNAME.TrimEnd(',');
            }
            if (ActionType == "0")
            {

                entity.DEFINEID = Guid.NewGuid().ToString();
                entity.CREATEDATE = DateTime.Now;
                entity.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                entity.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                entity.COMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                messageClient.AddDefaultMessgeAsync(entity);
            }
            else
            {
                entity.DEFINEID = DEFINEID;
                messageClient.EditDefaultMessgeAsync(entity);
            }
            //this.DialogResult = true;
        }