Exemple #1
0
 public virtual bool Insert(SMC_Role role)
 {
     try
     {
         SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
         if (autoDao.HasMaxID("SMC_Role"))
         {
             int max_id = autoDao.GetMaxID("SMC_Role");
             role.Role_ID = max_id + 1;
         }
         else
         {
             role.Role_ID = 1;
         }
         int i = SMC_RoleDao.Insert(role);
         if (i > 0)
         {
             autoDao.UpdateMaxID("SMC_Role");
         }
         return(i > 0);
     }
     catch (DalException ex)
     {
         throw new BOException("调用方法Insert失败", ex);
     }
 }
Exemple #2
0
 public virtual bool Insert(SMC_UserList userlist)
 {
     try
     {
         SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
         if (autoDao.HasMaxID("SMC_UserList"))
         {
             int max_id = autoDao.GetMaxID("SMC_UserList");
             userlist.UL_ID = max_id + 1;
         }
         else
         {
             userlist.UL_ID = 1;
         }
         int i = SMC_UserListDao.Insert(userlist);
         if (i > 0)
         {
             autoDao.UpdateMaxID("SMC_UserList");
         }
         return(i > 0);
     }
     catch (DalException ex)
     {
         throw new BOException("调用方法Insert失败", ex);
     }
 }
Exemple #3
0
        public virtual bool Insert(SMC_BUAUserSyncToInside unit)
        {
            try
            {
                SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                if (autoDao.HasMaxID("SMC_BUAUserSyncToInside"))
                {
                    int max_id = autoDao.GetMaxID("SMC_BUAUserSyncToInside");
                    unit.busi_id = max_id + 1;
                }
                else
                {
                    unit.busi_id = 1;
                }
                int i = SMC_BUAUserSyncToInsideDao.Insert(unit);

                autoDao.UpdateMaxID("SMC_BUAUserSyncToInside");

                return(i > 0);
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法Insert失败", ex);
            }
        }
