private void frmLogin_Load(object sender, EventArgs e) { // Obtener el ID del nodo del archivo de configuración _intNodeId = int.Parse(Common.Utils.GetApplicationConfigValue("NodeId")); // Leer el nodo NodeBL objNodeBL = new NodeBL(); OperationResult objOperationResult = new OperationResult(); nodeDto objNodeDto = objNodeBL.GetNodeByNodeId(ref objOperationResult, _intNodeId); if (objOperationResult.Success == 1) { // Mostrar el nombre del nodo txtNode.Text = objNodeDto.v_Description; } else { MessageBox.Show(objOperationResult.ExceptionMessage, "Error al conectarse a Base de Datos !!", MessageBoxButtons.OK, MessageBoxIcon.Error); btnOK.Enabled = false; txtUserName.Enabled = false; txtPassword.Enabled = false; this.Close(); } }
private void frmLogin_Load(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); ////---------------------------------------------------------------------------------------------------------------- //bool Validador = false; //string[] Serial = new string[] //{ // "E63B2796", // "2443F7CC" //}; // string MAC1 = SerieDD(); //foreach (var item in Serial) //{ // if (item == MAC1) // { // Validador = true; // } //} //if (Validador != true) //{ // MessageBox.Show(objOperationResult.ExceptionMessage, "Error al conectarse a Base de Datos !!", MessageBoxButtons.OK, MessageBoxIcon.Error); // this.Close(); //} ////---------------------------------------------------------------------------------------------------------------- // Obtener el ID del nodo del archivo de configuración _intNodeId = int.Parse(Common.Utils.GetApplicationConfigValue("NodeId")); string MAC = Common.Utils.GetApplicationConfigValue("ClientSettingsProviderx"); // Leer el nodo NodeBL objNodeBL = new NodeBL(); nodeDto objNodeDto = objNodeBL.GetNodeByNodeId(ref objOperationResult, _intNodeId); if (objOperationResult.Success == 1) { // Mostrar el nombre del nodo txtNode.Text = objNodeDto.v_Description; } else { MessageBox.Show(objOperationResult.ExceptionMessage, "Error al conectarse a Base de Datos !!", MessageBoxButtons.OK, MessageBoxIcon.Error); btnOK.Enabled = false; txtUserName.Enabled = false; txtPassword.Enabled = false; this.Close(); } }
private void frmAddMedicationMedicalConsult_Load(object sender, EventArgs e) { LoadComboBox(); MedicamentSearch(); OperationResult objOperationResult = new OperationResult(); var nodeId = Globals.ClientSession.i_CurrentExecutionNodeId; nodeDto node = new NodeBL().GetNodeByNodeId(ref objOperationResult, nodeId); _pharmacyWarehouseId = string.Empty; if (node != null) { _pharmacyWarehouseId = node.v_PharmacyWarehouseId; } if (_mode == "New") { txtProductSearch.Select(); } else if (_mode == "Edit") { btnAddAndNew.Enabled = false; var medication = _tmpMedicationList.Find(p => p.v_ProductId == _id); _productId = medication.v_ProductId; _serviceId = medication.v_ServiceId; _productName = medication.v_ProductName; lblPresentacion.Text = medication.v_PresentationName; txtCantidad.Text = medication.r_Quantity.ToString(); txtDosis.Text = medication.v_Doses; cbVia.SelectedValue = medication.i_ViaId.ToString(); cbVia.Text = medication.v_ViaName; } }
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; } }
private void frmLogin_Load(object sender, EventArgs e) { #region Actualización //string rutaserver = Common.Utils.GetApplicationConfigValue("RutaServer_Act").ToString(); //string rutapc = Common.Utils.GetApplicationConfigValue("RutaPC_Act").ToString(); //string rutaejecutable = Common.Utils.GetApplicationConfigValue("RutaAct_exe").ToString(); //if (File.Exists(rutaserver) && File.Exists(rutapc) && File.Exists(rutaejecutable)) //{ // DateTime fechatxt = File.GetLastWriteTime(rutaserver); // DateTime fechatxt2 = File.GetLastWriteTime(rutapc); // if (fechatxt != fechatxt2) // { // System.Diagnostics.Process.Start(rutaejecutable); // this.Close(); // } // else // { // //MessageBox.Show("NO HAY ACTUALICACIONES PENDIENTES...", "ACTUALIZACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Information); // } //} #endregion OperationResult objOperationResult = new OperationResult(); ////---------------------------------------------------------------------------------------------------------------- //bool Validador = false; //string[] Serial = new string[] //{ // "E63B2796", // "2443F7CC" //}; // string MAC1 = SerieDD(); //foreach (var item in Serial) //{ // if (item == MAC1) // { // Validador = true; // } //} //if (Validador != true) //{ // MessageBox.Show(objOperationResult.ExceptionMessage, "Error al conectarse a Base de Datos !!", MessageBoxButtons.OK, MessageBoxIcon.Error); // this.Close(); //} ////---------------------------------------------------------------------------------------------------------------- // Obtener el ID del nodo del archivo de configuración _intNodeId = int.Parse(Common.Utils.GetApplicationConfigValue("NodeId")); string MAC = Common.Utils.GetApplicationConfigValue("ClientSettingsProviderx"); // Leer el nodo NodeBL objNodeBL = new NodeBL(); nodeDto objNodeDto = objNodeBL.GetNodeByNodeId(ref objOperationResult, _intNodeId); if (objOperationResult.Success == 1) { // Mostrar el nombre del nodo txtNode.Text = objNodeDto.v_Description; } else { MessageBox.Show(objOperationResult.ExceptionMessage, "Error al conectarse a Base de Datos !!", MessageBoxButtons.OK, MessageBoxIcon.Error); btnOK.Enabled = false; txtUserName.Enabled = false; txtPassword.Enabled = false; this.Close(); } }