public void InsertRecordGrantExperience(RecordGrantExperience grantExperience) { System.Data.DataRow dataRow = this.aideRecordGrantExperienceProvider.NewRow(); dataRow["MasterID"] = grantExperience.MasterID; dataRow["CurExperience"] = grantExperience.CurExperience; dataRow["UserID"] = grantExperience.UserID; dataRow["ClientIP"] = grantExperience.ClientIP; dataRow["AddExperience"] = grantExperience.AddExperience; dataRow["Reason"] = grantExperience.Reason; dataRow["CollectDate"] = System.DateTime.Now; this.aideRecordGrantExperienceProvider.Insert(dataRow); }
/// <summary> /// 新增一条赠送经验记录 /// </summary> /// <param name="grantExperience"></param> public void InsertRecordGrantExperience(RecordGrantExperience grantExperience) { DataRow dr = aideRecordGrantExperienceProvider.NewRow(); dr[RecordGrantExperience._MasterID] = grantExperience.MasterID; dr[RecordGrantExperience._CurExperience] = grantExperience.CurExperience; dr[RecordGrantExperience._UserID] = grantExperience.UserID; dr[RecordGrantExperience._ClientIP] = grantExperience.ClientIP; dr[RecordGrantExperience._AddExperience] = grantExperience.AddExperience; dr[RecordGrantExperience._Reason] = grantExperience.Reason; dr[RecordGrantExperience._CollectDate] = DateTime.Now; aideRecordGrantExperienceProvider.Insert(dr); }
protected void btnSave_Click(object sender, EventArgs e) { string strReason = CtrlHelper.GetText(txtReason); int intAddExperience = CtrlHelper.GetInt(txtAddExperience, 0); if (intAddExperience <= 0) { MessageBox("赠送经验数必须为大于零的正整数!"); return; } if (string.IsNullOrEmpty(strReason)) { MessageBox("赠送原因不能为空"); return; } RecordGrantExperience grantExperience = new RecordGrantExperience( ); AccountsInfo modelAccountInfo = new AccountsInfo( ); grantExperience.ClientIP = GameRequest.GetUserIP( ); grantExperience.MasterID = userExt.UserID; grantExperience.AddExperience = intAddExperience; grantExperience.Reason = strReason; string[] arrUserIDList = StrParamsList.Split(new char[] { ',' }); foreach (string strid in arrUserIDList) { if (Utils.Validate.IsPositiveInt(strid)) { grantExperience.UserID = int.Parse(strid); grantExperience.CurExperience = FacadeManage.aideAccountsFacade.GetExperienceByUserID(int.Parse(strid)); modelAccountInfo = FacadeManage.aideAccountsFacade.GetAccountInfoByUserID(int.Parse(strid)); if (modelAccountInfo == null) { continue; } modelAccountInfo.Experience = grantExperience.CurExperience + intAddExperience; FacadeManage.aideAccountsFacade.UpdateAccount(modelAccountInfo, userExt.UserID, GameRequest.GetUserIP()); //更新用户经验值 FacadeManage.aideRecordFacade.InsertRecordGrantExperience(grantExperience); //插入赠送经验值日志 } } MessageBox("确认成功"); }
/// <summary> /// 新增一条赠送经验记录 /// </summary> /// <param name="grantExperience"></param> public void InsertRecordGrantExperience(RecordGrantExperience grantExperience) { aideRecordData.InsertRecordGrantExperience(grantExperience); }