public static int AddUserData(All userData) { UserBuild ub = new UserBuild(); userData.Time = Function.GetUTCTime(); SamgoModels.UserInfo ui = new SamgoModels.UserInfo(); UserValue uLord = new UserValue(); UserValue uProsperity = new UserValue(); UserPower up = new UserPower(); UserTechnique ut = new UserTechnique(); UserOrdnance uo = new UserOrdnance(); var userInfo = new SamgoModels.UserInfo(); userData.SeqNo = DapperHelper.Search<int>( connectionString, " exec [samgo_add_user_and_group] N'" + userData.Role + "' , N'" + userData.Legion + "'").FirstOrDefault(); ConvertDataToModels(ref ub, ref ui, ref uLord, ref uProsperity, ref up, userData); DapperHelper.InsertSQLNormal<UserBuild>(connectionString, "Build", ub); //DapperHelper.InsertSQL<SamgoModels.UserInfo>(connectionString, "SamgoGame", ui); DapperHelper.InsertSQLNormal<UserValue>(connectionString, "Lord", uLord); DapperHelper.InsertSQLNormal<UserValue>(connectionString, "Prosperity", uProsperity); DapperHelper.InsertSQLNormal<UserPower>(connectionString, "SamgoGamePower", up); ConvertDataToModels(ref ut, ref uo, userData); DapperHelper.InsertSQLNormal<UserTechnique>(connectionString, "Technique", ut); var response = DapperHelper.InsertSQLNormal<UserOrdnance>(connectionString, "Ordnance", uo); return userData.SeqNo; }
private static void ConvertDataToModels(ref UserTechnique ut, ref UserOrdnance uo, All userData) { //Technique(技法) ut.SeqNo = userData.SeqNo; ut.Time = userData.Time; ut.FoodUp = userData.FoodUp; ut.StoneUp = userData.StoneUp; ut.WoodUp = userData.WoodUp; ut.IronUp = userData.IronUp; ut.FrontAttack = userData.FrontAttack; ut.BackAttack = userData.BackAttack; ut.FrontDefense = userData.FrontDefense; ut.BackDefense = userData.BackDefense; ut.EnhancedProtection = userData.EnhancedProtection; ut.EnhancedPlunder = userData.EnhancedPlunder; ut.MartialArts = userData.MartialArts; ut.ThickBlack = userData.ThickBlack; ut.WarArt = userData.WarArt; ut.ArrowBuild = userData.ArrowBuild; ut.RefuseHorse = userData.RefuseHorse; ut.WallUp = userData.WallUp; ut.Reconstruction = userData.Reconstruction; ut.Judge = userData.Judge; ut.heroic = userData.heroic; ut.Ramp = userData.Ramp; ut.Perseverance = userData.Perseverance; ut.Insight = userData.Insight; ut.CriticalStrike = userData.CriticalStrike; ut.Toughness = userData.Toughness; //Ordnance(軍械) uo.SeqNo = userData.SeqNo; uo.Time = userData.Time; uo.Catapult = userData.Catapult; uo.ShieldCar = userData.ShieldCar; uo.Well = userData.Well; uo.Drum = userData.Drum; uo.WoodenCow = userData.WoodenCow; }