Exemple #1
0
        private void getPTDBSJ(string xgid, string Mes, string jsyhdm)
        {
            DataTable table = publicDbOpClass.DataTableQuary(string.Format("\r\n\t\t\t\tSELECT DISTINCT MSG.*, IM.BusinessCode, BC.DoWithUrl\r\n\t\t\t\tFROM WF_RecieveMsg AS MSG\r\n\t\t\t\tJOIN WF_Instance_Main AS IM ON IM.InstanceCode = MSG.InstanceCode\r\n\t\t\t\tJOIN WF_BusinessCode AS BC ON BC.BusinessCode = IM.BusinessCode\r\n\t\t\t\tWHERE MSG.RecordID='{0}'\r\n\t\t\t", xgid));

            if (table.Rows.Count > 0)
            {
                PTDBSJ model = new PTDBSJ {
                    V_LXBM    = "014",
                    I_XGID    = xgid,
                    DTM_DBSJ  = DateTime.Now,
                    V_Content = Mes
                };
                string str2 = table.Rows[0]["DoWithUrl"].ToString().TrimStart(new char[] { '/' });
                if (!str2.Contains("?"))
                {
                    model.V_DBLJ = str2 + "?ic=" + table.Rows[0]["InstanceCode"].ToString();
                }
                else
                {
                    model.V_DBLJ = str2 + "&ic=" + table.Rows[0]["InstanceCode"].ToString();
                }
                model.V_YHDM = jsyhdm;
                PublicInterface.SendSysMsg(model);
            }
        }
Exemple #2
0
    private void SendDbsj(System.Collections.Generic.Dictionary <string, string> userCodeMailId)
    {
        this.GetUserList();
        PTDBSJService pTDBSJService = new PTDBSJService();

        foreach (System.Collections.Generic.KeyValuePair <string, string> current in userCodeMailId)
        {
            PTDBSJ pTDBSJ = new PTDBSJ();
            pTDBSJ.I_XGID   = current.Key;
            pTDBSJ.V_LXBM   = "008";
            pTDBSJ.V_YHDM   = current.Key;
            pTDBSJ.DTM_DBSJ = new System.DateTime?(System.DateTime.Now);
            string text = string.Empty;
            if (!string.IsNullOrEmpty(this.txtName.Text))
            {
                text = this.txtName.Text;
            }
            else
            {
                text = "【无主题】";
            }
            if (text.Length > 93)
            {
                text = text.Substring(0, 90) + "...";
            }
            pTDBSJ.V_Content  = "您有新邮件(" + text + ")";
            pTDBSJ.V_TPLJ     = "new_Mail.gif";
            pTDBSJ.V_DBLJ     = "OA2/Mail/MailFrame.aspx?mailId=" + current.Value;
            pTDBSJ.C_OpenFlag = "0";
            pTDBSJService.Add(pTDBSJ);
        }
    }
Exemple #3
0
        public PTDBSJ GetModel(int I_DBSJ_ID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select *  ");
            builder.Append(" I_DBSJ_ID,I_XGID,V_LXBM,V_YHDM,DTM_DBSJ,V_Content,V_TPLJ,V_DBLJ,C_OpenFlag ");
            builder.Append(" from PT_DBSJ ");
            builder.Append(" where I_DBSJ_ID=" + I_DBSJ_ID);
            PTDBSJ  ptdbsj = new PTDBSJ();
            DataSet set    = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["I_DBSJ_ID"].ToString() != "")
            {
                ptdbsj.I_DBSJ_ID = int.Parse(set.Tables[0].Rows[0]["I_DBSJ_ID"].ToString());
            }
            ptdbsj.I_XGID     = set.Tables[0].Rows[0]["I_XGID"].ToString();
            ptdbsj.V_LXBM     = set.Tables[0].Rows[0]["V_LXBM"].ToString();
            ptdbsj.V_YHDM     = set.Tables[0].Rows[0]["V_YHDM"].ToString();
            ptdbsj.DTM_DBSJ   = DateTime.Parse(set.Tables[0].Rows[0]["DTM_DBSJ"].ToString());
            ptdbsj.V_Content  = set.Tables[0].Rows[0]["V_Content"].ToString();
            ptdbsj.V_TPLJ     = set.Tables[0].Rows[0]["V_TPLJ"].ToString();
            ptdbsj.V_DBLJ     = set.Tables[0].Rows[0]["V_DBLJ"].ToString();
            ptdbsj.C_OpenFlag = set.Tables[0].Rows[0]["C_OpenFlag"].ToString();
            return(ptdbsj);
        }
