public OrderTypeEntity GetOrderTypeByID(string typeid, string agentid, string clientid) { if (string.IsNullOrEmpty(typeid)) { return(null); } var list = GetOrderTypes(agentid, clientid); if (list.Where(m => m.TypeID == typeid).Count() > 0) { return(list.Where(m => m.TypeID == typeid).FirstOrDefault()); } OrderTypeEntity model = new OrderTypeEntity(); DataTable dt = SystemDAL.BaseProvider.GetOrderTypeByID(typeid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); OrderTypes[clientid].Add(model); } return(model); }
public static StorageDoc GetStorageDetail(string docid, string clientid) { DataSet ds = StockDAL.GetStorageDetail(docid, clientid); StorageDoc model = new StorageDoc(); if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0) { model.FillData(ds.Tables["Doc"].Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientid); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.DocTypeStr = CommonBusiness.GetEnumDesc <EnumDocType>((EnumDocType)model.DocType); model.WareHouse = SystemBusiness.BaseBusiness.GetWareByID(model.WareID, model.ClientID); model.Details = new List <StorageDetail>(); foreach (DataRow item in ds.Tables["Details"].Rows) { StorageDetail details = new StorageDetail(); details.FillData(item); model.Details.Add(details); } } return(model); }
/// <summary> /// 获取日志 /// </summary> /// <returns></returns> public static List <LogEntity> GetLogs(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid) { string tablename = ""; switch (type) { case EnumLogObjectType.Customer: tablename = "CustomerLog"; break; case EnumLogObjectType.Orders: tablename = "OrdersLog"; break; } DataTable dt = CommonBusiness.GetPagerData(tablename, "*", "LogGUID='" + guid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List <LogEntity> list = new List <LogEntity>(); foreach (DataRow dr in dt.Rows) { LogEntity model = new LogEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); list.Add(model); } return(list); }
/// <summary> /// 获取属性列表(包括属性值列表) /// </summary> public List <ProductAttr> GetAttrList(string categoryid, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid, string clientid) { var dal = new ProductsDAL(); DataSet ds = dal.GetAttrList(categoryid, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientid); List <ProductAttr> list = new List <ProductAttr>(); if (ds.Tables.Contains("Attrs")) { foreach (DataRow dr in ds.Tables["Attrs"].Rows) { ProductAttr model = new ProductAttr(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); List <AttrValue> valueList = new List <AttrValue>(); foreach (DataRow drValue in ds.Tables["Values"].Select("AttrID='" + model.AttrID + "'")) { AttrValue valueModel = new AttrValue(); valueModel.FillData(drValue); valueList.Add(valueModel); } model.AttrValues = valueList; list.Add(model); } } return(list); }
public List <OrderEntity> GetOrders(EnumSearchType searchtype, string typeid, int status, int paystatus, int invoicestatus, int returnstatus, string searchuserid, string searchteamid, string searchagentid, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <OrderEntity> list = new List <OrderEntity>(); DataSet ds = OrdersDAL.BaseProvider.GetOrders((int)searchtype, typeid, status, paystatus, invoicestatus, returnstatus, searchuserid, searchteamid, searchagentid, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { OrderEntity model = new OrderEntity(); model.FillData(dr); model.OrderType = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.StatusStr = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status); if (model.Status == 2) { model.SendStatusStr = CommonBusiness.GetEnumDesc((EnumSendStatus)model.SendStatus); } else if (model.Status < 2) { model.SendStatusStr = "--"; } list.Add(model); } return(list); }
/// <summary> /// 保存部门 /// </summary> /// <param name="entity"></param> /// <returns></returns> public JsonResult SaveDepartment(string entity) { JavaScriptSerializer serializer = new JavaScriptSerializer(); Department model = serializer.Deserialize<Department>(entity); string ID = ""; if (string.IsNullOrEmpty(model.DepartID)) { ID = new OrganizationBusiness().AddDepartment(model.Name, model.ParentID, model.Description, CurrentUser.UserID, CurrentUser.ClientID); } else { bool bl = new OrganizationBusiness().UpdateDepartment(model.DepartID, model.Name, model.Description, CurrentUser.UserID, OperateIP); if (bl) { ID = model.DepartID; } } JsonDictionary.Add("ID", ID); return new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
public TeamEntity GetTeamByID(string teamid, string agentid) { if (string.IsNullOrEmpty(teamid)) { return(null); } var list = GetTeams(agentid); if (list.Where(m => m.TeamID == teamid).Count() > 0) { return(list.Where(m => m.TeamID == teamid).FirstOrDefault()); } TeamEntity model = new TeamEntity(); DataTable dt = SystemDAL.BaseProvider.GetTeamByID(teamid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); model.Users = OrganizationBusiness.GetUsers(agentid).Where(m => m.TeamID == model.TeamID).ToList(); Teams[teamid].Add(model); } return(model); }
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 string CreateOpportunityStage(string stagename, decimal probability, string userid, string agentid, string clientid) { string guid = Guid.NewGuid().ToString(); bool bl = SystemDAL.BaseProvider.CreateOpportunityStage(guid, stagename, probability, userid, clientid); if (bl) { if (!OpportunityStages.ContainsKey(clientid)) { GetOpportunityStages(agentid, clientid); } OpportunityStages[clientid].Add(new OpportunityStageEntity() { StageID = guid.ToLower(), StageName = stagename, Probability = probability, Status = 1, CreateTime = DateTime.Now, CreateUserID = userid, CreateUser = OrganizationBusiness.GetUserByUserID(userid, agentid), ClientID = clientid }); return(guid); } return(""); }
public string CreateCustomSource(string sourcecode, string sourcename, int ischoose, string userid, string agentid, string clientid, out int result) { string sourceid = Guid.NewGuid().ToString(); bool bl = SystemDAL.BaseProvider.CreateCustomSource(sourceid, sourcecode, sourcename, ischoose, userid, clientid, out result); if (bl) { if (!CustomSources.ContainsKey(clientid)) { GetCustomSources(agentid, clientid); } CustomSources[clientid].Add(new CustomSourceEntity() { SourceID = sourceid.ToLower(), SourceName = sourcename, SourceCode = sourcecode, IsChoose = ischoose, IsSystem = 0, Status = 1, CreateTime = DateTime.Now, CreateUserID = userid, CreateUser = OrganizationBusiness.GetUserByUserID(userid, agentid), ClientID = clientid }); return(sourceid); } return(""); }
public List <StorageBilling> GetPayableBills(int paystatus, int invoicestatus, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <StorageBilling> list = new List <StorageBilling>(); DataSet ds = FinanceDAL.BaseProvider.GetPayableBills(paystatus, invoicestatus, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { StorageBilling model = new StorageBilling(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); model.PayStatusStr = model.PayStatus == 0 ? "未付款" : model.PayStatus == 1 ? "部分付款" : model.PayStatus == 2 ? "已付款" : model.PayStatus == 9 ? "已删除" : ""; model.InvoiceStatusStr = model.InvoiceStatus == 0 ? "未开票" : model.InvoiceStatus == 1 ? "部分开票" : model.InvoiceStatus == 2 ? "已开票" : model.InvoiceStatus == 9 ? "已删除" : ""; list.Add(model); } return(list); }
/// <summary> /// 删除部门 /// </summary> /// <param name="departid"></param> /// <returns></returns> public JsonResult DeleteDepartment(string departid) { var status = new OrganizationBusiness().UpdateDepartmentStatus(departid, CloudSalesEnum.EnumStatus.Delete, CurrentUser.UserID, OperateIP); JsonDictionary.Add("Status", (int)status); return new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
/// <summary> /// 删除角色 /// </summary> /// <param name="roleid"></param> /// <returns></returns> public JsonResult DeleteRole(string roleid) { int result = 0; bool bl = new OrganizationBusiness().DeleteRole(roleid, CurrentUser.UserID, OperateIP, CurrentUser.AgentID, out result); JsonDictionary.Add("status", result); return new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
/// <summary> /// 组织架构替换人员 /// </summary> /// <param name="userid"></param> /// <param name="olduserid"></param> /// <returns></returns> public JsonResult ChangeUsersParentID(string userid, string olduserid) { bool bl = new OrganizationBusiness().ChangeUsersParentID(userid, olduserid, CurrentUser.AgentID, CurrentUser.UserID, OperateIP); JsonDictionary.Add("status", bl); return new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
public bool UpdateCustomerOwner(string customerid, string userid, string operateid, string ip, string agentid, string clientid) { bool bl = CustomDAL.BaseProvider.UpdateCustomerOwner(customerid, userid, operateid, agentid, clientid); if (bl) { var model = OrganizationBusiness.GetUserByUserID(userid, agentid); string msg = "客户拥有者更换为:" + model.Name; LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, userid, agentid, clientid); } return(bl); }
public List <OrderEntity> GetOpportunityaByCustomerID(string customerid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <OrderEntity> list = new List <OrderEntity>(); DataTable dt = CommonBusiness.GetPagerData("Orders", "*", "CustomerID='" + customerid + "' and Status =0 ", "AutoID", pageSize, pageIndex, out totalCount, out pageCount, false); foreach (DataRow dr in dt.Rows) { OrderEntity model = new OrderEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Stage = SystemBusiness.BaseBusiness.GetOpportunityStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return(list); }
public List <ClientAccountsEntity> GetAccountBills(int mark, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <ClientAccountsEntity> list = new List <ClientAccountsEntity>(); DataSet ds = FinanceDAL.BaseProvider.GetAccountBills(mark, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { ClientAccountsEntity model = new ClientAccountsEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); list.Add(model); } return(list); }
public static List <StorageDocAction> GetStorageDocAction(string docid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid) { DataTable dt = CommonBusiness.GetPagerData("StorageDocAction", "*", "DocID='" + docid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List <StorageDocAction> list = new List <StorageDocAction>(); foreach (DataRow dr in dt.Rows) { StorageDocAction model = new StorageDocAction(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); list.Add(model); } return(list); }
public List <CustomerEntity> GetCustomersByKeywords(string keywords, string userid, string agentid, string clientid) { List <CustomerEntity> list = new List <CustomerEntity>(); DataSet ds = CustomDAL.BaseProvider.GetCustomersByKeywords(keywords, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return(list); }
/// <summary> /// 获取单据列表 /// </summary> /// <param name="userid">创建人(拥有者)</param> /// <param name="type">类型</param> /// <param name="status">状态</param> /// <param name="keywords">关键词</param> /// <param name="pageSize">页Size</param> /// <param name="pageIndex">页码</param> /// <param name="totalCount">总数</param> /// <param name="pageCount"><总页/param> /// <param name="clientID">客户端ID</param> /// <returns></returns> public static List <StorageDoc> GetStorageDocList(string userid, EnumDocType type, EnumDocStatus status, string keywords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { DataSet ds = OrdersDAL.GetStorageDocList(userid, (int)type, (int)status, keywords, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List <StorageDoc> list = new List <StorageDoc>(); foreach (DataRow dr in ds.Tables[0].Rows) { StorageDoc model = new StorageDoc(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientID); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); list.Add(model); } return(list); }
public bool DeleteTeam(string teamid, string userid, string ip, string agentid, string clientid) { var model = GetTeamByID(teamid, agentid); bool bl = SystemDAL.BaseProvider.DeleteTeam(teamid, userid, agentid); if (bl) { var list = OrganizationBusiness.GetUsers(agentid).Where(m => m.TeamID == teamid).ToList(); foreach (var user in list) { user.TeamID = ""; } Teams[agentid].Remove(model); } return(bl); }
public List <ContactEntity> GetContactsByCustomerID(string customerid, string agentid) { List <ContactEntity> list = new List <ContactEntity>(); DataTable dt = CustomDAL.BaseProvider.GetContactsByCustomerID(customerid); foreach (DataRow dr in dt.Rows) { ContactEntity model = new ContactEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault(); list.Add(model); } return(list); }
public List <CustomerEntity> GetCustomers(EnumSearchType searchtype, int type, string sourceid, string stageid, int status, int mark, string activityid, string searchuserid, string searchteamid, string searchagentid, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <CustomerEntity> list = new List <CustomerEntity>(); DataSet ds = CustomDAL.BaseProvider.GetCustomers((int)searchtype, type, sourceid, stageid, status, mark, activityid, searchuserid, searchteamid, searchagentid, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return(list); }
/// <summary> /// 根据活动ID获取活动 /// </summary> /// <param name="activityid"></param> /// <returns></returns> public static ActivityEntity GetActivityByID(string activityid, string agentid, string clientid) { ActivityEntity model = new ActivityEntity(); DataTable dt = ActivityDAL.BaseProvider.GetActivityByID(activityid, agentid, clientid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Members = new List <Users>(); foreach (var id in model.MemberID.Split('|')) { model.Members.Add(OrganizationBusiness.GetUserByUserID(id, model.AgentID)); } } return(model); }
public List <OrderEntity> GetOpportunitys(EnumSearchType searchtype, string typeid, string stageid, string searchuserid, string searchteamid, string searchagentid, string begintime, string endtime, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List <OrderEntity> list = new List <OrderEntity>(); DataSet ds = OrdersDAL.BaseProvider.GetOpportunitys((int)searchtype, typeid, stageid, searchuserid, searchteamid, searchagentid, begintime, endtime, keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { OrderEntity model = new OrderEntity(); model.FillData(dr); model.OrderType = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetOpportunityStageByID(model.StageID, model.AgentID, model.ClientID); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); list.Add(model); } return(list); }
public CustomerEntity GetCustomerByID(string customerid, string agentid, string clientid) { DataSet ds = CustomDAL.BaseProvider.GetCustomerByID(customerid, agentid, clientid); CustomerEntity model = new CustomerEntity(); if (ds.Tables["Customer"].Rows.Count > 0) { model.FillData(ds.Tables["Customer"].Rows[0]); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); if (model.Extent > 0) { model.ExtentStr = GetExtents().Where(m => m.ExtentID == model.Extent.ToString()).FirstOrDefault().ExtentName; } model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault(); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); if (!string.IsNullOrEmpty(model.IndustryID)) { model.Industry = Manage.IndustryBusiness.GetIndustryDetail(model.IndustryID); } if (ds.Tables["Activity"].Rows.Count > 0) { model.Activity = new ActivityEntity(); model.Activity.FillData(ds.Tables["Activity"].Rows[0]); } //if (ds.Tables["Contact"].Rows.Count > 0) //{ // model.Contacts = new List<ContactEntity>(); // foreach (DataRow dr in ds.Tables["Contact"].Rows) // { // ContactEntity con = new ContactEntity(); // con.FillData(dr); // model.Contacts.Add(con); // } //} } return(model); }
public OrderEntity GetOrderByID(string orderid, string agentid, string clientid) { DataSet ds = OrdersDAL.BaseProvider.GetOrderByID(orderid, agentid, clientid); OrderEntity model = new OrderEntity(); if (ds.Tables["Order"].Rows.Count > 0) { model.FillData(ds.Tables["Order"].Rows[0]); model.OrderType = SystemBusiness.BaseBusiness.GetOrderTypeByID(model.TypeID, model.AgentID, model.ClientID); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); model.StatusStr = CommonBusiness.GetEnumDesc((EnumOrderStatus)model.Status); model.ExpressTypeStr = CommonBusiness.GetEnumDesc((EnumExpressType)model.ExpressType); if (model.Status == 2) { model.SendStatusStr = CommonBusiness.GetEnumDesc((EnumSendStatus)model.SendStatus); } else if (model.Status < 2) { model.SendStatusStr = "--"; } model.City = CommonBusiness.GetCityByCode(model.CityCode); if (ds.Tables["Customer"].Rows.Count > 0) { model.Customer = new CustomerEntity(); model.Customer.FillData(ds.Tables["Customer"].Rows[0]); } model.Details = new List <OrderDetail>(); if (ds.Tables["Details"].Rows.Count > 0) { foreach (DataRow dr in ds.Tables["Details"].Rows) { OrderDetail detail = new OrderDetail(); detail.FillData(dr); model.Details.Add(detail); } } } return(model); }
public List <CustomerEntity> GetCustomersByActivityID(string activityid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { List <CustomerEntity> list = new List <CustomerEntity>(); string sqlWhere = " ActivityID='" + activityid + "' and status<>9"; DataTable dt = CommonBusiness.GetPagerData("Customer", "*", sqlWhere, "CustomerID", pageSize, pageIndex, out totalCount, out pageCount); foreach (DataRow dr in dt.Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return(list); }
/// <summary> /// 获取活动列表 /// </summary> /// <param name="userid">负责人</param> /// <param name="status">状态</param> /// <param name="filterType">过滤类型 0:所有;1:我负责的;2:我参与的</param> /// <param name="keyWords">关键词</param> /// <param name="beginTime">开始时间</param> /// <param name="endTime">结束时间</param> /// <param name="pageSize">页Size</param> /// <param name="pageIndex">页码</param> /// <param name="totalCount">总记录</param> /// <param name="pageCount">总页数</param> /// <param name="agentid">代理商ID</param> /// <param name="clientid">客户端ID</param> /// <returns></returns> public static List <ActivityEntity> GetActivitys(string userid, EnumActivityStage stage, int filterType, string keyWords, string beginTime, string endTime, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid, string clientid) { List <ActivityEntity> list = new List <ActivityEntity>(); DataTable dt = ActivityDAL.BaseProvider.GetActivitys(userid, (int)stage, filterType, keyWords, beginTime, endTime, pageSize, pageIndex, ref totalCount, ref pageCount, agentid, clientid); foreach (DataRow dr in dt.Rows) { ActivityEntity model = new ActivityEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Members = new List <Users>(); foreach (var id in model.MemberID.Split('|')) { model.Members.Add(OrganizationBusiness.GetUserByUserID(id, model.AgentID)); } list.Add(model); } return(list); }
public static List <ReplyEntity> GetReplys(string guid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { List <ReplyEntity> list = new List <ReplyEntity>(); string whereSql = " Status<>9 and GUID='" + guid + "' "; DataTable dt = CommonBusiness.GetPagerData("CustomerReply", "*", whereSql, "AutoID", "CreateTime desc ", pageSize, pageIndex, out totalCount, out pageCount, false); foreach (DataRow dr in dt.Rows) { ReplyEntity model = new ReplyEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); if (!string.IsNullOrEmpty(model.FromReplyID)) { model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID); } list.Add(model); } return(list); }
public List <CustomSourceEntity> GetCustomSources(string agentid, string clientid) { if (CustomSources.ContainsKey(clientid)) { return(CustomSources[clientid]); } List <CustomSourceEntity> list = new List <CustomSourceEntity>(); DataTable dt = SystemDAL.BaseProvider.GetCustomSources(clientid); foreach (DataRow dr in dt.Rows) { CustomSourceEntity model = new CustomSourceEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); list.Add(model); } CustomSources.Add(clientid, list); return(list); }
public List <TeamEntity> GetTeams(string agentid) { if (Teams.ContainsKey(agentid)) { return(Teams[agentid]); } List <TeamEntity> list = new List <TeamEntity>(); DataTable dt = SystemDAL.BaseProvider.GetTeams(agentid); foreach (DataRow dr in dt.Rows) { TeamEntity model = new TeamEntity(); model.FillData(dr); model.Users = OrganizationBusiness.GetUsers(agentid).Where(m => m.TeamID == model.TeamID).ToList(); list.Add(model); } Teams.Add(agentid, list); return(list); }
public static List <StorageDoc> GetStorageDocList(string userid, EnumDocType type, EnumDocStatus status, string keywords, string begintime, string endtime, string wareid, string providerid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID) { DataSet ds = StockDAL.GetStorageDocList(userid, (int)type, (int)status, keywords, begintime, endtime, wareid, providerid, pageSize, pageIndex, ref totalCount, ref pageCount, clientID); List <StorageDoc> list = new List <StorageDoc>(); foreach (DataRow dr in ds.Tables[0].Rows) { StorageDoc model = new StorageDoc(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientID); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.WareHouse = SystemBusiness.BaseBusiness.GetWareByID(model.WareID, model.ClientID); if (!string.IsNullOrEmpty(model.ProviderID)) { model.ProviderName = BaseBusiness.GetProviderByID(model.ProviderID).Name; } list.Add(model); } return(list); }
/// <summary> /// 获取单据详情 /// </summary> /// <param name="docid">单据ID</param> /// <param name="clientid">客户端ID</param> /// <returns></returns> public static StorageDoc GetStorageDetail(string docid, string clientid) { DataSet ds = OrdersDAL.GetStorageDetail(docid, clientid); StorageDoc model = new StorageDoc(); if (ds.Tables.Contains("Doc") && ds.Tables["Doc"].Rows.Count > 0) { model.FillData(ds.Tables["Doc"].Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, clientid); model.StatusStr = GetDocStatusStr(model.DocType, model.Status); model.Details = new List <StorageDetail>(); foreach (DataRow item in ds.Tables["Details"].Rows) { StorageDetail details = new StorageDetail(); details.FillData(item); model.Details.Add(details); } } return(model); }
/// <summary> /// 保存角色 /// </summary> /// <param name="entity"></param> /// <returns></returns> public JsonResult SaveRole(string entity) { JavaScriptSerializer serializer = new JavaScriptSerializer(); Role model = serializer.Deserialize<Role>(entity); if (string.IsNullOrEmpty(model.RoleID)) { model.RoleID = new OrganizationBusiness().CreateRole(model.Name, model.ParentID, model.Description, CurrentUser.UserID, CurrentUser.AgentID, CurrentUser.ClientID); } else { bool bl = new OrganizationBusiness().UpdateRole(model.RoleID, model.Name, model.Description, CurrentUser.UserID, OperateIP, CurrentUser.AgentID); if (!bl) { model.RoleID = ""; } } JsonDictionary.Add("model", model); return new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
public JsonResult DeleteUserByID(string userid) { int result = 0; bool bl = new OrganizationBusiness().DeleteUserByID(userid, CurrentUser.AgentID, CurrentUser.UserID, OperateIP, out result); JsonDictionary.Add("status", bl); JsonDictionary.Add("result", result); return new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
/// <summary> /// 保存角色权限 /// </summary> /// <param name="roleid"></param> /// <param name="permissions"></param> /// <returns></returns> public JsonResult SaveRolePermission(string roleid, string permissions) { if (permissions.Length > 0) { permissions = permissions.Substring(0, permissions.Length - 1); } bool bl = new OrganizationBusiness().UpdateRolePermission(roleid, permissions, CurrentUser.UserID, OperateIP); JsonDictionary.Add("status", bl); return new JsonResult { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
//编辑员工角色 public JsonResult UpdateUserRole(string userid,string roleid) { bool bl = new OrganizationBusiness().UpdateUserRole(userid, roleid, CurrentUser.AgentID, CurrentUser.UserID, OperateIP); JsonDictionary.Add("status", bl); return new JsonResult() { Data = JsonDictionary, JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }