Exemplo n.º 1
0
 public static void Insert(M_UserExpHis model)
 {
     if (model.UserID == 0)
     {
         M_UserInfo mu = new B_User().GetLogin();
         if (mu != null)
         {
             model.UserID = mu.UserID;
         }
     }
     if (model.Operator == 0)
     {
         M_AdminInfo adminMod = B_Admin.GetLogin();
         if (adminMod != null)
         {
             model.Operator = adminMod.AdminId;
         }
     }
     if (string.IsNullOrEmpty(model.OperatorIP))
     {
         model.OperatorIP = IPScaner.GetUserIP();
     }
     if (string.IsNullOrEmpty(model.Remark) && HttpContext.Current != null)
     {
         model.Remark = HttpContext.Current.Request.RawUrl;
     }
     if (model.HisTime <= DateTime.MinValue)
     {
         model.HisTime = DateTime.Now;
     }
     model.TbName = GetTbName((SType)model.ScoreType);
     DBCenter.Insert(model);
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (UserID < 1)
     {
         function.WriteErrMsg("未指定会员ID");
     }
     if (ExpType < 1)
     {
         function.WriteErrMsg("未指定虚拟币类型");
     }
     if (!IsPostBack)
     {
         Call.SetBreadCrumb(Master, "<li><a href='" + customPath2 + "Main.aspx'>工作台</a></li><li><a href='UserManage.aspx'>会员管理</a></li><li><a href='UserInfo.aspx?ID=" + UserID + "'>会员信息</a></li><li class='active'>会员" + GetTypeName() + "操作</li>");
         if (EditID > 0)
         {
             UserPDiv.Visible  = false;
             EditMoney.Visible = true;
             M_UserExpHis expMod = hisBll.SelReturnModel((M_UserExpHis.SType)ExpType, EditID);
             UserExpDomPID.Text = expMod.ExpHisID.ToString();
             HisTime.Text       = expMod.HisTime.ToString();
             Score.Text         = expMod.score.ToString();
             Detail.Text        = expMod.detail;
             UserPH.Value       = expMod.ExpHisID.ToString();
             return;
         }
         else
         {
             MyBind();
         }
     }
 }
        protected void EditBtn_Click(object sender, EventArgs e)
        {
            M_UserExpHis expMod = hisBll.SelReturnModel((M_UserExpHis.SType)ExpType, EditID);

            expMod.Operator  = badmin.GetAdminLogin().AdminId;
            expMod.score     = Convert.ToDouble(Score.Text);
            expMod.detail    = Detail.Text;
            expMod.ExpHisID  = EditID;
            expMod.ScoreType = ExpType;
            expMod.UserID    = UserID;
            hisBll.UpdateByID(expMod);
            Response.Redirect("UserExp.aspx?UserID=" + UserID + "&type=" + ExpType);
        }
Exemplo n.º 4
0
        public M_UserExpHis SelReturnModel(SType type, int id)
        {
            M_UserExpHis model = new M_UserExpHis();

            using (SqlDataReader reader = Sql.SelReturnReader(GetTbName(type), PK, id))
            {
                if (reader.Read())
                {
                    return(new M_UserExpHis().GetModelFromReader(reader));
                }
                else
                {
                    return(null);
                }
            }
        }
Exemplo n.º 5
0
        protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName.ToLower())
            {
            case "edit1":
                UserPDiv.Visible   = false;
                EditMoney.Visible  = true;
                expMod             = B_History.GetExpHis(Convert.ToInt32(e.CommandArgument.ToString()));
                UserExpDomPID.Text = expMod.ExpHisID.ToString();
                HisTime.Text       = expMod.HisTime.ToString();
                Score.Text         = expMod.score.ToString();
                Detail.Text        = expMod.detail;
                UserPH.Value       = expMod.ExpHisID.ToString();
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
 public void UpdateByID(M_UserExpHis model)
 {
     model.TbName = GetTbName((SType)model.ScoreType);
     DBCenter.UpdateByID(model, model.ExpHisID);
 }