Exemple #1
0
        /// <summary>
        /// 被驳回的邮件
        /// </summary>
        /// <param name="applyId">被驳回的申请单</param>
        /// <param name="memberId">申请人</param>
        /// <returns></returns>
        public bool EmailToReject(int applyId, int memberId)
        {
            Memberinfocfg mic       = new Memberinfocfg();
            List <int>    memberIds = new List <int>();

            memberIds.Add(memberId);
            if (memberIds != null)
            {
                DataSet ds = mic.GetIsPassAudit(memberIds);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["Type"].ToString() == "实时发送" && Convert.ToInt32(ds.Tables[0].Rows[0]["Value"]) == 1)
                    {
                        mailToArray = new string[] { ds.Tables[0].Rows[0]["Email"].ToString() };
                        mailSubject = "申请单驳回:您有申请单被驳回。 来自 领先办公(Reject Order: You have one order be reject _ from Leading Future)";
                        mailBody    = EmailBodyStrToReject(applyId, memberId);
                        Send();
                    }
                }
            }
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 消息推送给上级管理员的通知
        /// </summary>
        /// <param name="applyId"></param>
        /// <param name="memberId"></param>
        /// <returns></returns>
        public bool NoticeToApplyMember(int applyId, int memberId)
        {
            Memberinfocfg mic       = new Memberinfocfg();
            List <int>    memberIds = new List <int>();

            memberIds.Add(memberId);
            if (memberIds != null)
            {
                DataSet ds = mic.GetIsPassAudit(memberIds);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["Type"].ToString() == "实时发送" && Convert.ToInt32(ds.Tables[0].Rows[0]["Value"]) == 1)
                    {
                        mailToArray = new string[] { ds.Tables[0].Rows[0]["Email"].ToString() };
                        mailSubject = "申请单通知:申请单推送给您的上司。 来自 领先办公";
                        mailBody    = EmailBodyStrToNotice(applyId, memberId);
                        Send();
                    }
                }
            }
            return(true);
        }
