Example #1
0
        private void SaveData()
        {
            //保存任务
            NowTask.TaskName = tbxTaskName.Text;
            NowTask.Description = tbxTaskDes.Text;
            NowTask.IsJumpSelf = cbxJumpSelf.Checked;
            if (rbtShareUser.Checked)
                NowTask.OperRule = "1";
            else
                if (rbtEveryUser.Checked)
                    NowTask.OperRule = "2";
            if (cbxReturn.Checked)
                NowTask.haveback = true;
            else
                NowTask.haveback = false;
            NowTask.SaveUpdateTask();
            WorkFlowTask.DeleteAllOperator(NowTask.TaskId);
            //保存处理者
            foreach (ListViewItem lt in lvOper.Items)
            {
                Operator oper = new Operator();
                oper.OperatorId = lt.SubItems[1].Text;
                oper.WorkFlowId = NowTask.WorkFlowId;
                oper.WorkTaskId = NowTask.TaskId;
                oper.Description = lt.Text;
                if (lt.SubItems[2].Text == "包含")
                {
                    oper.InorExclude = true;
                }
                else
                    if (lt.SubItems[2].Text == "排除")
                    {
                        oper.InorExclude = false;
                    }

                oper.OperType = Convert.ToInt16(lt.SubItems[3].Text);
                oper.Relation = Convert.ToInt16(lt.SubItems[4].Text);
                oper.OperContent = lt.SubItems[5].Text;
                oper.OperDisplay = lt.SubItems[6].Text;
                oper.InsertOperator();
            }
            //保存任务变量
            WorkFlowTask.DeleteAllTaskVar(NowTask.TaskId);
            foreach (ListViewItem lt in lvVar.Items)
            {
                bool isSysVar = SystemVarData.isSystemVar(lt.Text);
                if (isSysVar) continue;//跳过系统变量

                TaskVar tmpTaskVar = new TaskVar();
                tmpTaskVar.VarName = lt.Text;
                tmpTaskVar.WorkFlowId = NowTask.WorkFlowId;
                tmpTaskVar.WorkTaskId = NowTask.TaskId;
                tmpTaskVar.TaskVarId = lt.SubItems[1].Text;
                tmpTaskVar.VarType = lt.SubItems[2].Text;
                tmpTaskVar.VarModule = lt.SubItems[3].Text;
                tmpTaskVar.DataBaseName = lt.SubItems[4].Text;
                tmpTaskVar.TableName = lt.SubItems[5].Text;
                tmpTaskVar.TableField = lt.SubItems[6].Text;
                tmpTaskVar.InitValue = lt.SubItems[7].Text;
                tmpTaskVar.AccessType = lt.SubItems[8].Text;
                tmpTaskVar.InsertTaskVar();
            }
            //保存任务命令
            WorkFlowTask.DeleteAllCommands(NowTask.TaskId);
           
            foreach (ListViewItem lt in lvCommand.Items)
            {
                WorkTaskCommands taskCommand = new WorkTaskCommands();
                taskCommand.WorkFlowId = NowTask.WorkFlowId;
                taskCommand.WorkTaskId = NowTask.TaskId;
                taskCommand.CommandName = lt.Text; 
                taskCommand.CommandId =lt.SubItems[1].Text;
                taskCommand.Description = lt.SubItems[2].Text;
                taskCommand.InsertWorkTaskCommands();
            }
            //保存关联表单
            WorkFlowTask.DeleteAllControls(NowTask.TaskId);
            if (UserControlId != "") WorkFlowTask.SetTaskUserCtrls(UserControlId, NowTask.WorkFlowId, NowTask.TaskId);
            //保存关联模块
            WorkFlowTask.DeleteAllModle(NowTask.TaskId);
            if (UserModleId!="") WorkFlowTask.SetTaskUserModle(UserModleId, NowTask.WorkFlowId, NowTask.TaskId);

            //保存控制权限
            WorkFlowTask.DeleteAllPower(NowTask.WorkFlowId, NowTask.TaskId);
            if (cbxReturn.Checked)
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_Return, NowTask.WorkFlowId, NowTask.TaskId);
            if (cbxbindTable.Checked)
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_BindTable, NowTask.WorkFlowId, NowTask.TaskId);
            if (cbxbindTask.Checked)
            {
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_BindTask, NowTask.WorkFlowId, NowTask.TaskId);
                if (comTaskboBox.SelectedItem!=null)
                WorkFlowTask.SetTaskBindTaskContent(((ListItem)comTaskboBox.SelectedItem).ID, NowTask.WorkFlowId, NowTask.TaskId);
            }
            if (cbxAssign.Checked)
            WorkFlowTask.SetTaskPower(WorkConst.WorkTask_Assign, NowTask.WorkFlowId, NowTask.TaskId);
            if (cbxDyAssignNext.Checked)
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_DyAssignNext, NowTask.WorkFlowId, NowTask.TaskId);
            if (cbxRiZhi.Checked)
            {
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_WorkRiZhi, NowTask.WorkFlowId, NowTask.TaskId);
                SaveRiZhiData();
            }
            if (cbxTaskExplore.Checked)
            {
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_WorkExplore, NowTask.WorkFlowId, NowTask.TaskId);
            }
            if (cbxTaskAllExplore.Checked)
            {
                WorkFlowTask.SetTaskPower(WorkConst.WorkTask_WorkAllExplore, NowTask.WorkFlowId, NowTask.TaskId);
            }
            //保存超时配置
            WorkOutTime.Delete(NowTask.TaskId);
            WorkOutTime ot = new WorkOutTime();
            ot.Guid = Guid.NewGuid().ToString();
            ot.WorkFlowId = NowTask.WorkFlowId;
            ot.WorkTaskId = NowTask.TaskId;
            ot.Days =Convert.ToInt16(tbxDay1.Value);
            ot.Days1 = Convert.ToInt16(tbxDay2.Value);
            ot.Days2 = Convert.ToInt16(tbxDay3.Value);
            ot.Hours = Convert.ToInt16(tbxHour1.Value);
            ot.Hours1 = Convert.ToInt16(tbxHour2.Value);
            ot.Hours2 = Convert.ToInt16(tbxHour3.Value);
            ot.Minutes = Convert.ToInt16(tbxMinute1.Value);
            ot.Minutes1 = Convert.ToInt16(tbxMinute2.Value);
            ot.Minutes2 = Convert.ToInt16(tbxMinute3.Value);
            ot.Insert();

            //保存事件
            WorkFlowEvent.Delete(NowTask.TaskId);
            WorkFlowEvent ev = new WorkFlowEvent();
            ev.Guid = Guid.NewGuid().ToString();
            ev.WorkFlowId = NowTask.WorkFlowId;
            ev.WorkTaskId = NowTask.TaskId;
            ev.OtMsg = cbxOtMessage.Checked;
            ev.OtSms = cbxOtSms.Checked;
            ev.OtEmail = cbxOtMail.Checked;
            string us = "";
            if (lbxOtMsgToUsers.Items.Count > 0)
            {
                for (int i = 0; i < lbxOtMsgToUsers.Items.Count - 1; i++)
                {
                    us = us + lbxOtMsgToUsers.Items[i].ToString() + ",";
                }
                us = us + lbxOtMsgToUsers.Items[lbxOtMsgToUsers.Items.Count - 1];
            }
            ev.OtToUsers = us;
            ev.RmMsg = cbxRmMessage.Checked;
            ev.RmEmail = cbxRmMail.Checked;
            ev.RmSms = cbxRmSms.Checked;

            us = "";
            if (lbxRmMsgToUsers.Items.Count > 0)
            {
                for (int i = 0; i < lbxRmMsgToUsers.Items.Count - 1; i++)
                {
                    us = us + lbxRmMsgToUsers.Items[i].ToString() + ",";
                }
                us = us + lbxRmMsgToUsers.Items[lbxRmMsgToUsers.Items.Count - 1];
            }
            ev.RmToUsers = us;
            ev.Insert();
            SaveFJ();
        }
