Esempio n. 1
0
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="usercid">所属部门</param>
        /// <param name="department">所属部门</param>
        /// <param name="name">真实姓名</param>
        /// <param name="phone">联系电话</param>
        /// <param name="weixin">微信号</param>
        /// <returns>返回类</returns>
        public SpRequestMsg UpdateUser(string department, string name, string phone, string weixin, string usercid)
        {
            //TODO
            SpRequestMsg pSpRequestMsg = new SpRequestMsg();

            pSpRequestMsg.data = "";
            ISPService service = SpServiceFactory.CreateServiceBase();

            try
            {
                string Uname   = "UPDATE p_user SET xm = '" + name + "' WHERE cid = " + usercid + "";
                string Uphone  = "UPDATE p_user SET dh = " + phone + " WHERE cid = " + usercid + "";
                string Uweixin = "UPDATE p_user SET wx = " + weixin + " WHERE cid = " + usercid + "";
                ApplicationManager.DefaultConnection.ExcuteData(Uname);
                ApplicationManager.DefaultConnection.ExcuteData(Uphone);
                ApplicationManager.DefaultConnection.ExcuteData(Uweixin);
                pSpRequestMsg.success = true;
                pSpRequestMsg.message = "信息修改成功!";
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "信息修改请求异常,详情" + ex.Message;
            }



            return(pSpRequestMsg);
        }
Esempio n. 2
0
 public ThanaController(IThanaService thanaService, IDivisionService divisionService
                        , IDistrictService districtService, ISPService spService)
 {
     this.thanaService    = thanaService;
     this.divisionService = divisionService;
     this.districtService = districtService;
     this.spService       = spService;
 }
Esempio n. 3
0
 public AccessController(ISPService spService, IReportInformationService reportInformationService, IReportAccessService reportAccessService,
                         IAspNetUserService aspNetUserService, ISecurityService securityService)
 {
     this.spService = spService;
     this.reportInformationService = reportInformationService;
     this.reportAccessService      = reportAccessService;
     this.aspNetUserService        = aspNetUserService;
     this.securityService          = securityService;
 }
Esempio n. 4
0
 public ReportsController(ISPService sPService, IOrganizationService organizationService
                          , IDepartmentService departmentService, IDesignationService designationService, ITeamService teamService)
 {
     this.sPService           = sPService;
     this.organizationService = organizationService;
     this.departmentService   = departmentService;
     this.designationService  = designationService;
     this.teamService         = teamService;
 }
Esempio n. 5
0
 public AccountController(UserManager <ApplicationUser> userManager, ILogger loggger
                          , IOfficeExecutiveService officeExecutiveService, IAspNetRoleService roleService
                          , IAspNetUserService aspNetUserService, IUserInfoSPService userInfoSPService
                          , ISecurityService securityService, ISPService sPService
                          , IOrganizationService organizationService, IGroupSetupService groupSetupService)
 {
     this.userManager            = userManager;
     this.loggger                = loggger;
     this.officeExecutiveService = officeExecutiveService;
     this.roleService            = roleService;
     this.aspNetUserService      = aspNetUserService;
     this.userInfoSPService      = userInfoSPService;
     this.securityService        = securityService;
     this.sPService              = sPService;
     this.organizationService    = organizationService;
     this.groupSetupService      = groupSetupService;
 }
 public OfficeExecutiveController(IOfficeExecutiveService officeExecutiveService, IOrganizationService organizationService
                                  , IDesignationService designationService, IDepartmentService departmentService
                                  , IGenderService genderService, IDivisionService divisionService, IDistrictService districtService
                                  , IThanaService thanaService, ICountryService countryService, ITeamService teamService
                                  , IProfessionService professionService, ISPService spService)
 {
     this.officeExecutiveService = officeExecutiveService;
     this.organizationService    = organizationService;
     this.designationService     = designationService;
     this.departmentService      = departmentService;
     this.genderService          = genderService;
     this.divisionService        = divisionService;
     this.districtService        = districtService;
     this.thanaService           = thanaService;
     this.countryService         = countryService;
     this.teamService            = teamService;
     this.professionService      = professionService;
     this.spService = spService;
 }
