Ejemplo n.º 1
0
 public Main(IPaintService paintService)
 {
     _paintService = paintService;
     InitializeComponent();
     ManufacturerList = _paintService.GetAllManufacturers().ToList();
     CurrentPartLog   = new PartLog();
 }
Ejemplo n.º 2
0
        public void Save(ref PartLog model)
        {
            string procName = "paint.part_log_save";
            List <SqlParameter> collection = new List <SqlParameter>();

            collection.Add(new SqlParameter()
            {
                ParameterName = "@data", Direction = ParameterDirection.Input, Value = ToXML(model), DbType = DbType.Xml
            });

            model.PartLogId = (long)ExecuteScalar(procName, collection.ToArray(), _connectionString);
        }
Ejemplo n.º 3
0
 public void SavePartLog(ref PartLog model)
 {
     _partLogRepository.Save(ref model);
 }
Ejemplo n.º 4
0
 public void Save(ref PartLog model)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            var user = new ApplicationUser("Test")
            {
                Email       = "*****@*****.**",
                PhoneNumber = "5625625622"
            };
            //IdentityResult result = new IdentityManager().GetIdentityUserManager()
            //    .CreateAsync(user,"testpass").Result;

            //var test = new IdentityManager().GetUserManager();
            //var res = test.FindByEmail("*****@*****.**");
            var settings = new Settings("DefaultConnection");

            IColorRepository        c  = new ColorRepository(settings);
            IDefectRepository       d  = new DefectRepository(settings);
            IManufacturerRepository m  = new ManufacturerRepository(settings);
            IMixRoomRepository      mx = new MixRoomRepository(settings);
            IPartLogRepository      pt = new PartLogRepository(settings);
            IPartRepository         p  = new PartRepository(settings);
            ISolventRepository      s  = new SolventRepository(settings);

            IPaintService service = new PaintService(c, d, m, mx, pt, p, s);


            var defects = service.GetAllDefects();
            var colors  = service.GetAllColors();
            var manu    = service.GetAllManufacturers();
            var parts   = service.GetAllParts();
            var manu1   = service.GetPartsByManufacturerId(1);



            var     PostLogRepository = new PartLogRepository(settings);
            PartLog log = new PartLog();

            log.ColorId        = 1;
            log.SolventId      = 1;
            log.ManufacturerId = 1;
            log.PartId         = 1;
            log.HasDefect      = true;
            log.BarcodeId      = 42342342;
            log.AddedBy        = "Ani";
            var de = new Defect();

            de.DefectId = 1;
            log.Defects.Add(de);

            PostLogRepository.Save(ref log);

            //if (result != null)
            //{
            //    //Add role.
            //    if (result.Succeeded)
            //    {
            //        ////Send email to customer about account creation.
            //        //currentUser = GetUserByPhone(customerOrder.PhoneNumber);
            //        //new IdentityManager().AddUserToRole(currentUser.UserID, EnumRoles.Customer.ToString());
            //    }
            //}

            return(View());
        }