Example #2
0
        private void SaveData()
        {
            //保存任务
            NowTask.TaskName = tbxTaskName.Text;
            NowTask.Description = tbxTaskDes.Text;
          
            if (rbtShareUser.Checked)
                NowTask.OperRule = "1";
            else
                if (rbtEveryUser.Checked)
                    NowTask.OperRule = "2";
            NowTask.SaveUpdateTask();
            WorkFlowTask.DeleteAllOperator(NowTask.TaskId);
            //保存处理者
            foreach (ListViewItem lt in lvOper.Items)
            {
                Operator oper = new Operator();
                oper.OperatorId = lt.SubItems[1].Text;
                oper.WorkFlowId = NowTask.WorkFlowId;
                oper.WorkTaskId = NowTask.TaskId;
                oper.Description = lt.Text;
                if (lt.SubItems[2].Text == "包含")
                {
                    oper.InorExclude = true;
                }
                else
                    if (lt.SubItems[2].Text == "排除")
                    {
                        oper.InorExclude = false;
                    }

                oper.OperType = Convert.ToInt16(lt.SubItems[3].Text);
                oper.Relation = Convert.ToInt16(lt.SubItems[4].Text);
                oper.OperContent = lt.SubItems[5].Text;
                oper.OperDisplay = lt.SubItems[6].Text;
                oper.InsertOperator();
            }
            //保存任务命令
            WorkFlowTask.DeleteAllCommands(NowTask.TaskId);
            foreach (ListViewItem lt in lvCommand.Items)
            {
                WorkTaskCommands taskCommand = new WorkTaskCommands();
                taskCommand.WorkFlowId = NowTask.WorkFlowId;
                taskCommand.WorkTaskId = NowTask.TaskId;
                taskCommand.CommandName = lt.Text;
                taskCommand.CommandId = lt.SubItems[1].Text;
                taskCommand.Description = lt.SubItems[2].Text;
                taskCommand.InsertWorkTaskCommands();
            }

           
            //保存关联表单
            WorkFlowTask.DeleteAllControls(NowTask.TaskId);
            WorkFlowTask.SetTaskUserCtrls(UserControlId, NowTask.WorkFlowId, NowTask.TaskId);

            //保存事件
            WorkFlowEvent.Delete(NowTask.TaskId);
            WorkFlowEvent ev = new WorkFlowEvent();
            ev.Guid = Guid.NewGuid().ToString();
            ev.WorkFlowId = NowTask.WorkFlowId;
            ev.WorkTaskId = NowTask.TaskId;
           
            string us = "";
           
            ev.RmMsg = cbxRmMessage.Checked;
            ev.RmEmail = cbxRmMail.Checked;
            ev.RmSms = cbxRmSms.Checked;

            us = "";
            if (lbxRmMsgToUsers.Items.Count > 0)
            {
                for (int i = 0; i < lbxRmMsgToUsers.Items.Count - 1; i++)
                {
                    us = us + lbxRmMsgToUsers.Items[i].ToString() + ",";
                }
                us = us + lbxRmMsgToUsers.Items[lbxRmMsgToUsers.Items.Count - 1];
            }
            ev.RmToUsers = us;
            ev.Insert();

        }
