コード例 #1
0
 protected string html(Model.LuckyMoney luck)
 {
     if (luck.isValid == 0)
     {
         if (luck.Type == 0)
         {
             return("<a class=\"button button-fill button-success\" href=\"javascript:layer.confirm('确定退本吗?', {btn: ['确定', '再想想']}, function () {InvestOperate('quit'," + luck.ID + ");}, function () {});\">退本</a>");
         }
         else
         {
             return("有效");
         }
     }
     else if (luck.isValid == 1)
     {
         return("审核中");
     }
     else if (luck.isValid == 2)
     {
         return("已退本");
     }
     else if (luck.isValid == 3)
     {
         return("已失效");
     }
     else
     {
         return("异常单");
     }
 }
コード例 #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Add(string mid, decimal money, Hashtable MyHs)
        {
            Model.LuckyMoney model = new Model.LuckyMoney();
            //创建时间(第一次分红时间)
            model.CreateTime = DateTime.Now;
            //是否有效
            model.isValid = 0;
            //员工MID
            model.MID = mid;
            //分红次数
            model.FHTimes    = 0;
            model.FHMoney    = 0;
            model.TotalMoney = money;

            return(DAL.LuckyMoney.Add(model, MyHs));
        }
コード例 #3
0
 protected string html(Model.LuckyMoney luck)
 {
     if (luck.isValid == 0)
     {
         return("有效");
     }
     else if (luck.isValid == 1)
     {
         return("审核中");
     }
     else if (luck.isValid == 2)
     {
         return("已退本");
     }
     else
     {
         return("异常单");
     }
 }
コード例 #4
0
        public static string InvestApply(string mid, decimal applyMoney, int type = 0)
        {
            Model.LuckyMoney lucky = new Model.LuckyMoney();
            lucky.ApplyMoney   = applyMoney;
            lucky.CreateTime   = DateTime.Now;
            lucky.TotalMoney   = 0;
            lucky.TakeOffmoney = 0;
            lucky.MID          = mid;
            lucky.isValid      = 0;
            lucky.FHTimes      = 0;
            lucky.EditTime     = DateTime.Now;
            lucky.Type         = type;
            lock (lock_apply)
            {
                //今日投资额
                decimal appLyMoney = BLL.LuckyMoney.GetTotalMoney("ApplyMoney", " isValid <> 2 and DATEDIFF(DD,CreateTime,GETDATE()) = 0 ");
                decimal tLyMoney   = BLL.LuckyMoney.GetTotalMoney("ApplyMoney", " isValid = 2 and DATEDIFF(DD,EditTime,GETDATE()) = 0 ");
                if (appLyMoney - tLyMoney + applyMoney > BLL.Configuration.Model.E_MaxTouZi)
                {
                    return("今日已达最大投资额度");
                }

                try
                {
                    Model.Member member = DAL.Member.GetModel(mid);
                    if (member == null)
                    {
                        throw new Exception("员工不存在");
                    }
                    if (member.IsClock)
                    {
                        throw new Exception("账户冻结,无法申请");
                    }
                    if (appliList.Contains(mid))
                    {
                        return("请不要重复提交!");
                    }
                    else
                    {
                        appliList.Add(mid);
                    }

                    if (type == 1 || BLL.ChangeMoney.EnoughChange(mid, applyMoney, "MJB"))
                    {
                        Hashtable MyHs = new Hashtable();
                        Add(lucky, MyHs);
                        if (type == 0)
                        {
                            BLL.ChangeMoney.HBChangeTran(applyMoney, mid, BLL.Member.ManageMember.TModel.MID, "appplyIn", null, "MJB", "", MyHs);
                            BLL.ChangeMoney.R_TJ(applyMoney, member, MyHs);
                            BLL.ChangeMoney.YJCountTran(applyMoney, member, member, MyHs);
                        }
                        if (BLL.CommonBase.RunHashtable(MyHs))
                        {
                            if (type == 0)
                            {
                                if (!member.MState)
                                {
                                    BLL.Member.ManageMember.UpMAgencyType(DAL.Configuration.TModel.SHMoneyList["002"], member.MID, "MJB", member, 0);
                                }
                            }
                            if (appliList.Contains(mid))
                            {
                                appliList.Remove(mid);
                            }
                            return("申请成功");
                        }
                        else
                        {
                            if (appliList.Contains(mid))
                            {
                                appliList.Remove(mid);
                            }
                            return("申请失败");
                        }
                    }
                    else
                    {
                        if (appliList.Contains(mid))
                        {
                            appliList.Remove(mid);
                        }
                        return("您的" + BLL.Reward.List["MJB"].RewardName + "不足!");
                    }
                }
                catch (Exception e)
                {
                    if (appliList.Contains(mid))
                    {
                        appliList.Remove(mid);
                    }
                    return(e.Message);
                }
            }
        }