Esempio n. 1
0
        /// <summary>
        /// 删除代理设置信息
        /// </summary>
        /// <param name="AgentSetId">代理ID</param>
        /// <returns></returns>
        public bool DeleteAgentSet(string[] AgentSetId)
        {
            try
            {
                AgentManagementDAL Amd = new AgentManagementDAL();
                var entitys            = from ent in Amd.GetTable().ToList()
                                         where AgentSetId.Contains(ent.AGENTSETID)
                                         select ent;

                if (entitys.Count() > 0)
                {
                    foreach (var obj in entitys)
                    {
                        dal.DeleteFromContext(obj);
                    }
                    int i = dal.SaveContextChanges();
                    return(i > 0 ? true : false);
                }
                return(false);
            }
            catch (Exception ex)
            {
                Tracer.Debug("代理岗位设置ProxySettingsBLL-DeleteAgentSet" + System.DateTime.Now.ToString() + " " + ex.ToString());
                return(false);

                throw (ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 检查是否存在该代理设置信息
        /// </summary>
        /// <param name="sysCode">系统代码</param>
        /// <param name="modelCode">模块代码</param>
        /// <returns></returns>
        public bool IsExistAgentSet(string sysCode, string modelCode)
        {
            AgentManagementDAL Amd = new AgentManagementDAL();
            bool IsExist           = false;
            var  q = from cnt in Amd.GetTable()
                     where cnt.SYSCODE == sysCode && cnt.MODELCODE == modelCode
                     orderby cnt.CREATEUSERID
                     select cnt;

            if (q.Count() > 0)
            {
                IsExist = true;
            }
            return(IsExist);
        }
Esempio n. 3
0
        /// <summary>
        /// 修改代理设置信息
        /// </summary>
        /// <param name="contraApproval">代理设置实体</param>
        /// <returns></returns>
        public bool UpdateAgentSet(T_OA_AGENTSET AgentSet)
        {
            bool result = false;

            try
            {
                AgentManagementDAL Amd = new AgentManagementDAL();
                var users = from ent in Amd.GetTable()
                            where ent.AGENTSETID == AgentSet.AGENTSETID
                            select ent;

                if (users.Count() > 0)
                {
                    var user = users.FirstOrDefault();
                    AgentSet.UPDATEDATE = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    user.SYSCODE        = AgentSet.SYSCODE;        //系统代码
                    user.MODELCODE      = AgentSet.MODELCODE;      //代理模块
                    user.AGENTPOSTID    = AgentSet.AGENTPOSTID;    //代理岗位
                    user.UPDATEUSERID   = AgentSet.UPDATEUSERID;   //修改人ID
                    user.UPDATEUSERNAME = AgentSet.UPDATEUSERNAME; //修改人姓名

                    int asUpdate = Amd.Update(user);

                    if (asUpdate > 0)
                    {
                        result = true;
                    }
                }
                return(result);
            }
            catch (Exception ex)
            {
                Tracer.Debug("代理岗位设置ProxySettingsBLL-UpdateAgentSet" + System.DateTime.Now.ToString() + " " + ex.ToString());
                throw (ex);
            }
        }