Exemple #1
0
 public static string Add(Model.Task model)
 {
     if (CommonBase.RunHashtable(Add(model, new Hashtable())))
     {
         return("操作成功");
     }
     return("操作失败");
 }
Exemple #2
0
        /// <summary>
        /// 删除会员
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        public static string DeleteMember(string midList)
        {
            string[]  mids         = midList.Split(',');
            Hashtable MyHs         = new Hashtable();
            int       count        = mids.Length;
            int       successcount = 0;

            foreach (string mid in mids)
            {
                if (string.IsNullOrEmpty(mid))
                {
                    continue;
                }
                lock (DAL.Member.tempMemberList)
                {
                    //DAL.Member.tempMemberList.Clear();
                    //Model.Member model = DAL.Member.GetModel(mid);
                    //List<Model.ChangeMoney> ChangeMoneyList = ChangeMoneyCollection.GetChangeMoneyEntityList(string.Format("SHMID='{0}'", mid));
                    //List<Model.MConfigChange> MConfigChangeList = MConfigChange.GetMConfigChangeEntityList(string.Format("SHMID='{0}'", mid));
                    //DAL.Member.tempMemberList.Clear();//清空临时字典
                    //string guid = Guid.NewGuid().ToString();
                    //foreach (Model.ChangeMoney item in ChangeMoneyList)
                    //{
                    //    if (item.CState)
                    //    {
                    //        DAL.ChangeMoney.TranChangeTran(item.ToMID, item.FromMID, item.Money - item.TakeOffMoney, item.MoneyType, MyHs);
                    //    }
                    //}
                    //foreach (Model.MConfigChange item in MConfigChangeList)
                    //{
                    //    guid = Guid.NewGuid().ToString();
                    //    if (item.IsValue)
                    //    {
                    //        MyHs.Add(string.Format("update MemberConfig set {0} = '{1}' where MID = '{2}' " + " and '" + guid + "'='" + guid + "'", item.ConfigName, item.ConfigValue, item.MID), null);
                    //    }
                    //    else
                    //    {
                    //        MyHs.Add(string.Format("update MemberConfig set {0} ={0}- {1} where MID = '{2}' " + " and '" + guid + "'='" + guid + "'", item.ConfigName, item.ConfigValue, item.MID), null);
                    //    }
                    //}
                    MyHs.Add(string.Format("delete from ChangeMoney where SHMID='{0}'", mid), null);
                    MyHs.Add(string.Format("delete from Member where MID='{0}'", mid), null);
                    MyHs.Add(string.Format("delete from MemberConfig where MID='{0}'", mid), null);
                    MyHs.Add(string.Format("delete from MConfigChange where SHMID='{0}'", mid), null);

                    if (CommonBase.RunHashtable(MyHs))
                    {
                        DAL.Member.tempMemberList.Clear();//清空临时字典
                        successcount++;
                    }
                }
            }
            DAL.Member.tempMemberList.Clear();//清空临时字典
            return(string.Format("成功:{0},失败{1}", successcount, count - successcount));
        }
Exemple #3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Insert(Model.MGetHelp model, Hashtable MyHs)
        {
            model.SQCode = Guid.NewGuid().ToString().Replace("-", "").Replace(" ", "").ToUpper().Substring(0, 15);
            //校验编号是否重复,重复的话重新生成
            while (CommonBase.GetSingle("select SQCode from MGetHelp where SQCode='" + model.SQCode + "'") != null)
            {
                model.SQCode = Guid.NewGuid().ToString().Replace("-", "").Replace(" ", "").ToUpper().Substring(0, 15);
            }
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into MGetHelp(");
            strSql.Append("SQMID,SQMoney,SQCode,SQDate,PPState,ConfirmState,MFLMoney,Remark,MatchMoney,HelpType,MoneyType,ComfirmDate");
            strSql.Append(") values (");
            strSql.Append("@SQMID,@SQMoney,@SQCode,@SQDate,@PPState,@ConfirmState,@MFLMoney,@Remark,@MatchMoney,@HelpType,@MoneyType,@ComfirmDate");
            strSql.Append(") ");
            strSql.AppendFormat(";select '{0}'", guid);
            SqlParameter[] parameters =
            {
                new SqlParameter("@SQMID",        SqlDbType.VarChar,    50),
                new SqlParameter("@SQMoney",      SqlDbType.Decimal,     9),
                new SqlParameter("@SQCode",       SqlDbType.VarChar,    50),
                new SqlParameter("@SQDate",       SqlDbType.DateTime),
                new SqlParameter("@PPState",      SqlDbType.Int,         4),
                new SqlParameter("@ConfirmState", SqlDbType.Int,         4),
                new SqlParameter("@MFLMoney",     SqlDbType.Decimal,     9),
                new SqlParameter("@Remark",       SqlDbType.VarChar,   500),
                new SqlParameter("@MatchMoney",   SqlDbType.Decimal,     9),
                new SqlParameter("@HelpType",     SqlDbType.Int,         4),
                new SqlParameter("@MoneyType",    SqlDbType.VarChar,    50),
                new SqlParameter("@ComfirmDate",  SqlDbType.DateTime)
            };

            parameters[0].Value  = model.SQMID;
            parameters[1].Value  = model.SQMoney;
            parameters[2].Value  = model.SQCode;
            parameters[3].Value  = model.SQDate;
            parameters[4].Value  = model.PPState;
            parameters[5].Value  = model.ConfirmState;
            parameters[6].Value  = model.MFLMoney;
            parameters[7].Value  = model.Remark;
            parameters[8].Value  = model.MatchMoney;
            parameters[9].Value  = model.HelpType;
            parameters[10].Value = model.MoneyType;
            parameters[11].Value = model.ComfirmDate;
            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }
Exemple #4
0
        /// <summary>
        /// 删除会员
        /// </summary>
        /// <param name="mid"></param>
        /// <returns></returns>
        public static string DeleteMemberW(string midList, string tjmid)
        {
            string[]  mids  = midList.Split(',');
            Hashtable MyHs  = new Hashtable();
            int       count = mids.Length;

            foreach (string mid in mids)
            {
                Model.Member model = DAL.Member.GetModel(mid);
                if (DAL.Member.GetModel(tjmid).Role.IsAdmin)
                {
                    MyHs.Add("delete from member where mid='" + model.MID + "'; delete from memberconfig where mid ='" + model.MID + "';", null);
                }
                else if (model.MTJ == tjmid && model.AgencyCode == "001")
                {
                    MyHs.Add("delete from member where mid='" + model.MID + "'; delete from memberconfig where mid ='" + model.MID + "';", null);
                }
            }
            if (CommonBase.RunHashtable(MyHs))
            {
                return("操作成功");
            }
            return("操作失败");
        }
Exemple #5
0
 public static System.Data.DataTable GetTable(string strWhere, int pageIndex, int pageSize, out int count)
 {
     return(CommonBase.GetTable("[Accounts]", "ACode", "CreateDate asc,ACode asc", strWhere, pageIndex, pageSize, out count));
 }
Exemple #6
0
 /// <summary>
 /// 得到分页会员信息数据
 /// </summary>
 /// <param name="strWhere">查询条件</param>
 /// <param name="pageIndex">页码</param>
 /// <param name="pageSize">页大小</param>
 /// <param name="count">out类型总计</param>
 /// <returns>返回DataTable</returns>
 private static DataTable GetTable(string strWhere, int pageIndex, int pageSize, out int count)
 {
     return(CommonBase.GetTable("BCenter", "MID", "AddDate asc,MID asc", strWhere, pageIndex, pageSize, out count));
 }
Exemple #7
0
 public static System.Data.DataTable GetTable(string strWhere, int pageIndex, int pageSize, out int count)
 {
     return(CommonBase.GetTable("MemberBonus", "Code", "ID asc,Code asc", strWhere, pageIndex, pageSize, out count));
 }
Exemple #8
0
 public static System.Data.DataTable GetTable(string strWhere, int pageIndex, int pageSize, out int count)
 {
     return(CommonBase.GetTable("SMS", "SID", "SID", strWhere, pageIndex, pageSize, out count));
 }
Exemple #9
0
 public static System.Data.DataTable GetTable(string strWhere, int pageIndex, int pageSize, out int count, string orderBy)
 {
     return(CommonBase.GetTable("BMember", "BMID", orderBy, strWhere, pageIndex, pageSize, out count));
 }
Exemple #10
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static Hashtable Insert(Model.MOfferHelp model, Hashtable MyHs)
        {
            ////计算利息
            //var dic = DAL.ConfigDictionary.GetConfigDictionary((int)model.SQMoney, "LiXi", "");
            //if (dic != null)
            //{
            //    model.DayInterest = Convert.ToDecimal(dic.DValue);
            //}
            model.SQCode = Guid.NewGuid().ToString().Replace("-", "").Replace(" ", "").ToUpper().Substring(0, 15);
            //校验编号是否重复,重复的话重新生成
            while (CommonBase.GetSingle("select SQCode from MOfferHelp where SQCode='" + model.SQCode + "'") != null)
            {
                model.SQCode = Guid.NewGuid().ToString().Replace("-", "").Replace(" ", "").ToUpper().Substring(0, 15);
            }

            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into MOfferHelp(");
            strSql.Append("TotalInterest,TotalInterestDays,TotalSincerity,TotalSincerityDays,SincerityState,InterestState,SQCode,SQMID,SQMoney,SQDate,PPState,DKState,MFLMoney,Remark,MatchMoney,dayInterest,HelpType,MoneyType");
            strSql.Append(") values (");
            strSql.Append("@TotalInterest,@TotalInterestDays,@TotalSincerity,@TotalSincerityDays,@SincerityState,@InterestState,@SQCode,@SQMID,@SQMoney,@SQDate,@PPState,@DKState,@MFLMoney,@Remark,@MatchMoney,@dayInterest,@HelpType,@MoneyType");
            strSql.Append(") ");
            strSql.AppendFormat(";select '{0}'", guid);
            SqlParameter[] parameters =
            {
                new SqlParameter("@TotalInterest",      SqlDbType.Decimal,     9),
                new SqlParameter("@TotalInterestDays",  SqlDbType.Int,         4),
                new SqlParameter("@TotalSincerity",     SqlDbType.Decimal,     9),
                new SqlParameter("@TotalSincerityDays", SqlDbType.Int,         4),
                new SqlParameter("@SincerityState",     SqlDbType.Int,         4),
                new SqlParameter("@InterestState",      SqlDbType.Int,         4),
                new SqlParameter("@SQCode",             SqlDbType.VarChar,    50),
                new SqlParameter("@SQMID",              SqlDbType.VarChar,    50),
                new SqlParameter("@SQMoney",            SqlDbType.Decimal,     9),
                new SqlParameter("@SQDate",             SqlDbType.DateTime),
                new SqlParameter("@PPState",            SqlDbType.Int,         4),
                new SqlParameter("@DKState",            SqlDbType.Int,         4),
                new SqlParameter("@MFLMoney",           SqlDbType.Decimal,     9),
                new SqlParameter("@Remark",             SqlDbType.VarChar,   500),
                new SqlParameter("@MatchMoney",         SqlDbType.Decimal,     9),
                new SqlParameter("@dayInterest",        SqlDbType.Decimal,     9),
                new SqlParameter("@HelpType",           SqlDbType.Int,         4),
                new SqlParameter("@MoneyType",          SqlDbType.VarChar, 50)
            };

            parameters[0].Value  = model.TotalInterest;
            parameters[1].Value  = model.TotalInterestDays;
            parameters[2].Value  = model.TotalSincerity;
            parameters[3].Value  = model.TotalSincerityDays;
            parameters[4].Value  = model.SincerityState;
            parameters[5].Value  = model.InterestState;
            parameters[6].Value  = model.SQCode;
            parameters[7].Value  = model.SQMID;
            parameters[8].Value  = model.SQMoney;
            parameters[9].Value  = model.SQDate;
            parameters[10].Value = model.PPState;
            parameters[11].Value = model.DKState;
            parameters[12].Value = model.MFLMoney;
            parameters[13].Value = model.Remark;
            parameters[14].Value = model.MatchMoney;
            parameters[15].Value = model.DayInterest;
            parameters[16].Value = model.HelpType;
            parameters[17].Value = model.MoneyType;

            MyHs.Add(strSql.ToString(), parameters);
            return(MyHs);
        }