Example #1
0
        //Evento del botón "Crear"
        private void IbtnCreate_Click(object sender, EventArgs e)
        {
            if (ValidateFields())
            {
                Order order = new Order();
                order.Order_number         = txtNumber.Text;
                order.Order_reception_date = DateTime.Parse(dtpDateReception.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                order.Order_type           = cboType.Text;
                order.Order_invoice        = txtInvoice.Text;
                if (txtInvoice.Enabled)
                {
                    order.Order_sale_date = dtpSaleDate.Value;
                }
                //order.Order_comentarys = ""; -> Por definir funcionalidad
                order.Order_report_client = txtReportClient.Text;
                //Técnico
                Technician t = technicianLog.Read_once(txtTechnicianId.Text);
                order.Technician = t;
                //Cliente
                Client c = clientLog.Read_once(txtClientId.Text);
                order.Client = c;
                //Cotización
                //Creamos cotización
                Cotization cotization = new Cotization
                {
                    Cotization_id = "CT-" + PrOrder[cboType.SelectedIndex] + "" + orderLog.Read_count().ToString()
                };
                cotizationLog.Create(cotization);
                //Consultamos la cotización
                Cotization cn = cotizationLog.Read_once(cotization.Cotization_id);
                //MessageBox.Show("Cotizacion: " + cn.Cotization_id);
                order.Cotization = cn;
                //Capturamos el usuario que creará la orden
                order.Create_by = UserCache.UserAccount;                                          //Enviar desde el DAO
                //Capturamos el momento de la creacion
                order.Create_date = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //Desde el DAO mejor
                //Creación de orden
                orderLog.Create(order);
                //Creamos el order_article para que asigne el artículo sobre el cual se va a operar
                //En una orden van n articulos, estos se definen en la tabla
                //for (int i = 0; i < dtoa.Rows.Count; i++)
                //{
                Order_articleFK order_articleFK = new Order_articleFK
                {
                    Order_number   = order.Order_number,
                    Article_code   = txtArticleCod.Text,
                    Model          = txtArticleModel.Text,
                    Especification = txtArticleEsp.Text,
                    Serial         = txtArticleSerial.Text
                };
                orderArticleLog.Create(order_articleFK);
                //}

                //Enviamos al caché la variable numero de orden
                Order.Order_number_st = order.Order_number;
                ViewReportOrderCreate();
                ResetControls(sender, e);
            }
        }
Example #2
0
        public static void Create(Tile region, int taxChange)
        {
            var order = OrderLog.Create <TaxOrder>();

            order.region    = region;
            order.taxChange = taxChange;
            order.SetOrdered();
            Game.ActionPoints.ConsumePoints(order.cost);
            taxOrders.Add(region, order);
        }
Example #3
0
        static public DeploymentOrder Create(Tile[] path, bool moveSynchronized)
        {
            var pathByRegionNames = GetPathAsRegionNames(path);
            var order             = OrderLog.Create <DeploymentOrder>();

            order.data.moveSynchronized  = moveSynchronized;
            order.data.pathByRegionNames = pathByRegionNames;
            order.data.participantId     = Game.activeUserID;
            Game.ActionPoints.ConsumePoints(order.cost);
            deploymentOrders.Add(order);
            return(order);
        }