public void gvPartAssyList_OnRowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
        {
            if ((!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Header.ToString())) & (!e.Row.RowType.ToString().Trim().Equals(System.Web.UI.WebControls.ListItemType.Footer.ToString())))
            {
                System.Web.UI.WebControls.Label lbl = new Label();

                try
                {
                    lbl = (Label)e.Row.Cells[0].FindControl("lblBOMPartID");
                    PART compPart = SQMModelMgr.LookupPart(Convert.ToDecimal(lbl.Text), SessionManager.SessionContext.ActiveCompany().COMPANY_ID);  // mt - todo: get the component part info from the original query
                    if (compPart != null)
                    {
                        lbl      = (Label)e.Row.Cells[0].FindControl("lblCompPartNum");
                        lbl.Text = compPart.PART_NUM;
                        lbl      = (Label)e.Row.Cells[0].FindControl("lblCompPartName");
                        lbl.Text = compPart.PART_NAME;
                        lbl      = (Label)e.Row.Cells[0].FindControl("lblCompSerial");
                        lbl.Text = compPart.SERIAL_NUM;
                    }
                }
                catch
                {
                }
            }
        }
Пример #2
0
            public Part getPart(PART part)
            {
                switch (part)
                {
                case PART.CPU_SINGLE_CORE:  return(new SingleCore());

                case PART.CPU_DUAL_CORE:    return(new DualCore());

                case PART.CPU_QUAD_CORE:    return(new QuadCore());

                case PART.RAM_2GB:          return(new Ram2GB());

                case PART.RAM_4GB:          return(new Ram4GB());

                case PART.RAM_8GB:          return(new Ram8GB());

                case PART.GPU_INTEL:        return(new IntelGpu());

                case PART.GPU_NVIDIA:       return(new NvidiaGpu());

                case PART.GPU_ATI:          return(new ATIGpu());

                default:                    return(new PartNotFound());
                }
            }
 protected void OnPartListClick(decimal partID)
 {
     if (partID > 0)
     {
         PART part = SQMModelMgr.LookupPart(_entities, partID, "", 0, false);
         rsbPart.Text = part.PART_NUM;
         if (OnSearchItemSelect != null)
         {
             OnSearchItemSelect(partID.ToString());
         }
     }
 }
Пример #4
0
        public PART PART_NEW(int batch_id, int part_index, int quantity, DateTime first_date) //para migracion
        {
            var nuevo = new PART();

            nuevo.article_id = batch_id;
            nuevo.part_index = part_index;
            nuevo.quantity   = quantity;
            nuevo.first_date = first_date;
            _context.PARTS.AddObject(nuevo);
            _context.SaveChanges();
            _load_parts();
            return(nuevo);
        }
Пример #5
0
        private void SetupPage()
        {
            PART part = (PART)SessionManager.Part;

            ctlPlanMgr.Load(SessionManager.Part.PART_ID);
            divPageBody.Visible = true;

            if (ctlPlanMgr.CtlPlan != null)
            {
                uclItemHdr.DisplayCtlPlan(part, ctlPlanMgr.CtlPlan);

                DoCtlPlanSteps();
            }
        }
