private List <ServiceOrderList> GetData(int pintPageIndex, int?pintPageSize, string pstrSortExpression, string pstrFilterExpression)
        {
            OperationResult objOperationResult = new OperationResult();
            DateTime?       pdatBeginDate      = dtpDateTimeStar.Value.Date;
            DateTime?       pdatEndDate        = dptDateTimeEnd.Value.Date.AddDays(1);

            var _objData = _objServicOrderBL.GetServiceOrderPagedAndFiltered(ref objOperationResult, pintPageIndex, pintPageSize, pstrSortExpression, pstrFilterExpression, pdatBeginDate, pdatEndDate);

            if (objOperationResult.Success != 1)
            {
                MessageBox.Show("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(_objData);
        }
Exemple #2
0
        private void frmServiceOrderEdit_Load(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            List <ProtocolComponentList> oProtocolComponentList = new List <BE.ProtocolComponentList>();
            ProtocolBL   oProtocolBL = new ProtocolBL();
            ProtocolList objProtocol = new ProtocolList();
            float        CostoTotal  = 0;


            Utils.LoadDropDownList(ddlStatusOrderServiceId, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 194, null), DropDownListAction.Select);
            Utils.LoadDropDownList(cbLineaCredito, "Value1", "Id", BLL.Utils.GetDataHierarchyForCombo(ref objOperationResult, 122, null), DropDownListAction.Select);

            if (_Mode == "New")
            {
                txtNroTrabajadores.Select();
                int Year      = DateTime.Now.Year;
                int Month     = DateTime.Now.Month;
                int intNodeId = int.Parse(Globals.ClientSession.GetAsList()[0]);
                txtNroDocument.Text = GenerarCorrelativo(Year, Month, Sigesoft.Node.WinClient.BLL.Utils.GetNextSecuentialNoSave(intNodeId, 101)) + "-" + intNodeId;
                txtDateTime.Text    = DateTime.Now.Date.ToString();

                ddlStatusOrderServiceId.SelectedValue = ((int)Common.ServiceOrderStatus.Iniciado).ToString();
                if (_ProtocolId != "")
                {
                    oProtocolComponentList = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId);


                    var x = oProtocolComponentList.FindAll(P => P.r_Price != 0); // eliminamos los componentes con precio 0
                    foreach (var item in x)
                    {
                        CostoTotal += (float)item.r_Price;
                    }

                    //grdData.DataSource = x;
                    txtTotal.Text = CostoTotal.ToString();
                    //txtTotalTrabajadores.Text =

                    objProtocol = oProtocolBL.GetProtocolById(ref objOperationResult, _ProtocolId);

                    txtProtocolName.Text = objProtocol.v_Protocol;
                    txtOrganitation.Text = objProtocol.v_Organization;
                    txtContact.Text      = objProtocol.v_ContacName;
                    txtAdress.Text       = objProtocol.v_Address;
                    txttypeProtocol.Text = objProtocol.v_EsoType;
                }

                this.Height             = 517;
                groupBox1.Height        = 47;
                this.groupBox2.Location = new System.Drawing.Point(13, 98);
            }
            else
            {
                _oserviceorderDto = _oServiceOrderBL.GetServiceOrder(ref objOperationResult, _ServiceOrderId);

                //txtNroTrabajadores.Text = _oserviceorderDto.i_NumberOfWorker.ToString();
                txtNroDocument.Text = _oserviceorderDto.v_CustomServiceOrderId;
                txtComentary.Text   = _oserviceorderDto.v_Comentary;
                //txtCostoTotal.Text = _oserviceorderDto.r_TotalCost.ToString();
                txtDateTime.Text          = _oserviceorderDto.d_InsertDate.Value.Date.ToString();
                txtTotal.Text             = _oserviceorderDto.r_TotalCost.ToString();
                txtTotalTrabajadores.Text = _oserviceorderDto.i_NumberOfWorker.ToString();
                if (_oserviceorderDto.d_DeliveryDate == null)
                {
                    dtpDelirevy.Checked = false;
                }
                else
                {
                    dtpDelirevy.Checked = true;
                    dtpDelirevy.Value   = (DateTime)_oserviceorderDto.d_DeliveryDate;
                }

                if (_oserviceorderDto.i_MostrarPrecio == 1 || _oserviceorderDto.i_MostrarPrecio == null)
                {
                    rbSi.Checked = true;
                    rbNo.Checked = false;
                }
                else
                {
                    rbNo.Checked = true;
                    rbSi.Checked = false;
                }

                if (_oserviceorderDto.i_EsProtocoloEspecial == 1)
                {
                    chkProtocoloEspecial.Checked = true;
                }
                else
                {
                    chkProtocoloEspecial.Checked = false;
                }

                ddlStatusOrderServiceId.SelectedValue = _oserviceorderDto.i_ServiceOrderStatusId.ToString();
                cbLineaCredito.SelectedValue          = _oserviceorderDto.i_LineaCreditoId.ToString();

                // oProtocolComponentList = oProtocolBL.GetProtocolComponents(ref objOperationResult, _ProtocolId);

                //var x = oProtocolComponentList.FindAll(P => P.r_Price != 0); // eliminamos los componentes con precio 0
                //foreach (var item in x)
                // {
                //     CostoTotal += (float)item.r_Price;
                // }

                //grdData.DataSource = x;


                //objProtocol = oProtocolBL.GetProtocolById(ref objOperationResult, _ProtocolId);

                //txtProtocolName.Text = objProtocol.v_Protocol;
                //txtOrganitation.Text = objProtocol.v_Organization;
                //txtContact.Text = objProtocol.v_ContacName;
                //txtAdress.Text = objProtocol.v_Address;
                //txttypeProtocol.Text = objProtocol.v_EsoType;
                //txtTotal.Text =


                _TempServiceOrderDetail = _oServiceOrderBL.GetServiceOrderPagedAndFiltered(ref objOperationResult, 0, null, "", "v_ServiceOrderId==" + "\"" + _oserviceorderDto.v_ServiceOrderId + "\"");


                grdData1.DataSource = _TempServiceOrderDetail;

                _ProtocolId = _TempServiceOrderDetail[0].v_ProtocolId;
            }
        }