Esempio n. 1
0
        public void CreateResend(int activityInstId, int workerId, string remark)
        {
            m_ActivityInstance = new ActivityInstance(activityInstId);
            m_State            = WorkItemState.Waiting;


            m_WorkItemId = PrimaryKeyCreater.getIntPrimaryKey("F_INST_WORKITEM");

            F_INST_WORKITEM instWorkItem = new F_INST_WORKITEM();

            instWorkItem.ID             = m_WorkItemId;
            instWorkItem.ActivityInstID = activityInstId;
            instWorkItem.Actorid        = workerId;
            instWorkItem.Role           = "申请人重新送出";
            instWorkItem.Assigneeid     = workerId;
            instWorkItem.Assignerid     = 0;
            instWorkItem.BeginDate      = DateTime.Now;
            instWorkItem.EndDate        = DateTime.Now;
            instWorkItem.State          = WorkItemState.Completed;
            instWorkItem.AppType        = WorkItemApproveType.Blank;
            instWorkItem.AssignType     = WorkItemAssignType.Normal;
            instWorkItem.AppValue       = string.Empty;
            instWorkItem.AppRemark      = remark;

            DAL.WorkFlow.WorkItemInstance.Insert(instWorkItem);
        }
Esempio n. 2
0
        public static E_Mail CreateMail(string title, string content, string toID)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                E_Mail mail = new E_Mail();

                //邮件主表
                mail.ID         = PrimaryKeyCreater.getIntPrimaryKey("E_Mail");
                mail.From       = "系统";
                mail.Title      = title;
                mail.Body       = content;
                mail.CreateTime = DateTime.Now;
                mail.SendDate   = DateTime.Now;

                List <string> toStr = new List <string>();
                foreach (string r in toID.Split(',').ToList())
                {
                    int    id   = int.Parse(r); //人员ID
                    string name = dbContext.B_WORKER.FirstOrDefault(b => b.ID == id).Name;
                    toStr.Add(name);
                }
                mail.To = String.Join(",", toStr);

                return(mail);
            }
        }
Esempio n. 3
0
        public int CreateFlowNo(int flowId)
        {
            //IApplicationContext ctx = ContextRegistry.GetContext();
            //IPrimaryKeyCreater prikey = ctx["PrimaryKeyCreater"] as IPrimaryKeyCreater;

            //m_FlowNo = prikey.getIntPrimaryKey(string.Format("TB_{0}", flowId));
            return(PrimaryKeyCreater.getIntPrimaryKey("FlowNo"));
        }
Esempio n. 4
0
        public void Create(int activityInstId, int transId)
        {
            m_Transation       = new Transation(transId);
            m_ActivityInstance = new ActivityInstance(activityInstId);

            //IPrimaryKeyCreater prikey = ctx["PrimaryKeyCreater"] as IPrimaryKeyCreater;

            m_TransationInstanceId = PrimaryKeyCreater.getIntPrimaryKey("F_INST_TRANSATION");

            F_INST_TRANSATION instTrans = new F_INST_TRANSATION();

            instTrans.ID              = m_TransationInstanceId;
            instTrans.ActivityInstID  = activityInstId;
            instTrans.TransationID    = transId;
            instTrans.PassTime        = DateTime.Now;
            instTrans.TransationValue = "";

            DAL.WorkFlow.TransationInstance.Insert(instTrans);
        }