Esempio n. 7
0
        /// <summary>
        /// 密码修改
        /// </summary>
        /// <param name="cid">用户唯一编号</param>
        /// <param name="userName">用户名</param>
        /// <param name="oldPassword">旧密码</param>
        /// <param name="newPassword">新密码</param>
        /// <param name="rePassword">重复密码</param>
        /// <returns></returns>
        public SpRequestMsg UpdatePassword(string cid, string userName, string oldPassword, string newPassword, string rePassword)
        {
            SpRequestMsg pSpRequestMsg = new SpRequestMsg();

            pSpRequestMsg.data = "";
            ISPService service = SpServiceFactory.CreateServiceBase();

            try {
                string           oldPwd     = Sp.BaseFrame.Common.Util.AESEncryptionUtils.Encrypt(oldPassword);
                MySqlParameter[] parameters = { new MySqlParameter("?mm", oldPwd) };
                //判断是否存在
                DataTable dtExist = ApplicationManager.DefaultConnection.QueryData("select mm from p_user where mm=?mm", parameters, 0).Tables[0];
                if (dtExist.Rows.Count > 0)
                {
                    pSpRequestMsg.success = true;
                    pSpRequestMsg.message = "密码匹配正确!";


                    if (newPassword != rePassword)
                    {
                        pSpRequestMsg.success = false;
                        pSpRequestMsg.message = "前后密码输入不一致!";
                    }
                    else
                    {
                        string NewPwd = Sp.BaseFrame.Common.Util.AESEncryptionUtils.Encrypt(newPassword);//加密新添加密码
                        string updata = "UPDATE p_user SET mm = '" + NewPwd + "' WHERE cid = " + cid + " ";
                        ApplicationManager.DefaultConnection.ExcuteData(updata);
                        pSpRequestMsg.message = "密码修改成功!";
                    }
                }
            }
            catch (Exception ex)
            {
                pSpRequestMsg.success = false;
                pSpRequestMsg.message = "密码修改请求异常,详情" + ex.Message;
            }

            return(pSpRequestMsg);
        }
Esempio n. 8
0
 public DatabaseBackupController(ISPService spService)
 {
     this.spService = spService;
 }
Esempio n. 9
0
 public BankBranchController(ISPService spService)
 {
     this.spService = spService;
 }
Esempio n. 10
0
 public SecurityService(ISecurityRepository repository, IAspNetRoleModuleSPService aspNetRoleModuleSPService, ISPService spService)
 {
     this.repository = repository;
     this.aspNetRoleModuleSPService = aspNetRoleModuleSPService;
     this.spService = spService;
 }
Esempio n. 11
0
        static void Main(string[] args)
        {
            Console.WriteLine(string.Format("ed = {0}, Tom = {1}", "cool", "less cool"));
            //SRP
            Console.WriteLine("SRP");
            UserStorage  s = new UserStorage();
            EmailStorage e = new EmailStorage();

            SRPService main = new SRPService(s, e);

            Console.WriteLine("_________________________________");
            Console.WriteLine("OCP");
            //OCP
            OCPService ocp = new OCPService();

            Console.WriteLine("_________________________________");
            Console.WriteLine("LSP");
            //LSP
            LSPService lsp = new LSPService();

            Console.WriteLine("_________________________________");
            Console.WriteLine("ISP");
            //ISP
            ISPService isp = new ISPService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("DIP");
            //DIP
            DIPService sip = new DIPService();

            Console.WriteLine("_________________________________");
            Console.WriteLine("Law of Demeter");
            //Law of demeter
            Demeter dim = new Demeter();

            Console.WriteLine("_________________________________");
            Console.WriteLine("Factory pattern");
            //factory
            FactoryService factory = new FactoryService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("Adaptor Pattern");
            //Adaptor pattern
            AdaptorService adaptorService = new AdaptorService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("Decorator Pattern");
            //decorator pattern
            DecoratorService decoratorService = new DecoratorService();

            Console.WriteLine("_________________________________");


            Console.WriteLine("Repository Pattern");
            //Repository pattern
            RepositoryService RepositoryService = new RepositoryService();

            Console.WriteLine("_________________________________");


            Console.WriteLine("Tree Traversal");
            //BinaryTree Traversal
            BinaryTreeService BinaryTreeService = new BinaryTreeService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("Number Swap");
            //Number Swap
            NumberSwapService NumberSwapService = new NumberSwapService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("Multiply");
            //Multiply
            MultiplyService MultiplyService = new MultiplyService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("OverflowChecked");
            //OverflowCheckedService
            OverflowCheckedService OverflowChecked = new OverflowCheckedService();

            Console.WriteLine("_________________________________");

            Console.WriteLine("By Ref");
            //pass by reference
            ByRefService ByRefService = new ByRefService();

            Console.WriteLine("_________________________________");

            Console.WriteLine(" EF Code FirstService");
            //EFCodeFirstService
            //EFCodeFirstService EFCodeFirstService = new EFCodeFirstService();
            Console.WriteLine("_________________________________");
            //read
            Console.ReadLine();
        }
Esempio n. 12
0
 public HomeController(ISPService spService)
 {
     this.spService = spService;
 }