public nodeDto GetNodeByNodeId(ref OperationResult pobjOperationResult, int pintNodeId) { try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); nodeDto objDtoEntity = null; var objEntity = (from a in dbContext.node where a.i_NodeId == pintNodeId select a).FirstOrDefault(); if (objEntity != null) { objDtoEntity = nodeAssembler.ToDTO(objEntity); } pobjOperationResult.Success = 1; return(objDtoEntity); } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex); return(null); } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); if (Mode == "New") { } else if (Mode == "Edit") { if (Session["node"] != null) { // Get the entity from the session nodeDto objEntity = (nodeDto)Session["node"]; // Populate the entity objEntity.i_NodeId = NodeId; objEntity.v_PharmacyWarehouseId = ddlOrganization.SelectedValue.ToString(); // Save the data _objNodeBL.UpdatePharmacyWarehouseByNode(ref objOperationResult, objEntity, ((ClientSession)Session["objClientSession"]).GetAsList()); } } //Analizar el resultado de la operación if (objOperationResult.Success == 1) // Operación sin error { // Cerrar página actual y hacer postback en el padre para actualizar PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else // Operación con error { Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult.ExceptionMessage); // Se queda en el formulario. } }
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 txtCriterio_TextChanged(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); int nodeId = 0; if (Globals.ClientSession != null) { nodeId = Globals.ClientSession.i_CurrentExecutionNodeId; } nodeDto node = _nodeBL.GetNodeByNodeId(ref objOperationResult, nodeId); _pharmacyWarehouseId = node.v_PharmacyWarehouseId; if (node != null) { _keyValueDTO = BLL.Utils.GetProductWarehouse(ref objOperationResult, "Value2==" + "\"" + _pharmacyWarehouseId + "\"" + "&&" + "Value1.Contains(\"" + txtProductSearch.Text.Trim() + "\")"); Utils.LoadDropDownList(cbMedicamento, "Value1", "Id", _keyValueDTO, DropDownListAction.Select); } }
private void LoadData() { if (Mode == "New") { // Additional logic here. } else if (Mode == "Edit") { OperationResult objCommonOperationResultedit = new OperationResult(); nodeDto objNodeDTO = _objNodeBL.GetNodeByNodeId(ref objCommonOperationResultedit, NodeId); Session["sobjNodeDTO"] = objNodeDTO; // Informacion del nodo txtDescription.Text = objNodeDTO.v_Description; txtGeografyLocationId.Text = objNodeDTO.v_GeografyLocationId; txtGeografyLocationDescription.Text = objNodeDTO.v_GeografyLocationDescription; ddlNodeType.SelectedValue = objNodeDTO.i_NodeTypeId.ToString(); dpBeginDate.SelectedDate = objNodeDTO.d_BeginDate; dpEndDate.SelectedDate = objNodeDTO.d_EndDate; } }
public nodeDto GetNodeByNodeIdReport(int pintNodeId) { try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); nodeDto objDtoEntity = null; var objEntity = (from a in dbContext.node where a.i_NodeId == pintNodeId select a).FirstOrDefault(); if (objEntity != null) { objDtoEntity = nodeAssembler.ToDTO(objEntity); } return(objDtoEntity); } catch (Exception ex) { return(null); } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Mode == "New") { #region Validate // Validar nodo if (!IsValidNodeName(txtDescription.Text.Trim().ToUpper())) { return; } #endregion // Datos de nodo nodeDto objNodeDTO = new nodeDto(); objNodeDTO.v_Description = txtDescription.Text.Trim().ToUpper(); objNodeDTO.v_GeografyLocationId = txtGeografyLocationId.Text.Trim().ToUpper(); objNodeDTO.v_GeografyLocationDescription = txtGeografyLocationDescription.Text.Trim().ToUpper(); objNodeDTO.i_NodeTypeId = Convert.ToInt32(ddlNodeType.SelectedValue); objNodeDTO.d_BeginDate = dpBeginDate.SelectedDate.Value; objNodeDTO.d_EndDate = dpEndDate.SelectedDate == null ? (DateTime?)null : dpEndDate.SelectedDate.Value; OperationResult objOperationResult1 = new OperationResult(); // Graba Nodo _objNodeBL.AddNode(ref objOperationResult1, objNodeDTO, ((ClientSession)Session["objClientSession"]).GetAsList()); if (objOperationResult1.Success != 1) { Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult1.ExceptionMessage); } } else if (Mode == "Edit") { nodeDto objNodeDTO = Session["sobjNodeDTO"] as nodeDto; #region Validate Node // Almacenar temporalmente el nombre de nodo var _nodeNameTemp = objNodeDTO.v_Description; if (txtDescription.Text != _nodeNameTemp) { // Validar nodo if (!IsValidNodeName(txtDescription.Text.Trim().ToUpper())) { return; } } #endregion // Datos de Nodo objNodeDTO.v_Description = txtDescription.Text.Trim().ToUpper(); objNodeDTO.v_GeografyLocationId = txtGeografyLocationId.Text.Trim().ToUpper(); objNodeDTO.v_GeografyLocationDescription = txtGeografyLocationDescription.Text.Trim().ToUpper(); objNodeDTO.i_NodeTypeId = Convert.ToInt32(ddlNodeType.SelectedValue); objNodeDTO.d_BeginDate = dpBeginDate.SelectedDate.Value; objNodeDTO.d_EndDate = dpEndDate.SelectedDate == null ? (DateTime?)null : dpEndDate.SelectedDate.Value; // Actualiza Nodo OperationResult objOperationResult1 = new OperationResult(); _objNodeBL.UpdateNode(ref objOperationResult1, objNodeDTO, ((ClientSession)Session["objClientSession"]).GetAsList()); if (objOperationResult1.Success != 1) { Alert.ShowInTop("Error en operación:" + System.Environment.NewLine + objOperationResult1.ExceptionMessage); } } // Cerrar página actual y hacer postback en el padre para actualizar PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); }
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(); } }