Esempio n. 5
0
        public static bool Save(TAmbulance entity)
        {
            using (MainDataContext dbContext = new MainDataContext(AppConfig.ConnectionStringDispatch))
            {
                if (entity.车辆编码 == "0")  //添加
                {
                    entity.车辆编码      = PrimaryKeyCreater.getIntPrimaryKey("TAmbulance").ToString("00000");
                    entity.分站编码      = entity.分站编码.PadLeft(3, '0');
                    entity.命令单发送去向编码 = 5;
                    entity.任务编码      = "";
                    entity.任务流水号     = 0;
                    entity.用户流水号     = "";
                    entity.工作状态编码    = 8;
                    entity.当班执行任务数   = 0;
                    entity.司机        = "";
                    entity.医生        = "";
                    entity.护士        = "";
                    entity.担架工       = "";
                    entity.抢救员       = "";
                    entity.是否在线      = false;
                    entity.是否有效      = true;
                    entity.顺序号       = 999;

                    dbContext.TAmbulance.InsertOnSubmit(entity);
                    dbContext.SubmitChanges();
                    return(true);
                }
                else  //修改
                {
                    var model = dbContext.TAmbulance.FirstOrDefault(t => t.车辆编码 == entity.车辆编码);
                    model.分站编码   = entity.分站编码 == "0" ? "000" : entity.分站编码;
                    model.随车电话   = entity.随车电话;
                    model.实际标识   = entity.实际标识;
                    model.车牌号码   = entity.车牌号码;
                    model.车辆等级编码 = entity.车辆等级编码;
                    model.车辆类型编码 = entity.车辆类型编码;
                    dbContext.SubmitChanges();
                    return(true);
                }
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 创建关卡实例
        /// </summary>
        /// <param name="instFlow"></param>
        /// <param name="activity"></param>
        /// <returns></returns>
        public void Create(int flowInstId, int activityId)
        {
            this.FlowInstance = new FlowInstance(flowInstId);
            this.Activity     = new Activity(activityId);
            this.State        = ActivityInstanceStatus.InActive;

            //新增关卡实例
            //IPrimaryKeyCreater prikey = ctx["PrimaryKeyCreater"] as IPrimaryKeyCreater;
            m_ActivityInstanceId = PrimaryKeyCreater.getIntPrimaryKey("F_INST_ACTIVITY");

            F_INST_ACTIVITY instActivity = new F_INST_ACTIVITY();

            instActivity.ID         = m_ActivityInstanceId;
            instActivity.ActivityID = activityId;
            instActivity.BeginDate  = DateTime.Now;
            instActivity.EndDate    = null;
            instActivity.FlowInstID = flowInstId;
            instActivity.State      = ActivityInstanceStatus.InActive;

            DAL.WorkFlow.ActivityInstance.Insert(instActivity);
        }
Esempio n. 7
0
        /// <summary>
        /// 创建流程实例
        /// </summary>
        /// <param name="flow"></param>
        /// <returns></returns>
        public void Create(int flowId, int flowNo, int applyerId, string digest)
        {
            m_FlowDefine = new FlowDefine(flowId);

            F_INST_FLOW inst = new F_INST_FLOW();

            //IPrimaryKeyCreater prikey = ctx["PrimaryKeyCreater"] as IPrimaryKeyCreater;

            m_FlowInstanceId = PrimaryKeyCreater.getIntPrimaryKey("F_INST_FLOW");

            inst.ID        = m_FlowInstanceId;
            inst.ApplyerID = applyerId;
            inst.BeginDate = DateTime.Now;
            inst.EndDate   = null;
            inst.FlowID    = flowId;
            inst.State     = FlowInstanceState.InActive;
            inst.FlowNo    = flowNo;
            inst.Digest    = digest;

            DAL.WorkFlow.FlowInstance.Insert(inst);
        }
Esempio n. 8
0
        public void Create(int activityInstId, int workerId)
        {
            m_ActivityInstance = new ActivityInstance(activityInstId);
            m_State            = WorkItemState.Waiting;

            //IPrimaryKeyCreater prikey = ctx["PrimaryKeyCreater"] as IPrimaryKeyCreater;
            m_WorkItemId = PrimaryKeyCreater.getIntPrimaryKey("F_INST_WORKITEM");

            F_INST_WORKITEM instWorkItem = new F_INST_WORKITEM();

            instWorkItem.ID             = m_WorkItemId;
            instWorkItem.ActivityInstID = activityInstId;
            instWorkItem.Actorid        = null;
            instWorkItem.Role           = m_ActivityInstance.Activity.Name;
            instWorkItem.Assigneeid     = workerId;
            instWorkItem.Assignerid     = 0;
            instWorkItem.BeginDate      = DateTime.Now;
            instWorkItem.EndDate        = null;
            instWorkItem.State          = WorkItemState.Waiting;
            instWorkItem.AppType        = WorkItemApproveType.Normal;
            instWorkItem.AssignType     = WorkItemAssignType.Normal;

            DAL.WorkFlow.WorkItemInstance.Insert(instWorkItem);
        }
Esempio n. 9
0
        public static TOffice GetOffice(int?officeId)
        {
            using (MainDataContext dbContext = new MainDataContext())
            {
                if (officeId != null) // 修改
                {
                    return(dbContext.TOffice.FirstOrDefault(t => t.编码 == officeId));
                }
                else   //新增
                {
                    var     list   = dbContext.TOffice.Select(t => t.编码);
                    TOffice entity = new TOffice();
                    entity.编码     = PrimaryKeyCreater.getIntPrimaryKey("TOffice");
                    entity.接收人    = string.Empty;
                    entity.办公类型编码 = string.Empty;
                    entity.标题     = string.Empty;
                    entity.作者     = string.Empty;
                    entity.内容     = string.Empty;
                    entity.创建时间   = DateTime.Now;

                    return(entity);
                }
            }
        }
Esempio n. 10
0
        //
        // GET: /Email/

        #region 写信
        public ActionResult Write(int?pageNumber, int?mailID, string type)
        {
            BLL.Email.Email email = new BLL.Email.Email();

            this.ViewData["WriterID"]   = User.Identity.Name.Split('|')[0];
            this.ViewData["WriterName"] = User.Identity.Name.Split('|')[1];  //发信人

            if (mailID != null)
            {
                if (type == "reply")                                                                        //回复
                {
                    this.ViewData["MailID"]     = PrimaryKeyCreater.getIntPrimaryKey("E_Mail");             //邮件编号
                    this.ViewData["CreateTime"] = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd HH:mm:ss");; //创建时间

                    E_Mail mail = email.GetMailInfo((int)mailID);
                    this.ViewData["To"]    = mail.From;                                  //收件人
                    this.ViewData["Title"] = "回复:" + mail.Title;                         //主题
                    this.ViewData["Body"]  = "<br><hr>" + mail.Body;                     //内容

                    List <E_Mail_Worker> toWorker = email.GetMailWorker((int)mailID, 0); //收件人ID
                    List <int>           toStr    = new List <int>();
                    foreach (E_Mail_Worker w in toWorker)
                    {
                        toStr.Add(w.WorkerId);
                    }
                    this.ViewData["toID"] = String.Join(",", toStr);
                }
                else if (type == "forward")                                                                 //转发
                {
                    this.ViewData["MailID"]     = PrimaryKeyCreater.getIntPrimaryKey("E_Mail");             //邮件编号
                    this.ViewData["CreateTime"] = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd HH:mm:ss");; //创建时间

                    E_Mail mail = email.GetMailInfo((int)mailID);
                    this.ViewData["Title"] = "转发:" + mail.Title;     //主题
                    this.ViewData["Body"]  = "<br><hr>" + mail.Body; //内容
                }
                else //草稿
                {
                    this.ViewData["pageNumber"] = pageNumber;

                    E_Mail mail = email.GetMailInfo((int)mailID);
                    this.ViewData["MailID"]     = mailID;                                //邮件编号
                    this.ViewData["CreateTime"] = mail.CreateTime;                       //创建时间
                    this.ViewData["To"]         = mail.To;                               //收件人
                    this.ViewData["CC"]         = mail.CC == null ? "" : mail.CC;        //抄送
                    //this.ViewData["SC"] = mail.SC;  //密送
                    this.ViewData["Title"] = mail.Title;                                 //主题
                    this.ViewData["Body"]  = mail.Body;                                  //内容

                    List <E_Mail_Worker> toWorker = email.GetMailWorker((int)mailID, 1); //收件人ID
                    List <int>           toStr    = new List <int>();
                    foreach (E_Mail_Worker w in toWorker)
                    {
                        toStr.Add(w.WorkerId);
                    }
                    this.ViewData["toID"] = String.Join(",", toStr);

                    List <E_Mail_Worker> ccWorker = email.GetMailWorker((int)mailID, 2); //抄送人ID
                    List <int>           ccStr    = new List <int>();
                    foreach (E_Mail_Worker w in ccWorker)
                    {
                        ccStr.Add(w.WorkerId);
                    }
                    this.ViewData["ccID"] = String.Join(",", ccStr);
                }
            }
            else
            {
                this.ViewData["MailID"]     = PrimaryKeyCreater.getIntPrimaryKey("E_Mail"); //邮件编号
                this.ViewData["CreateTime"] = DateTime.Now.AddDays(0).ToString("yyyy-MM-dd HH:mm:ss");
                this.ViewData["toID"]       = string.Empty;                                 //收件人ID
                this.ViewData["To"]         = string.Empty;                                 //收件人
                this.ViewData["CC"]         = string.Empty;                                 //抄送
                this.ViewData["ccID"]       = string.Empty;                                 //抄送人ID
                this.ViewData["SC"]         = string.Empty;                                 //密送
                this.ViewData["Title"]      = string.Empty;                                 //主题
                this.ViewData["Body"]       = string.Empty;                                 //内容
            }
            return(View());
        }
Esempio n. 11
0
        /// <summary>
        /// 得到邮件相关人
        /// </summary>
        /// <returns></returns>
        public List <E_Mail_Worker> GetMailWorker(E_Mail entity, string fromID, string toID, string ccID, string isSend)
        {
            List <E_Mail_Worker> mailWorker = new List <E_Mail_Worker>();

            E_Mail_Worker mailS = new E_Mail_Worker();

            //发件人(类型为0)
            mailS.ID       = PrimaryKeyCreater.getIntPrimaryKey("E_Mail_Worker");
            mailS.MailId   = entity.ID;
            mailS.WorkerId = int.Parse(fromID);
            mailS.Type     = 0;
            mailS.ReadFlag = "1";  //默认已读
            if (isSend == "1")
            {
                mailS.FolderID = 3;   //已发送
            }
            else
            {
                mailS.FolderID = 2;   //草稿箱
            }

            mailWorker.Add(mailS);

            //收件人(类型为1)
            foreach (string r in toID.Split(',').ToList())
            {
                E_Mail_Worker mailR = new E_Mail_Worker();
                mailR.ID       = PrimaryKeyCreater.getIntPrimaryKey("E_Mail_Worker");
                mailR.MailId   = entity.ID;
                mailR.WorkerId = int.Parse(r);
                mailR.Type     = 1;
                mailR.ReadFlag = "0";

                if (isSend == "1")
                {
                    mailR.FolderID = 1;   //收件箱
                }
                else
                {
                    mailR.FolderID = 5;   //临时文件夹
                }
                mailWorker.Add(mailR);
            }

            //抄送人(类型为2)
            if (!string.IsNullOrEmpty(ccID))
            {
                foreach (string r in ccID.Split(',').ToList())
                {
                    E_Mail_Worker mailCC = new E_Mail_Worker();
                    mailCC.ID       = PrimaryKeyCreater.getIntPrimaryKey("E_Mail_Worker");
                    mailCC.MailId   = entity.ID;
                    mailCC.WorkerId = int.Parse(r);
                    mailCC.Type     = 2;
                    mailCC.ReadFlag = "0";
                    if (isSend == "1")
                    {
                        mailCC.FolderID = 1;   //收件箱
                    }
                    else
                    {
                        mailCC.FolderID = 5;   //临时文件夹
                    }
                    mailWorker.Add(mailCC);
                }
            }
            return(mailWorker);
        }