Exemplo n.º 1
0
        private void LoadData()
        {
            OperationResult objOperationResult = new OperationResult();

            //Llenado de combos

            //Organization
            Utils.LoadDropDownList(ddlSectorTypeId, "Value1", "Id", BLL.Utils.GetDataHierarchyForCombo(ref objOperationResult, 104, null), DropDownListAction.Select);

            if (_Mode == "New")
            {
                // Additional logic here.
            }
            else if (_Mode == "Edit")
            {
                // Get the Entity Data

                _supplierDto = _objBL.GetSupplier(ref objOperationResult, _SupplierId);

                ddlSectorTypeId.SelectedValue = _supplierDto.i_SectorTypeId.ToString();
                txtName.Text = _supplierDto.v_Name;
                txtIdentificationNumber.Text = _supplierDto.v_IdentificationNumber;
                txtAddress.Text     = _supplierDto.v_Address;
                txtPhoneNumber.Text = _supplierDto.v_PhoneNumber;
                txtEmail.Text       = _supplierDto.v_Mail;

                _Temp_IdentificationNumber = _supplierDto.v_IdentificationNumber;
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult GetAll()
        {
            GetSupplierResponse response = new GetSupplierResponse();

            try
            {
                List <Supplier> suppliers = supplierBL.GetSupplier();
                response.Suppliers = suppliers;
                response.Success   = true;
            }
            catch (SupplierException ex)
            {
                response.ErrorCode    = ex.Error;
                response.ErrorMessage = "Error. " + ex.Error.ToString();
                response.Success      = false;
            }
            catch (Exception ex)
            {
                response.ErrorMessage = "Error. " + ex.Message;
                response.Success      = false;
            }
            return(Ok(response));
        }
        // GET: api/Unit/5
        public ServerResponse Get(string id)
        {
            var res = new ServerResponse();

            using (SupplierBL SupplierBL = new SupplierBL())
            {
                try
                {
                    res.Data = SupplierBL.GetSupplier(id);
                }
                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
Exemplo n.º 4
0
        private void btnSupplierSearch_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            frmSupplier     frm = new frmSupplier("View");

            frm.ShowDialog();
            _SupplierId = frm._SupplierId;
            if (_SupplierId == null)
            {
                return;
            }

            SupplierBL  objSupplierBL  = new SupplierBL();
            supplierDto objSupplierDto = new supplierDto();

            objSupplierDto   = objSupplierBL.GetSupplier(ref objOperationResult, _SupplierId);
            txtSupplier.Text = objSupplierDto.v_Name;
        }
Exemplo n.º 5
0
        private void LoadData()
        {
            OperationResult objOperationResult = new OperationResult();

            var objData1 = BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 110, "");  // Motivos de Ingreso
            // Remover el elemento TRANSFERENCIA ENTRE ALMACENES
            var objData1List = objData1.ToList();

            objData1List.RemoveAll(item => Int32.Parse(item.Id) > 9);
            //// Llenar el combo de Motivos
            Utils.LoadDropDownList(ddlMotiveId, "Value1", "Id", objData1List, DropDownListAction.Select);

            //if (txtProductSearch.Text.Trim() == "")
            //{
            //    txtProductSearch.Text = "asdfdasfd123432";
            //}
            Utils.LoadDropDownList(ddlProductId, "Value1", "Id", BLL.Utils.GetProduct(ref objOperationResult, "Value1.Contains(\"" + txtProductSearch.Text.Trim() + "\")"), DropDownListAction.Select);
            txtProductSearch.Text = "";

            if (_Mode == "New")
            {
                txtIsProcessed.Text  = "NO";
                txtSupplier.Text     = "";
                txtDocReference.Text = "";
                dtpDate.Value        = DateTime.Now.Date;
                _booAlreadySaved     = false;
            }
            else if (_Mode == "Edit")
            {
                // Get the Entity Data

                movementDto objMovementDto = new movementDto();
                MovementBL  objMovementBL  = new MovementBL();

                movementdetailDto objmovementdetailDto = new movementdetailDto();

                supplierDto objSupplierDto = new supplierDto();
                SupplierBL  objSupplierBL  = new SupplierBL();

                string pstrFilterExpression = null;

                objMovementDto = objMovementBL.GetMovement(ref objOperationResult, _MovementId);

                ddlMotiveId.SelectedValue = objMovementDto.i_MotiveTypeId.ToString();
                _SupplierId = objMovementDto.v_SupplierId;

                if (_SupplierId != null)
                {
                    objSupplierDto   = objSupplierBL.GetSupplier(ref objOperationResult, _SupplierId);
                    txtSupplier.Text = objSupplierDto.v_Name;
                }

                txtDocReference.Text = objMovementDto.v_ReferenceDocument;
                dtpDate.Value        = (DateTime)objMovementDto.d_Date;
                if (objMovementDto.i_IsLocallyProcessed == (int)Common.SiNo.NO)
                {
                    txtIsProcessed.Text       = "NO";
                    btnSaveRefresh.Enabled    = true;
                    btnConfirmProcess.Enabled = true;
                    btnDiscardProcess.Enabled = true;
                }
                else
                {
                    txtIsProcessed.Text       = "SI";
                    btnSaveRefresh.Enabled    = false;
                    btnConfirmProcess.Enabled = false;
                    btnDiscardProcess.Enabled = false;
                    groupBox1.Enabled         = false;
                    groupBox2.Enabled         = false;
                }

                pstrFilterExpression    = "v_MovementId==" + "\"" + objMovementDto.v_MovementId + "\"" + "&&" + "v_WarehouseId==" + "\"" + objMovementDto.v_WarehouseId + "\"";
                _TempMovementDetailList = objMovementBL.GetMovementDeatilPagedAndFiltered(ref objOperationResult, 0, null, "", pstrFilterExpression);
                lblRecordCount.Text     = string.Format("Se encontraron {0} registros.", _TempMovementDetailList.Count());

                grdData.DataSource = _TempMovementDetailList;
                _booAlreadySaved   = true;
            }
        }