Example #3
0
        private void InitData()
        {
            tbxTaskName.Text = NowTask.TaskName;
            tbxTaskDes.Text = NowTask.Description;
            cbxJumpSelf.Checked = NowTask.IsJumpSelf;
            if (NowTask.OperRule == "1")
                rbtShareUser.Checked = true;
            else
                if (NowTask.OperRule == "2")
                    rbtEveryUser.Checked = true;

            //*********任务命令
            lvCommand.Columns.Add("处理命令", 200, HorizontalAlignment.Left);
            lvCommand.Columns.Add("CommandId", 0, HorizontalAlignment.Left);
            lvCommand.Columns.Add("描述", 100, HorizontalAlignment.Left);
            DataTable taskCommand = WorkFlowTask.GetTaskCommands(NowTask.WorkFlowId, NowTask.TaskId);
            foreach (DataRow dr in taskCommand.Rows)
            {
                ListViewItem lvi1 = new ListViewItem(dr["CommandName"].ToString(), 0);
                lvi1.SubItems.Add(dr["CommandId"].ToString());
                lvi1.SubItems.Add(dr["Description"].ToString());

                lvCommand.Items.Add(lvi1);
            }

            //*********处理者
            lvOper.Columns.Add("处理者信息", 200, HorizontalAlignment.Left);
            lvOper.Columns.Add("OperatorId", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("包含/排除", 100, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理类型", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理策略", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理者", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("operDisplay", 0, HorizontalAlignment.Left);
            DataTable OperTable = WorkFlowTask.GetTaskOperator(NowTask.WorkFlowId, NowTask.TaskId);
            foreach (DataRow dr in OperTable.Rows)
            {
                ListViewItem lvi1 = new ListViewItem(dr["Description"].ToString(), 0);
                lvi1.SubItems.Add(dr["OperatorId"].ToString());
                if (Convert.ToBoolean(dr["InorExclude"]))
                    lvi1.SubItems.Add("包含");
                else
                    lvi1.SubItems.Add("排除");
                lvi1.SubItems.Add(dr["OperType"].ToString());
                lvi1.SubItems.Add(dr["Relation"].ToString());
                lvi1.SubItems.Add(dr["OperContent"].ToString());
                lvi1.SubItems.Add(dr["operDisplay"].ToString());
                lvOper.Items.Add(lvi1);
            }

            //*********变量
            lvVar.Columns.Add("变量名", 200, HorizontalAlignment.Left);
            lvVar.Columns.Add("TaskVarId", 0, HorizontalAlignment.Left);
            lvVar.Columns.Add("变量类型", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("变量模式", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("数据库名", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("数据表名", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("字段名", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("初始值", 100, HorizontalAlignment.Left);
            lvVar.Columns.Add("访问类型", 100, HorizontalAlignment.Left);
            List<SystemVarItem> sysVarItem = SystemVarData.GetSystemVarItems();
            foreach (SystemVarItem var in sysVarItem)
            {
                ListViewItem lvi1 = new ListViewItem(var.VarName, 0);
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add(var.VarType);
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add("");
                lvi1.SubItems.Add("");
                lvi1.ForeColor = Color.Red;
                lvVar.Items.Add(lvi1);
            }
            DataTable VarTable = WorkFlowTask.GetTaskVar(NowTask.TaskId);
            foreach (DataRow dr in VarTable.Rows)
            {
                ListViewItem lvi1 = new ListViewItem(dr["VarName"].ToString(), 0);
                lvi1.SubItems.Add(dr["TaskVarId"].ToString());
                lvi1.SubItems.Add(dr["VarType"].ToString());
                lvi1.SubItems.Add(dr["VarModule"].ToString());
                lvi1.SubItems.Add(dr["DataBaseName"].ToString());
                lvi1.SubItems.Add(dr["TableName"].ToString());
                lvi1.SubItems.Add(dr["TableField"].ToString());
                lvi1.SubItems.Add(dr["InitValue"].ToString());
                lvi1.SubItems.Add(dr["AccessType"].ToString());
                lvVar.Items.Add(lvi1);
            }
            //*********模块
            DataTable modleTable = WorkFlowTask.GetTaskModle(NowTask.TaskId);
            if (modleTable != null && modleTable.Rows.Count > 0)
            {
                tbxModleName.Text = modleTable.Rows[0]["ModuName"].ToString();
                UserModleId = modleTable.Rows[0]["Modu_ID"].ToString();
                mModule obj = MainHelper.PlatformSqlMap.GetOneByKey<mModule>(UserModleId);
                object fromCtrl = CreatNewMoldeIns(obj.AssemblyFileName, obj.ModuTypes, obj.MethodName, obj.ModuName);

                if (fromCtrl.GetType().GetProperty("VarDbTableName") != null && fromCtrl.GetType().GetProperty("VarDbTableName").GetValue(fromCtrl, null) != null)
                    varDbTableName = fromCtrl.GetType().GetProperty("VarDbTableName").GetValue(fromCtrl, null).ToString();
               
            }
            //*********表单
            DataTable ctrlTable = WorkFlowTask.GetTaskControls(NowTask.TaskId);
            if (ctrlTable != null && ctrlTable.Rows.Count > 0)
            {
                //tbxFormName.Text = ctrlTable.Rows[0]["mucCaption"].ToString();
                //UserControlId = ctrlTable.Rows[0]["UserControlId"].ToString();
                tbxFormName.Text = ctrlTable.Rows[0]["CellName"].ToString();
                UserControlId = ctrlTable.Rows[0]["LPID"].ToString();
            }
            //*********可操作字段
            if (UserControlId != "节点审核")
            {
                IList<WF_TableUsedField> ulist = MainHelper.PlatformSqlMap.GetList<WF_TableUsedField>("SelectWF_TableUsedFieldList", "where UserControlId ='" + UserControlId + "' and WorktaskId='" + NowTask.TaskId + "' and WorkflowId='" + NowTask.WorkFlowId + "'");
                for (int i = 0; i < ulist.Count; i++)
                {
                    if (tbxFiledName.Text == "")
                    {
                        tbxFiledName.Text = ulist[i].FieldName;
                    }
                    else
                    {
                        tbxFiledName.Text += "," + ulist[i].FieldName;

                    }

                }
            }
            else
            {
                label2.Text = "处理(任务命令可用代码{01:提交文件模块,02:手动结束}):";
                tbxFiledName.Text = "不可用";
                tbxFiledName.Tag = null;
                btnSelectCtrls.Enabled = false;
                btnSelctField.Enabled = false;
            }
            //*********控制权限
            DataTable powerTable = WorkFlowTask.GetTaskPower(NowTask.WorkFlowId, NowTask.TaskId);
            string powerStr = "";
            foreach (DataRow dr in powerTable.Rows)
            {
                powerStr = powerStr + dr["PowerName"].ToString()+",";
            }
            cbxReturn.Checked = powerStr.IndexOf(WorkConst.WorkTask_Return) > -1;//退回
            cbxbindTable.Checked = powerStr.IndexOf(WorkConst.WorkTask_BindTable) > -1;//绑定表单内容
            cbxbindTask.Checked = powerStr.IndexOf(WorkConst.WorkTask_BindTask) > -1;//基于节点内容
            cbxAssign.Checked = powerStr.IndexOf(WorkConst.WorkTask_Assign) > -1;//指派
            cbxRiZhi.Checked = powerStr.IndexOf(WorkConst.WorkTask_WorkRiZhi) > -1;//工作日志
            cbxDyAssignNext.Checked = powerStr.IndexOf(WorkConst.WorkTask_DyAssignNext) > -1;//动态指定下一任务处理人
            cbxTaskExplore.Checked = powerStr.IndexOf(WorkConst.WorkTask_WorkExplore) > -1;//允许导出
            cbxTaskAllExplore.Checked = powerStr.IndexOf(WorkConst.WorkTask_WorkAllExplore) > -1;//允许所有人导出
            iniBindTask();
            //*********日志控制
            iniRiZhiData();
            //********* 超时配置
            WorkOutTime ot = new WorkOutTime();
            ot.GetWorkOutTimeInfo(NowTask.TaskId);
            tbxDay1.Value = ot.Days;
            tbxDay2.Value = ot.Days1;
            tbxDay3.Value = ot.Days2;
            tbxHour1.Value = ot.Hours;
            tbxHour2.Value = ot.Hours1;
            tbxHour3.Value = ot.Hours2;
            tbxMinute1.Value = ot.Minutes;
            tbxMinute2.Value = ot.Minutes1;
            tbxMinute3.Value = ot.Minutes2;

            //********* 事件通知
            WorkFlowEvent ev = new WorkFlowEvent();
            ev.GetWorkFlowEventInfo(NowTask.TaskId);
            cbxOtMail.Checked = ev.OtEmail;
            cbxOtMessage.Checked = ev.OtMsg;
            cbxOtSms.Checked = ev.OtSms;
            string[] us= ev.OtToUsers.Split(',');
            foreach (string usr in us)
            {
                if (usr.Length>0)
                lbxOtMsgToUsers.Items.Add(usr);
            }
            cbxRmMail.Checked = ev.RmEmail;
            cbxRmMessage.Checked = ev.RmMsg;
            cbxRmSms.Checked = ev.RmSms;

            us = ev.RmToUsers.Split(',');
            foreach (string usr in us)
            {
                if (usr.Length > 0)
                lbxRmMsgToUsers.Items.Add(usr);
            }

            #region 附件
            downFileControltwo1.FormType = "上传";
            downFileControltwo1.RecordID = NowTask.TaskId;
            downFileControltwo1.UpfilePath = NowTask.TaskId;
            #endregion
        }
Example #4
0
        private void InitData()
        {
            tbxTaskName.Text = NowTask.TaskName;
            tbxTaskDes.Text = NowTask.Description;
         
            if (NowTask.OperRule == "1")
                rbtShareUser.Checked = true;
            else
                if (NowTask.OperRule == "2")
                    rbtEveryUser.Checked = true;

            //*********任务命令
            lvCommand.Columns.Add("处理命令", 200, HorizontalAlignment.Left);
            lvCommand.Columns.Add("CommandId", 0, HorizontalAlignment.Left);
            lvCommand.Columns.Add("描述", 100, HorizontalAlignment.Left);
            DataTable taskCommand = WorkFlowTask.GetTaskCommands(NowTask.WorkFlowId, NowTask.TaskId);
            foreach (DataRow dr in taskCommand.Rows)
            {
                ListViewItem lvi1 = new ListViewItem(dr["CommandName"].ToString(), 0);
                lvi1.SubItems.Add(dr["CommandId"].ToString());
                lvi1.SubItems.Add(dr["Description"].ToString());

                lvCommand.Items.Add(lvi1);
            }

            //*********处理者
            lvOper.Columns.Add("处理者信息", 200, HorizontalAlignment.Left);
            lvOper.Columns.Add("OperatorId", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("包含/排除", 100, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理类型", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理策略", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("处理者", 0, HorizontalAlignment.Left);
            lvOper.Columns.Add("operDisplay", 0, HorizontalAlignment.Left);
            DataTable OperTable = WorkFlowTask.GetTaskOperator(NowTask.WorkFlowId, NowTask.TaskId);
            foreach (DataRow dr in OperTable.Rows)
            {
                ListViewItem lvi1 = new ListViewItem(dr["Description"].ToString(), 0);
                lvi1.SubItems.Add(dr["OperatorId"].ToString());
                if (Convert.ToBoolean(dr["InorExclude"]))
                    lvi1.SubItems.Add("包含");
                else
                    lvi1.SubItems.Add("排除");
                lvi1.SubItems.Add(dr["OperType"].ToString());
                lvi1.SubItems.Add(dr["Relation"].ToString());
                lvi1.SubItems.Add(dr["OperContent"].ToString());
                lvi1.SubItems.Add(dr["operDisplay"].ToString());
                lvOper.Items.Add(lvi1);
            }

          
            //*********表单
            DataTable ctrlTable = WorkFlowTask.GetTaskControls(NowTask.TaskId);
            if (ctrlTable != null && ctrlTable.Rows.Count > 0)
            {
                tbxFormName.Text = ctrlTable.Rows[0]["mucCaption"].ToString();
                UserControlId = ctrlTable.Rows[0]["UserControlId"].ToString();
            }
            

            //********* 事件通知
            WorkFlowEvent ev = new WorkFlowEvent();
            ev.GetWorkFlowEventInfo(NowTask.TaskId);
            
            cbxRmMail.Checked = ev.RmEmail;
            cbxRmMessage.Checked = ev.RmMsg;
            cbxRmSms.Checked = ev.RmSms;

           string[]  us = ev.RmToUsers.Split(',');
            foreach (string usr in us)
            {
                if (usr.Length > 0)
                    lbxRmMsgToUsers.Items.Add(usr);
            }

        }