public OrdersModelShow Set_Info(Orders source) { try { OrdersModelShow rlt = new OrdersModelShow() { Id = source.Id, Osid = source.Osid, VolunteersId = source.VolunteersId.Value, OrdersProduct = source.ProductId, Quantity = source.Order_Quantity, TotalPrice = source.TotalPrice, Name = source.Name, Mobile = source.Mobile, CityId = source.CityId, AreaId = source.AreaId, Address = source.Address, SharePoint = source.SharePoint, Remarks = source.Remarks, OrdersStates = source.OrdersStates, States = Get_State(source.OrdersStates), OrdersTime = source.OrdersTime, ReciveTimeChoice = source.ReciveTimeChoice, UpdateUserId = source.UpdateUserId, }; if (rlt.UpdateUserId != null) { rlt.UpdateUserName = Get_UserName(rlt.UpdateUserId.Value); } rlt.Set_Other(); return rlt; } catch { return new OrdersModelShow(); } }
public void ScoreUpdate(OrdersModelShow source, int userId) { s26webDataContext db = new s26webDataContext(); Orders compareTemp = db.Orders.FirstOrDefault(w => w.Osid == source.Osid); if (this.OrdersStates != compareTemp.OrdersStates) { OrdersStatesUpdate(source.Osid, source.OrdersStates, userId); } //Expand Here and build new funtion }