public string CreateOrderType(string typename, string typecode, string userid, string agentid, string clientid) { string typeid = Guid.NewGuid().ToString(); bool bl = SystemDAL.BaseProvider.CreateOrderType(typeid, typename, typecode, userid, clientid); if (bl) { if (!OrderTypes.ContainsKey(clientid)) { GetOrderTypes(agentid, clientid); } OrderTypes[clientid].Add(new OrderTypeEntity() { TypeID = typeid.ToLower(), TypeName = typename, TypeCode = typecode, Status = 1, CreateTime = DateTime.Now, CreateUserID = userid, CreateUser = OrganizationBusiness.GetUserByUserID(userid, agentid), ClientID = clientid }); return(typeid); } return(""); }
public List <OrderTypeEntity> GetOrderTypes(string agentid, string clientid) { if (OrderTypes.ContainsKey(clientid)) { return(OrderTypes[clientid].ToList()); } List <OrderTypeEntity> list = new List <OrderTypeEntity>(); DataSet ds = SystemDAL.BaseProvider.GetOrderTypes(clientid); foreach (DataRow dr in ds.Tables[0].Rows) { OrderTypeEntity model = new OrderTypeEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); list.Add(model); } OrderTypes.Add(clientid, list); return(list); }