Exemplo n.º 1
0
        public static Order_productitemInfo Parse(string stringify)
        {
            string[] ret = stringify.Split(new char[] { '|' }, 6, StringSplitOptions.None);
            if (ret.Length != 6)
            {
                throw new Exception("格式不正确,Order_productitemInfo:" + stringify);
            }
            Order_productitemInfo item = new Order_productitemInfo();

            if (string.Compare("null", ret[0]) != 0)
            {
                item.Order_id = uint.Parse(ret[0]);
            }
            if (string.Compare("null", ret[1]) != 0)
            {
                item.Productitem_id = uint.Parse(ret[1]);
            }
            if (string.Compare("null", ret[2]) != 0)
            {
                item.Number = uint.Parse(ret[2]);
            }
            if (string.Compare("null", ret[3]) != 0)
            {
                item.Price = decimal.Parse(ret[3]);
            }
            if (string.Compare("null", ret[4]) != 0)
            {
                item.State = (Order_productitemSTATE)long.Parse(ret[4]);
            }
            if (string.Compare("null", ret[5]) != 0)
            {
                item.Title = ret[5].Replace(StringifySplit, "|");
            }
            return(item);
        }
Exemplo n.º 2
0
        public Order_productitemInfo FlagOrder(uint?Order_id, uint?Number, decimal?Price, Order_productitemSTATE?State, string Title)
        {
            Order_productitemInfo item = Order_productitem.GetItem(Order_id.Value, this.Id.Value);

            if (item == null)
            {
                item = Order_productitem.Insert(new Order_productitemInfo {
                    Order_id       = Order_id,
                    Productitem_id = this.Id,
                    Number         = Number,
                    Price          = Price,
                    State          = State,
                    Title          = Title
                });
            }
            else
            {
                item.UpdateDiy
                .SetNumber(Number)
                .SetPrice(Price)
                .SetState(State)
                .SetTitle(Title).ExecuteNonQuery();
            }
            return(item);
        }
Exemplo n.º 3
0
 public static string ToJson(this Order_productitemInfo item)
 {
     return(string.Concat(item));
 }