Exemple #4
0
        private void getPTDBSJ(string xgid, string Mes, string jsyhdm)
        {
            PTDBSJ model = new PTDBSJ {
                V_LXBM    = "015",
                I_XGID    = xgid,
                DTM_DBSJ  = DateTime.Now,
                V_Content = Mes,
                V_DBLJ    = "",
                V_YHDM    = jsyhdm
            };

            PublicInterface.SendSysMsg(model);
        }
Exemple #5
0
        public int Update(PTDBSJ model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update PT_DBSJ set ");
            builder.Append("I_XGID='" + model.I_XGID + "',");
            builder.Append("DTM_DBSJ='" + model.DTM_DBSJ + "',");
            builder.Append("V_Content='" + model.V_Content + "',");
            builder.Append("V_TPLJ='" + model.V_TPLJ + "',");
            builder.Append("V_DBLJ='" + model.V_DBLJ + "',");
            builder.Append("C_OpenFlag='" + model.C_OpenFlag + "'");
            builder.Append(" where I_DBSJ_ID=" + model.I_DBSJ_ID);
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Exemple #6
0
        public static int SendSysMsg(PTDBSJ model)
        {
            DataTable table = getTxlxList(model.V_LXBM);

            if (table.Rows.Count > 0)
            {
                model.V_TPLJ = table.Rows[0]["V_TPLJ"].ToString();
                if (model.V_LXBM != "014")
                {
                    model.V_DBLJ = table.Rows[0]["V_DBLJ"].ToString() + model.V_DBLJ;
                }
                model.C_OpenFlag = table.Rows[0]["C_OpenFlag"].ToString();
            }
            return(PTDBSJAdd(model));
        }
Exemple #7
0
        private void SmsOrMessageAdd(OACalendarRemindSet model, int recordid)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(" insert into OA_Calendar_RemindSet(");
            builder.Append("InfoGuid,IsSms,IsMessage,RemindType,RemindHour,RemindMinute,EndDate");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.InfoGuid + "',");
            builder.Append("'" + model.IsSms + "',");
            builder.Append("'" + model.IsMessage + "',");
            builder.Append(model.RemindType + ",");
            builder.Append(model.RemindHour + ",");
            builder.Append(model.RemindMinute + ",");
            builder.Append("'" + model.EndDate + "'");
            builder.Append(")");
            PublicInterface.PTDBSJDelete(recordid.ToString(), "001");
            PublicInterface.PTDBSJTodayDelete(recordid.ToString(), "001");
            PublicInterface.SMSLogDelete(recordid.ToString(), "001");
            PublicInterface.SMSLogTodayDelete(recordid.ToString(), "001");
            if (model.IsSms == "1")
            {
                SMSLog log;
                log = new SMSLog {
                    SendUser    = HttpContext.Current.Session["yhdm"].ToString(),
                    SendTime    = model.EndDate.Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                    ReceiveUser = HttpContext.Current.Session["yhdm"].ToString(),
                    Message     = this.strMessage(recordid),
                    V_LXBM      = "001",
                    I_XGID      = recordid.ToString()
                };
                PublicInterface.SendSmsMsg(log);
            }
            if (model.IsMessage == "1")
            {
                PTDBSJ ptdbsj = new PTDBSJ {
                    V_LXBM    = "001",
                    I_XGID    = recordid.ToString(),
                    DTM_DBSJ  = model.EndDate.Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                    V_Content = this.strMessage(recordid),
                    V_DBLJ    = "?rid=" + recordid,
                    V_YHDM    = HttpContext.Current.Session["yhdm"].ToString()
                };
                PublicInterface.SendSysMsg(ptdbsj);
            }
            publicDbOpClass.ExecSqlString(builder.ToString());
        }