Exemple #3
0
        public int Save()
        {
            ArrayList arrayList = new ArrayList();

            if (Id > 0)
            {
                arrayList.Add(new SqlParameter("@Id", Id));
            }
            arrayList.Add(new SqlParameter("@LoginName", LoginName));
            arrayList.Add(new SqlParameter("@PassWord", PassWord));
            arrayList.Add(new SqlParameter("@RealName", RealName));
            arrayList.Add(new SqlParameter("@Telphone", Telphone));
            arrayList.Add(new SqlParameter("@Mobile", Mobile));
            arrayList.Add(new SqlParameter("@IsCheckMobile", IsCheckMobile));
            arrayList.Add(new SqlParameter("@Status", Status));
            arrayList.Add(new SqlParameter("@LoginNumber", LoginNumber));
            arrayList.Add(new SqlParameter("@RegisterDate", RegisterDate));
            //arrayList.Add(new SqlParameter("@Point", Point)); //积分通过 pointdetail 的balance 来读取
            arrayList.Add(new SqlParameter("@ComId", ComId));
            arrayList.Add(new SqlParameter("@DeptId", DeptId));
            arrayList.Add(new SqlParameter("@IsMainContact", IsMainContact));
            arrayList.Add(new SqlParameter("@Province", Province));
            arrayList.Add(new SqlParameter("@City", City));
            arrayList.Add(new SqlParameter("@Area", Area));
            arrayList.Add(new SqlParameter("@Street", Street));
            arrayList.Add(new SqlParameter("@Mansion", Mansion));
            arrayList.Add(new SqlParameter("@Room", Room));
            arrayList.Add(new SqlParameter("@Address", GetAddress()));
            arrayList.Add(new SqlParameter("@PostCode", PostCode));
            arrayList.Add(new SqlParameter("@UpdateTime", UpdateTime));
            arrayList.Add(new SqlParameter("@IsThirdLogin", IsThirdLogin));
            arrayList.Add(new SqlParameter("@Email", Email));
            arrayList.Add(new SqlParameter("@IsCheckEmail", IsCheckEmail));
            arrayList.Add(new SqlParameter("@RegisterMethod", RegisterMethod));
            arrayList.Add(new SqlParameter("@IsAdmin", IsAdmin));
            arrayList.Add(new SqlParameter("@BranchId", BranchId));
            arrayList.Add(new SqlParameter("@ConfirmLevel", ConfirmLevel));
            arrayList.Add(new SqlParameter("@ExportDate", ExportDate));
            arrayList.Add(new SqlParameter("@SecrecyId", SecrecyId));
            arrayList.Add(new SqlParameter("@IsOrderAuthority", IsOrderAuthority));
            arrayList.Add(new SqlParameter("@IsVisible", IsVisible));
            arrayList.Add(new SqlParameter("@GoodsVisibleLevel", GoodsVisibleLevel));
            if (this.Id > 0)
            {
                m_dbo.UpdateData("Member", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
            }
            else
            {
                this.Id = m_dbo.InsertData("Member", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
                if (this.Id > 0)
                {
                    MemberAddress Maddress = new MemberAddress();
                    Maddress.MemberId  = Id;
                    Maddress.RealName  = RealName;
                    Maddress.Address   = Address;
                    Maddress.Province  = Province;
                    Maddress.City      = City;
                    Maddress.Area      = Area;
                    Maddress.Street    = Street;;
                    Maddress.Mansion   = Mansion;
                    Maddress.Room      = Room;
                    Maddress.TelPhone  = Telphone;
                    Maddress.Mobile    = Mobile;
                    Maddress.Email     = Email;
                    Maddress.IsDefault = 1;
                    Maddress.Save();
                }
            }
            if (this.Id > 0 && Email != "")
            {
                Memberinfocfg Minfocfg = new Memberinfocfg();
                Minfocfg.MemberId = Id;
                Minfocfg.Load();
                Minfocfg.Type       = CommenClass.MemberEmailTimely.实时发送.ToString();
                Minfocfg.UpdateTime = DateTime.Now;
                Minfocfg.Value      = IsCheckEmail;
                Minfocfg.Save();
            }
            return(this.Id);
        }
Exemple #4
0
 /// <summary>
 /// 发送申请单邮件(可审核)
 /// </summary>
 /// <param name="applyId"></param>
 /// <param name="dt">该申请单是被谁审核的 管理员的表 </param>
 /// <returns></returns>
 public bool SendEmail(int applyId, int isPass)
 {
     if (applyId > 0)//申请单添加成功,审核消息发送给对应的管理员
     {
         //1、找到要发邮件的对应的人
         //通过ApplyId找到(新申请单生成)申请人,(审核过一级的)审核了一次的审核人
         VIPApply apply = new VIPApply(applyId);
         if (apply.Status == "待审核")
         {
             int            memberId = apply.OperatorId > 0 ? apply.OperatorId : apply.MemberId;
             VIPApplyOption option   = new VIPApplyOption();
             Member         member   = new Member();
             DataSet        ds       = member.GetDeptComIdByMemberId(memberId);
             option.ComId    = Convert.ToInt32(ds.Tables[0].Rows[0]["ComId"]);
             option.MemberId = memberId;
             option.RoleId   = 2;//成本中心管理员
             option.Code     = Convert.ToString(ds.Tables[0].Rows[0]["Code"]);
             VIPApplyManager vam       = new VIPApplyManager();
             DataSet         dsAdmin   = vam.GetAdmin(option);
             List <int>      memberIds = new List <int>();
             if (dsAdmin.Tables[0].Rows.Count > 0)
             {
                 int SendmemberId = Convert.ToInt32(dsAdmin.Tables[0].Rows[0]["MemberId"]);//上一级成本中心
                 memberIds.Add(SendmemberId);
             }
             //越级是 admin+sys_admin  逐级是admin
             if (isPass == 1)//越级
             {
                 MemberRole role        = new MemberRole();
                 DataSet    dsMemberIds = role.GetSysAdmin(option.ComId);//找到系统管理
                 if (dsMemberIds.Tables[0].Rows.Count > 0)
                 {
                     memberIds.Add(Convert.ToInt32(dsMemberIds.Tables[0].Rows[0]["MemberId"]));
                 }
             }
             if (memberIds.Count > 0)
             {
                 Memberinfocfg configure = new Memberinfocfg();
                 DataSet       dsEmail   = configure.GetIsPassAudit(memberIds);
                 if (dsEmail.Tables[0].Rows.Count > 0)
                 {
                     for (int i = 0; i < dsEmail.Tables[0].Rows.Count; i++)
                     {
                         if (dsEmail.Tables[0].Rows[i]["Type"].ToString() == "实时发送" && Convert.ToInt32(dsEmail.Tables[0].Rows[i]["Value"]) == 1)
                         {
                             string emailss = dsEmail.Tables[0].Rows[i]["Email"].ToString();
                             if (emailss != "")
                             {
                                 int mId = Convert.ToInt32(dsEmail.Tables[0].Rows[i]["MemberId"]);
                                 mailToArray = new string[] { emailss };
                                 mailSubject = "订单审核:您有新订单需要审核 来自 领先办公(Stationery Order: You have one new order need to approve _ from Leading Future)";
                                 mailBody    = EmailBodyStr(applyId, mId);
                                 isbodyHtml  = true;
                                 Send();
                             }
                         }
                     }
                 }
             }
         }
         return(true);
     }
     return(false);
 }