示例#1
0
        public nodeorganizationlocationwarehouseprofileDto GetNodeOrganizationLocationWarehouseProfile(ref OperationResult pobjOperationResult, string pstrWarehouseId)
        {
            //mon.IsActive = true;
            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                nodeorganizationlocationwarehouseprofileDto objDtoEntity = null;

                var objEntity = (from a in dbContext.nodeorganizationlocationwarehouseprofile
                                 where a.v_WarehouseId == pstrWarehouseId && a.i_IsDeleted == 0
                                 select a).FirstOrDefault();

                if (objEntity != null)
                {
                    objDtoEntity = nodeorganizationlocationwarehouseprofileAssembler.ToDTO(objEntity);
                }

                pobjOperationResult.Success = 1;
                return(objDtoEntity);
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                return(null);
            }
        }
示例#2
0
        private List <nodeorganizationlocationwarehouseprofileDto> InsertWarehouse()
        {
            List <nodeorganizationlocationwarehouseprofileDto> objwarehouseListAdd = new List <nodeorganizationlocationwarehouseprofileDto>();

            // Datos de Almacén
            foreach (var item in tvWarehouse.Nodes)
            {
                if (item.Checked == true)
                {
                    // Datos de Almacen
                    nodeorganizationlocationwarehouseprofileDto objWarehouse = new nodeorganizationlocationwarehouseprofileDto();
                    objWarehouse.i_NodeId         = NodeId;
                    objWarehouse.v_OrganizationId = ddlOrganization.SelectedValue;
                    objWarehouse.v_LocationId     = ddlLocation.SelectedValue;
                    objWarehouse.v_WarehouseId    = item.NodeID;

                    objwarehouseListAdd.Add(objWarehouse);
                }
            }

            return(objwarehouseListAdd.Count == 0 ? null : objwarehouseListAdd);
        }
        private List <nodeorganizationlocationwarehouseprofileDto> InsertWarehouse(string pstrLocationId)
        {
            OperationResult objOperationResult = new OperationResult();
            List <nodeorganizationlocationwarehouseprofileDto> objwarehouseListAdd = new List <nodeorganizationlocationwarehouseprofileDto>();

            string pstrFilterExpression = "v_LocationId ==" + "\"" + pstrLocationId + "\"";
            var    _objData             = oOrganizationBL.GetWarehousePagedAndFiltered(ref objOperationResult, 0, null, "", pstrFilterExpression);

            // Datos de Almacén
            foreach (var item in _objData)
            {
                // Datos de Almacen
                nodeorganizationlocationwarehouseprofileDto objWarehouse = new nodeorganizationlocationwarehouseprofileDto();
                objWarehouse.i_NodeId         = 9;
                objWarehouse.v_OrganizationId = item.v_OrganizationId;
                objWarehouse.v_LocationId     = item.v_LocationId;
                objWarehouse.v_WarehouseId    = item.v_WarehouseId;

                objwarehouseListAdd.Add(objWarehouse);
            }

            return(objwarehouseListAdd.Count == 0 ? null : objwarehouseListAdd);
        }