Exemple #4
0
        public virtual bool InsertOrUpdate(SMC_PackageExtSyncToOutside unit)
        {
            try
            {
                int i = 0;
                SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                //int max_batno = 1;
                //if (autoDao.HasMaxID("sync_bat_no"))
                //{
                //    max_batno = autoDao.GetMaxID("sync_bat_no");
                //}

                if (SMC_PackageExtSyncToOutsideDao.Get(unit.peso_id) == null)
                {
                    if (autoDao.HasMaxID("SMC_PackageExtSyncToOutside"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_PackageExtSyncToOutside");
                        unit.pe_id = max_id + 1;
                    }
                    else
                    {
                        unit.pe_id = 1;
                    }
                    //unit.sync_bat_no = max_batno;
                    i = SMC_PackageExtSyncToOutsideDao.Insert(unit);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_PackageExtSyncToOutside");
                    }
                }
                else
                {
                    i = SMC_PackageExtSyncToOutsideDao.Update(unit);
                }

                return(true);
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
Exemple #5
0
        public virtual bool InsertOrUpdate(SMC_BUAUserSyncToInside unit)
        {
            try
            {
                int i = 0;
                if (SMC_BUAUserSyncToInsideDao.Get(unit.busi_id) == null)
                {
                    //i = SMC_UnitDao.Insert(unit);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_BUAUserSyncToInside"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_BUAUserSyncToInside");
                        unit.busi_id = max_id + 1;
                    }
                    else
                    {
                        unit.busi_id = 1;
                    }
                    i = SMC_BUAUserSyncToInsideDao.Insert(unit);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_BUAUserSyncToInside");
                    }
                }
                else
                {
                    i = SMC_BUAUserSyncToInsideDao.Update(unit);
                }

                return(true);
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
Exemple #6
0
        public virtual bool InsertOrUpdate(SMC_FunctionRole functionRole)
        {
            try
            {
                int i = 0;
                if (!SMC_FunctionRoleDao.Exists(functionRole.FR_ID) && !SMC_FunctionRoleDao.Exists(functionRole.FN_ID, functionRole.Role_ID))
                {
                    //i = SMC_FunctionRoleDao.Insert(functionRole);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_FunctionRole"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_FunctionRole");
                        functionRole.FR_ID = max_id + 1;
                    }
                    else
                    {
                        functionRole.FR_ID = 1;
                    }
                    i = SMC_FunctionRoleDao.Insert(functionRole);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_FunctionRole");
                    }
                }
                else
                {
                    i = SMC_FunctionRoleDao.Update(functionRole);
                }

                return(true);
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
        public virtual bool InsertOrUpdate(SMC_PackageExtSyncToOutside unit)
        {
            try
            {
                int i = 0;
                SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                //int max_batno = 1;
                //if (autoDao.HasMaxID("sync_bat_no"))
                //{
                //    max_batno = autoDao.GetMaxID("sync_bat_no");
                //}

                if (SMC_PackageExtSyncToOutsideDao.Get(unit.peso_id) == null)
                {

                    if (autoDao.HasMaxID("SMC_PackageExtSyncToOutside"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_PackageExtSyncToOutside");
                        unit.pe_id = max_id + 1;
                    }
                    else
                    {
                        unit.pe_id = 1;
                    }
                    //unit.sync_bat_no = max_batno;
                    i = SMC_PackageExtSyncToOutsideDao.Insert(unit);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_PackageExtSyncToOutside");
                    }
                }
                else
                {
                    i = SMC_PackageExtSyncToOutsideDao.Update(unit);
                }

                return true;
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
        public virtual bool InsertOrUpdate(SMC_BUAUserSyncToInside unit)
        {
            try
            {
                int i = 0;
                if (SMC_BUAUserSyncToInsideDao.Get(unit.busi_id) == null)
                {
                    //i = SMC_UnitDao.Insert(unit);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_BUAUserSyncToInside"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_BUAUserSyncToInside");
                        unit.busi_id = max_id + 1;
                    }
                    else
                    {
                        unit.busi_id = 1;
                    }
                    i = SMC_BUAUserSyncToInsideDao.Insert(unit);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_BUAUserSyncToInside");
                    }
                }
                else
                {
                    i = SMC_BUAUserSyncToInsideDao.Update(unit);
                }

                return true;
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
        public virtual bool Insert(SMC_BUAUserSyncToInside unit)
        {
            try
            {
                SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                if (autoDao.HasMaxID("SMC_BUAUserSyncToInside"))
                {
                    int max_id = autoDao.GetMaxID("SMC_BUAUserSyncToInside");
                    unit.busi_id = max_id + 1;
                }
                else
                {
                    unit.busi_id = 1;
                }
                int i = SMC_BUAUserSyncToInsideDao.Insert(unit);

                autoDao.UpdateMaxID("SMC_BUAUserSyncToInside");

                return i > 0;
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法Insert失败", ex);
            }
        }
Exemple #10
0
        public virtual bool InsertOrUpdate(SMC_User userList)
        {
            try
            {
                //IUserService us = Beyondbit.BUA.Client.ServiceFactory.Instance().GetUserService();
                //IOrgService os = Beyondbit.BUA.Client.ServiceFactory.Instance().GetOrgService();
                //Beyondbit.BUA.Client.User usr = null;
                //try
                //{
                //    usr = us.GetUserInfo(userList.UL_UID);
                //}
                //catch
                //{
                //}

                ////Beyondbit.BUA.Client.User[] _users = us.QueryUsersByObjectCode(ObjectType.User, userList.UL_UID);
                //if (usr == null)
                //{
                //    //新增用户到统一授权
                //    Beyondbit.BUA.Client.User u = new Beyondbit.BUA.Client.User();
                //    u.UserUid = userList.UL_UID;
                //    u.UserName = userList.UL_Name;
                //    u.UserFullName = userList.UL_Name;
                //    u.UserEmail = userList.UL_MailAddress == null ? "" : userList.UL_MailAddress;
                //    u.UserPersonal = new UserPersonal();
                //    u.UserPersonal.UserMobilePhone = userList.UL_MobilePhone;
                //    u.UnitCode = userList.Unit_ID;
                //    u.OrgCode = userList.Unit_ID;
                //    u.UserPassword = userList.UL_PWD;
                //    us.AddUser(u);
                //}
                //else
                //{
                //}
                int i = 0;
                if (SMC_UserDao.Get(userList.U_ID) == null)
                {
                    //i = SMC_UserListDao.Insert(userList);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_User"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_User");
                        userList.U_ID = max_id + 1;
                    }
                    else
                    {
                        userList.U_ID = 1;
                    }
                    i = SMC_UserDao.Insert(userList);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_User");
                    }
                }
                else
                {
                    i = SMC_UserDao.Update(userList);
                }

                return(true);
            }
            catch (DalException ex)
            {
                throw new BOException("调用方法InsertOrUpdate失败", ex);
            }
        }
        public virtual bool InsertOrUpdate(SMC_UserList userList)
        {
            try
            {
                IUserService us = Beyondbit.BUA.Client.ServiceFactory.Instance().GetUserService();
                IOrgService os = Beyondbit.BUA.Client.ServiceFactory.Instance().GetOrgService();
                Beyondbit.BUA.Client.User usr = null;
                try
                {
                    usr = us.GetUserInfo(userList.UL_UID);
                }
                catch
                {
                }

                //Beyondbit.BUA.Client.User[] _users = us.QueryUsersByObjectCode(ObjectType.User, userList.UL_UID);
                if (usr == null)
                {
                    try
                    {
                        //�����û���ͳһ��Ȩ
                        Beyondbit.BUA.Client.User u = new Beyondbit.BUA.Client.User();
                        u.UserUid = userList.UL_UID;
                        u.UserName = userList.UL_Name;
                        u.UserFullName = userList.UL_Name;
                        u.UserEmail = userList.UL_MailAddress == null ? "" : userList.UL_MailAddress;
                        u.UserPersonal = new UserPersonal();
                        u.UserPersonal.UserMobilePhone = userList.UL_MobilePhone;
                        u.UnitCode = userList.Unit_ID;
                        u.OrgCode = userList.Unit_ID;
                        u.UserPassword = userList.UL_PWD;
                        us.AddUser(u);
                    }
                    catch (Exception exe)
                    {
                    }
                }
                else
                {
                }

                int i = 0;
                if (SMC_UserListDao.Get(userList.UL_ID) == null)
                {
                    //i = SMC_UserListDao.Insert(userList);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_UserList"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_UserList");
                        userList.UL_ID = max_id + 1;
                    }
                    else
                    {
                        userList.UL_ID = 1;
                    }
                    i = SMC_UserListDao.Insert(userList);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_UserList");
                    }
                }
                else
                {
                    i = SMC_UserListDao.Update(userList);
                }

                return true;
            }
            catch (DalException ex)
            {
                throw new BOException("���÷���InsertOrUpdateʧ��", ex);
            }
        }
 public virtual bool Insert(SMC_UserList userlist)
 {
     try
     {
         SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
         if (autoDao.HasMaxID("SMC_UserList"))
         {
             int max_id = autoDao.GetMaxID("SMC_UserList");
             userlist.UL_ID = max_id + 1;
         }
         else
         {
             userlist.UL_ID = 1;
         }
         int i = SMC_UserListDao.Insert(userlist);
         if (i > 0)
         {
             autoDao.UpdateMaxID("SMC_UserList");
         }
         return i > 0;
     }
     catch (DalException ex)
     {
         throw new BOException("���÷���Insertʧ��", ex);
     }
 }
        public virtual bool InsertOrUpdate(SMC_FunctionRole functionRole)
        {
            try
            {
                int i = 0;
                if (!SMC_FunctionRoleDao.Exists(functionRole.FR_ID) && !SMC_FunctionRoleDao.Exists(functionRole.FN_ID, functionRole.Role_ID))
                {
                    //i = SMC_FunctionRoleDao.Insert(functionRole);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_FunctionRole"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_FunctionRole");
                        functionRole.FR_ID = max_id + 1;
                    }
                    else
                    {
                        functionRole.FR_ID = 1;
                    }
                    i = SMC_FunctionRoleDao.Insert(functionRole);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_FunctionRole");
                    }
                }
                else
                {
                    i = SMC_FunctionRoleDao.Update(functionRole);
                }

                return true;
            }
            catch (DalException ex)
            {
                throw new BOException("���÷���InsertOrUpdateʧ��", ex);
            }
        }
 public virtual bool Insert(SMC_FunctionRole functionRole)
 {
     try
     {
         SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
         if (autoDao.HasMaxID("SMC_FunctionRole"))
         {
             int max_id = autoDao.GetMaxID("SMC_FunctionRole");
             functionRole.FR_ID = max_id + 1;
         }
         else
         {
             functionRole.FR_ID = 1;
         }
         int i = SMC_FunctionRoleDao.Insert(functionRole);
         if (i > 0)
         {
             autoDao.UpdateMaxID("SMC_FunctionRole");
         }
         return i > 0;
     }
     catch (DalException ex)
     {
         throw new BOException("���÷���Insertʧ��", ex);
     }
 }
        public virtual bool InsertOrUpdate(SMC_Role role)
        {
            try
            {
                int i = 0;
                if (SMC_RoleDao.Get(role.Role_ID) == null)
                {
                    //i = SMC_RoleDao.Insert(role);
                    SMC_AutoTableIDDao autoDao = new SMC_AutoTableIDDao(AppConfig.statisticDBKey);
                    if (autoDao.HasMaxID("SMC_Role"))
                    {
                        int max_id = autoDao.GetMaxID("SMC_Role");
                        role.Role_ID = max_id + 1;
                    }
                    else
                    {
                        role.Role_ID = 1;
                    }
                    i = SMC_RoleDao.Insert(role);
                    if (true)
                    {
                        autoDao.UpdateMaxID("SMC_Role");
                    }
                }
                else
                {
                    i = SMC_RoleDao.Update(role);
                }

                return true;
            }
            catch (DalException ex)
            {
                throw new BOException("���÷���InsertOrUpdateʧ��", ex);
            }
        }