partial void DeleteExchangeGift(ExchangeGift instance);
partial void UpdateExchangeGift(ExchangeGift instance);
/// <summary> /// 設定資料內值 /// </summary> /// <param name="source"></param> /// <returns></returns> public ExchangeGiftShow Set_Info(ExchangeGift source) { try { ExchangeGiftShow rlt = new ExchangeGiftShow() { Id = source.Id, Egid = source.Egid, VolunteersId = source.Vol_Id, ExchangeGift = source.GiftId, Name = source.Name, Mobile = source.Mobile, CityId = source.CityId, AreaId = source.AreaId, Address = source.Address, Remarks = source.Remark, ExchangeGiftStates = source.Status, States = Get_State(source.Status), SubmitTime = source.CreateTime, UpdateUserId = source.UpdateUserId, UpdateUserName = Get_UserName(source.UpdateUserId.Value) }; if (rlt.UpdateUserId != null) { rlt.UpdateUserName = Get_UserName(rlt.UpdateUserId.Value); } rlt.Set_Other(); return rlt; } catch { return new ExchangeGiftShow(); } }
partial void InsertExchangeGift(ExchangeGift instance);
/// <summary> /// 將資料筆數寫入資料表中 /// </summary> /// <param name="item"></param> /// <returns></returns> public int Insert_Score(InsertExchangeGift item) { s26webDataContext db = new s26webDataContext(); ExchangeGift result = new ExchangeGift { Egid = Get_TheDateScoreCount(DateTime.Now.AddDays(-8).ToString("yyyyMMdd")), Vol_Id = Get_VolId(item.Vol_Mobile), Name = item.Name, Mobile = item.Mobile, CityId = item.CityId, AreaId = item.AreaId, Address = item.Address, GiftId = item.GiftId, Remark = item.Remark, Status = 29, UpdateUserId = item.UpdateUserId, CreateTime = DateTime.Now.AddHours(-8) }; db.ExchangeGift.InsertOnSubmit(result); db.SubmitChanges(); Reduce_Gift(result.GiftId); return 1; }