Exemple #8
0
        private static int PTDBSJTodayAdd(PTDBSJ model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into PT_DBSJ_Today(");
            builder.Append("I_XGID,V_LXBM,V_YHDM,DTM_DBSJ,V_Content,V_TPLJ,V_DBLJ,C_OpenFlag");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.I_XGID + "',");
            builder.Append("'" + model.V_LXBM + "',");
            builder.Append("'" + model.V_YHDM + "',");
            builder.Append("'" + model.DTM_DBSJ + "',");
            builder.Append("'" + model.V_Content + "',");
            builder.Append("'" + model.V_TPLJ + "',");
            builder.Append("'" + model.V_DBLJ + "',");
            builder.Append("'" + model.C_OpenFlag + "'");
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
        private void SmsOrMessageAdd(OACalendarRemindSet model, OACalendarInfo model2, DateTime RDate)
        {
            double num4;
            int    num5;
            int    num = 0;

            switch (model.RemindType)
            {
            case 2:
            {
                TimeSpan span = model.EndDate.Date.Subtract(RDate);
                for (int i = 0; i <= span.Days; i++)
                {
                    num = this.CalendarInfoAdd(model2, RDate.AddDays(Convert.ToDouble(i)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute));
                    if (model.IsSms == "1")
                    {
                        SMSLog log;
                        log = new SMSLog {
                            SendUser    = HttpContext.Current.Session["yhdm"].ToString(),
                            SendTime    = RDate.AddDays(Convert.ToDouble(i)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                            ReceiveUser = HttpContext.Current.Session["yhdm"].ToString(),
                            Message     = "日程管理消息:" + model2.Content,
                            V_LXBM      = "001",
                            I_XGID      = num.ToString()
                        };
                        PublicInterface.SendSmsMsg(log);
                    }
                    if (model.IsMessage == "1")
                    {
                        PTDBSJ ptdbsj = new PTDBSJ {
                            V_LXBM     = "001",
                            I_XGID     = num.ToString(),
                            C_OpenFlag = "0",
                            DTM_DBSJ   = RDate.AddDays(Convert.ToDouble(i)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                            V_Content  = model2.Content,
                            V_TPLJ     = "",
                            V_DBLJ     = "?rid=" + num,
                            V_YHDM     = HttpContext.Current.Session["yhdm"].ToString()
                        };
                        PublicInterface.SendSysMsg(ptdbsj);
                    }
                }
                return;
            }

            case 3:
            {
                TimeSpan span2 = model.EndDate.Date.Subtract(RDate);
                for (int j = 0; j <= span2.Days; j++)
                {
                    if (Convert.ToInt32(RDate.AddDays(Convert.ToDouble(j)).DayOfWeek) == Convert.ToInt32(RDate.DayOfWeek))
                    {
                        num = this.CalendarInfoAdd(model2, RDate.AddDays(Convert.ToDouble(j)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute));
                        if (model.IsSms == "1")
                        {
                            SMSLog log2;
                            log2 = new SMSLog {
                                SendUser    = HttpContext.Current.Session["yhdm"].ToString(),
                                SendTime    = RDate.AddDays(Convert.ToDouble(j)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                                ReceiveUser = HttpContext.Current.Session["yhdm"].ToString(),
                                Message     = "日程管理消息:" + model2.Content,
                                V_LXBM      = "001",
                                I_XGID      = num.ToString()
                            };
                            PublicInterface.SendSmsMsg(log2);
                        }
                        if (model.IsMessage == "1")
                        {
                            PTDBSJ ptdbsj2 = new PTDBSJ {
                                V_LXBM     = "001",
                                I_XGID     = num.ToString(),
                                C_OpenFlag = "0",
                                DTM_DBSJ   = RDate.AddDays(Convert.ToDouble(j)).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                                V_Content  = model2.Content,
                                V_TPLJ     = "",
                                V_DBLJ     = "?rid=" + num.ToString(),
                                V_YHDM     = HttpContext.Current.Session["yhdm"].ToString()
                            };
                            PublicInterface.SendSysMsg(ptdbsj2);
                        }
                    }
                }
                return;
            }

            case 4:
                num4 = this.MonthEquals(RDate, model.EndDate);
                num5 = 0;
                break;

            default:
                return;
            }
            while (num5 <= num4)
            {
                num = this.CalendarInfoAdd(model2, RDate.AddMonths(num5).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute));
                if (model.IsSms == "1")
                {
                    SMSLog log3;
                    log3 = new SMSLog {
                        SendUser    = HttpContext.Current.Session["yhdm"].ToString(),
                        SendTime    = RDate.AddMonths(num5).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                        ReceiveUser = HttpContext.Current.Session["yhdm"].ToString(),
                        Message     = "日程管理消息:" + model2.Content,
                        V_LXBM      = "001",
                        I_XGID      = num.ToString()
                    };
                    PublicInterface.SendSmsMsg(log3);
                }
                if (model.IsMessage == "1")
                {
                    PTDBSJ ptdbsj3 = new PTDBSJ {
                        V_LXBM     = "001",
                        I_XGID     = num.ToString(),
                        C_OpenFlag = "0",
                        DTM_DBSJ   = RDate.AddMonths(num5).Date.AddHours((double)model.RemindHour).AddMinutes((double)model.RemindMinute),
                        V_Content  = model2.Content,
                        V_TPLJ     = "",
                        V_DBLJ     = "?rid=" + num.ToString(),
                        V_YHDM     = HttpContext.Current.Session["yhdm"].ToString()
                    };
                    PublicInterface.SendSysMsg(ptdbsj3);
                }
                num5++;
            }
        }