Пример #6
0
        public RespuestaAccion REGISTER_PURCHASE(int batch_id, DateTime fecha_compra, decimal valor_total, int cantidad_total)
        {
            var res = new RespuestaAccion();

            try
            {
                decimal valor_unitario = (valor_total / cantidad_total);
                //siempre se generara solo 1 registro por compra
                //int residuo = (int)(valor_total - (valor_unitario * cantidad_total));
                //if (residuo == 0)
                //{
                //solo requiero 1 parte
                PART part1 = new PART();
                part1.article_id = batch_id;
                part1.part_index = 0;
                part1.quantity   = cantidad_total;
                part1.first_date = fecha_compra;

                _context.PARTS.AddObject(part1);
                _context.SaveChanges();

                res.result_objs.Add((SV_PART)part1);
                //}
                //else
                //{
                //PART part1 = new PART();
                //part1.article_id = batch_id;
                //part1.part_index = 0;
                //part1.quantity = cantidad_total - residuo;
                //part1.first_date = fecha_compra;
                //_context.PARTS.AddObject(part1);

                //PART part2 = new PART();
                //part2.article_id = batch_id;
                //part2.part_index = 1;
                //part2.quantity = residuo;
                //part2.first_date = fecha_compra;
                //_context.PARTS.AddObject(part2);
                //_context.SaveChanges();
                //res.result_objs.Add((SV_PART)part1);
                //res.result_objs.Add((SV_PART)part2);
                //}
                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
Пример #7
0
        public ActionResult PartsInsertOrEdit(int partID)
        {
            using (DBEPREntities db = new DBEPREntities())
            {
                PartsViewModel pvm = new PartsViewModel();
                //for Modals:
                List <SUPPLIER> sList = db.SUPPLIERS.Where(s => s.IsDeleted == false).ToList();
                ViewBag.SupplierList = new SelectList(sList, "ID", "Name");
                List <MACHINE> mList = db.MACHINES.Where(s => s.IsDeleted == false).ToList();
                ViewBag.MachineList = new SelectList(mList, "ID", "Name");
                List <MANUFACTURER> manList = db.MANUFACTURERS.Where(s => s.IsDeleted == false).ToList();
                ViewBag.ManufacturerList = new SelectList(manList, "ID", "Name");
                List <OEM> oList = db.OEMS.Where(s => s.IsDeleted == false).ToList();
                ViewBag.OEMList = new SelectList(oList, "ID", "Name");
                List <UZAUTOSUPPLIER> uList = db.UZAUTOSUPPLIERS.Where(s => s.IsDeleted == false).ToList();
                ViewBag.UzAutoSupplierList = new SelectList(uList, "ID", "Name");

                if (partID > 0)
                {
                    PART part = db.PARTS.SingleOrDefault(p => p.IsDeleted == false && p.ID == partID);
                    if (part != null)
                    {
                        pvm.ID                = part.ID;
                        pvm.Name              = part.Name;
                        pvm.NameRus           = part.NameRus;
                        pvm.Description       = part.Description;
                        pvm.DescriptionRus    = part.DescriptionRus;
                        pvm.Code              = part.Code;
                        pvm.Currency          = part.Currency;
                        pvm.Manufactured_Date = part.Manufactured_Date;
                        pvm.PartNumber        = part.PartNumber;
                        pvm.Modeli            = part.Modeli;
                        pvm.OEMPartNumber     = part.OEMPartNumber;
                        pvm.Price             = part.Price;
                        pvm.SerialNumber      = part.SerialNumber;
                        pvm.TechData          = part.TechData;
                        pvm.Type              = part.Type;
                        pvm.Unit              = part.Unit;
                        pvm.MachineID         = part.MachineID;
                        pvm.ManufacturerID    = part.ManufacturerID;
                        pvm.SupplierID        = part.SupplierID;
                        pvm.OEMID             = part.OEMID;
                        pvm.UzAutoSupplierID  = part.UzAutoSupplierID;
                    }
                }
                return(PartialView("PartsInsertOrEdit", pvm));
            }
        }
Пример #8
0
        public JsonResult PartsDelete(int partID)
        {
            bool result = false;

            using (DBEPREntities db = new DBEPREntities())
            {
                PART part = db.PARTS.SingleOrDefault(p => p.IsDeleted == false && p.ID == partID);
                if (part != null)
                {
                    part.IsDeleted = true;
                    db.SaveChanges();
                    result = true;
                }
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        private void SetupPage()
        {
            PART part = (PART)SessionManager.Part;

            ctlPlan = CtlPlanMgr.LookupControlPlan(SessionManager.Part.PART_ID);
            if (ctlPlan != null)
            {
                // part summary area
                SetFindControlValue("lblCompany_out", hfBase, SessionManager.SessionContext.ActiveCompany().COMPANY_NAME);
                SetFindControlValue("lblPartNumFull_out", hfBase, SQMModelMgr.GetFullPartNumber(part));
                SetFindControlValue("lblPartName_out", hfBase, part.PART_NAME);

                SetFindControlValue("lblPlanName_out", hfBase, ctlPlan.CTLPLAN_NAME);
                SetFindControlValue("lblPlanVersion_out", hfBase, ctlPlan.VERSION);
                SetFindControlValue("lblPlanDesc_out", hfBase, ctlPlan.CTLPLAN_DESC);
                SetFindControlValue("lblPlanType_out", hfBase, WebSiteCommon.GetXlatValueLong("planType", ctlPlan.CTLPLAN_TYPE));
                SetFindControlValue("lblPlanRef_out", hfBase, ctlPlan.RTE_REF);
                SetFindControlValue("lblPlanResponsible_out", hfBase, ctlPlan.RESPONSIBILITY);
                SetFindControlValue("lblEffDate_out", hfBase, ctlPlan.EFF_DATE.ToString());

                DoCtlPlanSteps();
            }
        }
Пример #10
0
        public RespuestaAccion CREATE_PART_NEW(int batch_id, int part_index, int quantity, DateTime movement_date)
        {
            var res = new RespuestaAccion();

            try
            {
                var nuevo = new PART();
                nuevo.article_id = batch_id;
                nuevo.part_index = part_index;
                nuevo.quantity   = quantity;
                nuevo.first_date = movement_date;
                _context.PARTS.AddObject(nuevo);
                _context.SaveChanges();
                _load_parts();
                res.result_objs.Add((SV_PART)nuevo);
                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }
        private void OnPartSelect(string partID)
        {
            PART part = SQMModelMgr.LookupPart(new PSsqmEntities(), Convert.ToDecimal(partID), "", SessionManager.PrimaryCompany().COMPANY_ID, false);

            if (part != null)
            {
                IssueCtl().qualityIssue.IssueOccur.PART_ID = part.PART_ID;
                PartData partData = SQMModelMgr.LookupPartData(new PSsqmEntities(), SessionManager.PrimaryCompany().COMPANY_ID, part.PART_ID);
                partData.Locations();
                IssueCtl().qualityIssue.AddPartInfo(partData);
                lblPartDesc.Text = part.PART_NAME;
                ddlResponsibleLocation.Items.Clear();
                ddlResponsibleLocation.Items.Add(new RadComboBoxItem(IssueCtl().qualityIssue.DetectedLocation.Company.COMPANY_NAME + ", " + IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_NAME, IssueCtl().qualityIssue.DetectedLocation.Plant.PLANT_ID.ToString()));
                if (IssueCtl().qualityIssue.Partdata.B2BList != null)
                {
                    foreach (BusinessLocation location in IssueCtl().qualityIssue.Partdata.B2BList)
                    {
                        if (ddlResponsibleLocation.Items.FindItemByValue(location.Plant.PLANT_ID.ToString()) == null)
                        {
                            ddlResponsibleLocation.Items.Add(new RadComboBoxItem(location.Company.COMPANY_NAME + ", " + location.Plant.PLANT_NAME, location.Plant.PLANT_ID.ToString()));
                        }
                    }
                    if (IssueCtl().qualityIssue.Incident.RESP_PLANT_ID.HasValue)
                    {
                        ddlResponsibleLocation.SelectedValue = IssueCtl().qualityIssue.Incident.RESP_PLANT_ID.ToString();
                    }
                    else if (ddlResponsibleLocation.Items.Count > 0)
                    {
                        ddlResponsibleLocation.SelectedIndex = 0;
                    }

                    GetResponsibleList();
                }
                updResponsible.Update();
            }
        }
Пример #12
0
        public ActionResult PartsSave(PartsViewModel model)
        {
            ///////////////////////////////////////////
            string        connetionString;
            SqlConnection cnn;

            connetionString = @"Data Source=89.236.217.150;Initial Catalog=DBEPR;User ID=EPRuser;Password=Zxcv!123";
            cnn             = new SqlConnection(connetionString);
            cnn.Open();
            string sql = @"INSERT INTO testtable (id,test) VALUES ('xxxx','ZZZ')";

            using (SqlCommand cmd = new SqlCommand(sql, cnn))
            {
                cmd.CommandText = sql;
                cmd.ExecuteNonQuery();
            }
            cnn.Close();
            ////////////////////////////////////////////
            ///
            using (DBEPREntities db = new DBEPREntities())
            {
                if (model.ID > 0)
                {
                    PART part = db.PARTS.SingleOrDefault(p => p.IsDeleted == false && p.ID == model.ID);
                    if (part != null)
                    {
                        part.ID                = model.ID;
                        part.Name              = model.Name;
                        part.NameRus           = model.NameRus;
                        part.Description       = model.Description;
                        part.DescriptionRus    = model.DescriptionRus;
                        part.Code              = model.DescriptionRus;
                        part.Currency          = model.Currency;
                        part.Manufactured_Date = model.Manufactured_Date;
                        part.Modeli            = model.Modeli;
                        part.OEMPartNumber     = model.OEMPartNumber;
                        part.Price             = model.Price;
                        part.SerialNumber      = model.SerialNumber;
                        part.TechData          = model.TechData;
                        part.Type              = model.Type;
                        part.Unit              = model.Unit;
                        part.MachineID         = model.MachineID;
                        part.ManufacturerID    = model.ManufacturerID;
                        part.SupplierID        = model.SupplierID;
                        part.OEMID             = model.OEMID;
                        part.UzAutoSupplierID  = model.UzAutoSupplierID;

                        db.SaveChanges();
                    }
                }
                else
                {
                    PART p = new PART();

                    p.Code             = model.Code;
                    p.Description      = model.Description;
                    p.DescriptionRus   = model.DescriptionRus;
                    p.MachineID        = model.MachineID;
                    p.SupplierID       = model.SupplierID;
                    p.OEMID            = model.OEMID;
                    p.ManufacturerID   = model.ManufacturerID;
                    p.UzAutoSupplierID = model.UzAutoSupplierID;
                    p.PartNumber       = model.PartNumber;
                    p.OEMPartNumber    = model.OEMPartNumber;
                    //p.NamePlate = model.NamePlate;
                    p.Name              = model.Name;
                    p.NameRus           = model.NameRus;
                    p.Modeli            = model.Modeli;
                    p.Type              = model.Type;
                    p.SerialNumber      = model.SerialNumber;
                    p.Manufactured_Date = model.Manufactured_Date;
                    p.TechData          = model.TechData;
                    p.Unit              = model.Unit;
                    p.Price             = model.Price;
                    p.Currency          = model.Currency;
                    p.IsDeleted         = false;

                    db.PARTS.Add(p);
                    db.SaveChanges();
                }

                return(View(model));
            }
        }
Пример #13
0
 public PARTHandler(ISession client, ChatCommandBase cmd) : base(client, cmd)
 {
     _cmd = (PART)cmd;
 }
Пример #14
0
        private void GetPART(string file)
        {
            XmlDocument doc = new XmlDocument();
            PART part = new PART();
            string[] hdds = part.hdd_types.Split(',');
            string[] odds = part.odd_types.Split(',');
            string[] pcis = part.pci_types.Split(',');

            // Inicializar los contadores
            mem_count = 0;
            hdd_count = 0;
            pci_count = 0;
            op_count = 0;
            prc_count = 0;
            bp_count = 0;

            doc.Load(file);
            XmlNodeList part_nodes = doc.DocumentElement.SelectNodes("/GCF/DATACONTAINERS/CONTAINER/PARTS/PART");
            foreach (XmlNode xn in part_nodes)
            {
                if (xn.Attributes["description"].Value.Contains("MOD,INFO"))
                {
                    mods.Text += @"<span class=""titulo"">Numero de Parte</span>" + "<br />" + xn.Attributes["partNumber"].Value + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + xn.Attributes["description"].Value + "<hr>";
                }

                else if (xn.Attributes["description"].Value.Contains("INFO,"))
                {
                    infos.Text += @"<span class=""titulo"">Numero de Parte</span>" + "<br />" + xn.Attributes["partNumber"].Value + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + xn.Attributes["description"].Value + "<hr>";
                }

                switch (xn.Attributes["sdrType"].Value)
                {
                    case "system_memory_module":
                        part.pn = xn.Attributes["partNumber"].Value;
                        part.description = xn.Attributes["description"].Value;
                        Memorias.Text += @"<span class=""titulo"">Numero de Parte</span>" + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<hr>";
                        mem_count++;
                        break;

                    case "backplane":
                         part.pn = xn.Attributes["partNumber"].Value;
                         part.description = xn.Attributes["description"].Value;
                         Backplane.Text += @"<span class=""titulo"">Numero de Parte</span>" + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<hr>";
                         bp_count++;
                         break;

                    case "processor":
                        part.pn = xn.Attributes["partNumber"].Value;
                        part.description = xn.Attributes["description"].Value;
                        Processor.Text += @"<span class=""titulo"">Numero de Parte</span> " + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<hr>";
                        prc_count++;
                        break;
                }

                if (hdds.Contains(xn.Attributes["sdrType"].Value))
                {
                    part.pn = xn.Attributes["partNumber"].Value;
                    part.description = xn.Attributes["description"].Value;
                    HDD.Text += @"<span class=""titulo"">Numero de Parte</span>" + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<hr>";
                    hdd_count++;
                }

                else if (pcis.Contains(xn.Attributes["sdrType"].Value))
                {
                    part.pn = xn.Attributes["partNumber"].Value;
                    part.description = xn.Attributes["description"].Value;
                    pci.Text += @"<span class=""titulo"">Numero de Parte</span> " + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<br />" + @"<span class=""titulo"">Tipo</span>" + "<br />" + xn.Attributes["sdrType"].Value + "<hr>";
                    pci_count++;
                }

                else if (odds.Contains(xn.Attributes["sdrType"].Value))
                {
                    part.pn = xn.Attributes["partNumber"].Value;
                    part.description = xn.Attributes["description"].Value;
                    optic.Text += @"<span class=""titulo"">Numero de Parte</span> " + "<br />" + part.pn + "<br />" + @"<span class=""titulo"">Descripcion</span>" + "<br />" + part.description + "<hr>";
                    op_count++;
                }

            }
        }
Пример #15
0
 public Part getPart(PART part)
 {
     switch(part)
     {
         case PART.CPU_SINGLE_CORE:  return new SingleCore();
         case PART.CPU_DUAL_CORE:    return new DualCore();
         case PART.CPU_QUAD_CORE:    return new QuadCore();
         case PART.RAM_2GB:          return new Ram2GB();
         case PART.RAM_4GB:          return new Ram4GB();
         case PART.RAM_8GB:          return new Ram8GB();
         case PART.GPU_INTEL:        return new IntelGpu();
         case PART.GPU_NVIDIA:       return new NvidiaGpu();
         case PART.GPU_ATI:          return new ATIGpu();
         default:                    return new PartNotFound();
     }
 }
Пример #16
0
        public RespuestaAccion CREATE_NEW_PART_FROM(int batch_id, int source_part_id, int quantity, DateTime movement_date)
        {
            var res = new RespuestaAccion();

            try
            {
                var source_part       = Partes.ById(source_part_id);
                int current_max_index = Partes.ByLote(batch_id).Max(p => p.part_index);

                //creo nueva parte
                var nueva_parte = new PART();
                nueva_parte.article_id = batch_id;
                nueva_parte.part_index = current_max_index + 1;
                nueva_parte.quantity   = quantity;
                nueva_parte.first_date = movement_date;
                _context.PARTS.AddObject(nueva_parte);

                //actualizo cantidad parte antigua
                var busca = _context.PARTS.Where(p => p.id == source_part_id).FirstOrDefault();
                busca.quantity = source_part.quantity - quantity;

                //copio transacciones a la nueva parte y sus relacionados desde la parte origen
                //copio cabeceras de transacciones
                var source_trx_heads = cabeceras.ByParte(source_part_id);
                foreach (SV_TRANSACTION_HEADER s_trx_head in source_trx_heads)
                {
                    TRANSACTION_HEADER nueva_head = new TRANSACTION_HEADER();
                    nueva_head.PART              = nueva_parte; //con este relacionamos a la nueva parte
                    nueva_head.head_index        = s_trx_head.head_index;
                    nueva_head.trx_ini           = s_trx_head.trx_ini;
                    nueva_head.trx_end           = s_trx_head.trx_end;
                    nueva_head.ref_source        = s_trx_head.ref_source;
                    nueva_head.zone_id           = s_trx_head.zone_id;
                    nueva_head.subzone_id        = s_trx_head.subzone_id;
                    nueva_head.kind_id           = s_trx_head.kind_id;
                    nueva_head.subkind_id        = s_trx_head.subkind_id;
                    nueva_head.category_id       = s_trx_head.category_id;
                    nueva_head.user_own          = s_trx_head.user_own;
                    nueva_head.manage_id         = s_trx_head.manage_id;
                    nueva_head.method_revalue_id = s_trx_head.method_revalue_id;
                    _context.TRANSACTIONS_HEADERS.AddObject(nueva_head);

                    //copio detalles de transacciones
                    var source_trx_details = detalles.GetByHead(s_trx_head.id);
                    foreach (SV_TRANSACTION_DETAIL s_trx_detail in source_trx_details)
                    {
                        TRANSACTION_DETAIL nuevo_detail = new TRANSACTION_DETAIL();
                        nuevo_detail.TRANSACTION_HEADER = nueva_head; //con este relacionamos a la nueva cabecera
                        nuevo_detail.system_id          = s_trx_detail.system_id;
                        nuevo_detail.validity_id        = s_trx_detail.validity_id;
                        nuevo_detail.depreciate         = s_trx_detail.depreciate;
                        nuevo_detail.allow_credit       = s_trx_detail.allow_credit;
                        _context.TRANSACTIONS_DETAILS.AddObject(nuevo_detail);
                    }
                    //copio detalle de parametros de transaccion
                    var source_trx_params = DetallesParametros.ByHead(s_trx_head.id);
                    foreach (SV_TRANSACTION_PARAMETER_DETAIL s_trx_param in source_trx_params)
                    {
                        TRANSACTION_PARAMETER_DETAIL nuevo_param = new TRANSACTION_PARAMETER_DETAIL();
                        nuevo_param.TRANSACTION_HEADER = nueva_head; //con este relacionamos a la nueva cabecera
                        nuevo_param.system_id          = s_trx_param.system_id;
                        nuevo_param.paratemer_id       = s_trx_param.paratemer_id;
                        nuevo_param.parameter_value    = s_trx_param.parameter_value;
                        _context.TRANSACTIONS_PARAMETERS_DETAILS.AddObject(nuevo_param);
                    }
                }
                _context.SaveChanges();
                _load_parts();
                _load_transactions_headers();
                _load_transactions_details();
                _load_transactions_param_details();
                res.result_objs.Add((SV_PART)nueva_parte);

                res.set_ok();
            }
            catch (Exception ex)
            {
                res.set(-1, ex.StackTrace);
            }
            return(res);
        }