示例#4
0
        private List <nodeorganizationlocationwarehouseprofileDto> DeleteWarehouse()
        {
            List <nodeorganizationlocationwarehouseprofileDto> objwarehouseListDelete = new List <nodeorganizationlocationwarehouseprofileDto>();

            foreach (var item in tvWarehouse.Nodes)
            {
                if (!item.Checked)
                {
                    if (item.CommandName == "1")
                    {
                        // Datos de Almacen
                        nodeorganizationlocationwarehouseprofileDto objWarehouse = new nodeorganizationlocationwarehouseprofileDto();
                        objWarehouse.i_NodeId         = NodeId;
                        objWarehouse.v_OrganizationId = ddlOrganization.SelectedValue;
                        objWarehouse.v_LocationId     = ddlLocation.SelectedValue;
                        objWarehouse.v_WarehouseId    = item.NodeID;

                        objwarehouseListDelete.Add(objWarehouse);
                    }
                }
            }

            return(objwarehouseListDelete.Count == 0 ? null : objwarehouseListDelete);
        }
        private void LoadData()
        {
            OperationResult objOperationResult = new OperationResult();

            Utils.LoadDropDownList(ddlProductId, "Value1", "Id", BLL.Utils.GetProductWarehouse(ref objOperationResult, "Id==" + "\"" + -1 + "\""), DropDownListAction.Select); // el combo producto se carga vacio hasta que se seleccione un almacén de origen.
            lblNodeSource.Text   = Globals.ClientSession.v_CurrentExecutionNodeName;
            dtpDate.CustomFormat = "dd/MM/yyyy";
            if (_Mode == "New")
            {
                _booAlreadySaved = false;
                //Source
                Utils.LoadDropDownList(ddlOrganizationLocationSourceId, "Value1", "Id", BLL.Utils.GetJoinOrganizationAndLocationNotInRestricted(ref objOperationResult, Globals.ClientSession.i_CurrentExecutionNodeId), DropDownListAction.Select);
                Utils.LoadDropDownList(ddlWarehouseSourceId, "Value1", "Id", BLL.Utils.GetWarehouseNotInRestricted(ref objOperationResult, Globals.ClientSession.i_CurrentExecutionNodeId, "-1", "-1"), DropDownListAction.Select);

                //Destination
                Utils.LoadDropDownList(ddlNodeDestinationId, "Value1", "Id", BLL.Utils.GetAllNodeForCombo(ref objOperationResult), DropDownListAction.Select);
                if (rbLocal.Checked == true)
                {
                    ddlNodeDestinationId.Enabled       = false;
                    ddlNodeDestinationId.SelectedValue = Globals.ClientSession.i_CurrentExecutionNodeId.ToString();
                }
                else
                {
                    ddlNodeDestinationId.Enabled = true;
                }

                Utils.LoadDropDownList(ddlOrganizationLocationDestinationId, "Value1", "Id", BLL.Utils.GetJoinOrganizationAndLocationNotInRestricted(ref objOperationResult, Globals.ClientSession.i_CurrentExecutionNodeId), DropDownListAction.Select);
                Utils.LoadDropDownList(ddlWarehouseDestinationId, "Value1", "Id", BLL.Utils.GetWarehouseNotInRestricted(ref objOperationResult, Globals.ClientSession.i_CurrentExecutionNodeId, "-1", "-1"), DropDownListAction.Select);

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

                warehouseDto objwarehouseDto = new warehouseDto();
                WarehouseBL  objWarehouseBL  = new WarehouseBL();

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

                movementdetailDto objmovementdetailDto = new movementdetailDto();

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

                nodeorganizationlocationwarehouseprofileDto objnodeorganizationlocationwarehouseprofileDto = new nodeorganizationlocationwarehouseprofileDto();
                NodeBL objNodeBL = new NodeBL();
                _booAlreadySaved = true;
                string pstrFilterExpression = null;

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

                //Source
                Utils.LoadDropDownList(ddlOrganizationLocationSourceId, "Value1", "Id", BLL.Utils.GetJoinOrganizationAndLocationNotInRestricted(ref objOperationResult, Globals.ClientSession.i_CurrentExecutionNodeId), DropDownListAction.Select);
                objwarehouseDto = objWarehouseBL.GetWarehouse(ref objOperationResult, objMovementDto.v_WarehouseId);
                ddlOrganizationLocationSourceId.SelectedValue = Globals.ClientSession.i_CurrentExecutionNodeId + "|" + objwarehouseDto.v_OrganizationId + "|" + objwarehouseDto.v_LocationId;
                ddlWarehouseSourceId.SelectedValue            = objwarehouseDto.v_WarehouseId;

                //Destination
                Utils.LoadDropDownList(ddlNodeDestinationId, "Value1", "Id", BLL.Utils.GetAllNodeForCombo(ref objOperationResult), DropDownListAction.Select);

                objnodeorganizationlocationwarehouseprofileDto = objNodeBL.GetNodeOrganizationLocationWarehouseProfile(ref objOperationResult, objMovementDto.v_RemoteWarehouseId);

                if (Globals.ClientSession.i_CurrentExecutionNodeId.ToString() == objnodeorganizationlocationwarehouseprofileDto.i_NodeId.ToString())
                {
                    ddlNodeDestinationId.Enabled = false;
                    rbLocal.Checked = true;
                }
                else
                {
                    ddlNodeDestinationId.Enabled = true;
                    rbRemote.Checked             = true;
                }

                ddlNodeDestinationId.SelectedValue = objnodeorganizationlocationwarehouseprofileDto.i_NodeId.ToString();
                ddlOrganizationLocationDestinationId.SelectedValue = objnodeorganizationlocationwarehouseprofileDto.i_NodeId.ToString() + "|" + objnodeorganizationlocationwarehouseprofileDto.v_OrganizationId + "|" + objnodeorganizationlocationwarehouseprofileDto.v_LocationId;
                ddlWarehouseDestinationId.SelectedValue            = objMovementDto.v_RemoteWarehouseId;
                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;
                }

                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;
            }
        }