public static void CopyFile(FN del) { del(fileName[0]); if (File.Exists(copiedFileName)) File.Delete(copiedFileName); File.Copy(fileName[0], copiedFileName); }
public override void Dispose() { disposed = true; int err = DASP52032Connector.DASP52032_Release((byte)devnum); if (err != 0) { FN.fatal("DASP52032_real.Dispose: Ошибка: " + DASP52032Connector.GetError(err)); } }
public void Should_Serialize_LastComponent() { var field = new FN { SurnameFromPartnerSpouse = new ST { Value = "FN.SurnameFromPartnerSpouse" } }; Assert.AreEqual(Last, field.ToString()); }
public void Should_Serialize_FirstComponent() { var field = new FN { Surname = new ST { Value = "FN.Surname" }, }; Assert.AreEqual(First, field.ToString()); }
public DASP52032_real(BoardPars _pars, DOnPr _OnPr = null) : base(_pars, _OnPr) { int err; int DllVersion = 0; err = DASP52032Connector.DASP52032_GetDllVersion(ref DllVersion); pr("DASP52032_real.DASP52032_real: DllVersion=" + DllVersion.ToString()); err = DASP52032Connector.DASP52032_QuickInstalled((byte)devnum, 0); if (err != 0) { FN.fatal("DASP52032_real.DASP52032_real: Ошибка: " + DASP52032Connector.GetError(err)); } }
private void Update_Click(object sender, EventArgs e) { if (Fname.Text == "" || Lname.Text == "" || ID.Text == "" || (string)Type.SelectedItem == "" || Type.SelectedItem == null || OwnID.SelectedItem == null || (MgrID.SelectedItem == null && HasMGR.Checked == true)) { MessageBox.Show("Please enter all fields."); return; } string FN, LN; FN = Fname.Text; LN = Lname.Text; if (FN.Any(char.IsDigit)) { MessageBox.Show("No digits are allowed in first name field!"); return; } if (LN.Any(char.IsDigit)) { MessageBox.Show("No digits are allowed in last name field!"); return; } int x; if (!(Int32.TryParse(ID.Text, out x))) { MessageBox.Show("Please enter a number in the ID number field."); return; } int?MGR = null; if (HasMGR.Checked == true) { MGR = (int)MgrID.SelectedItem; } int r = contobj.UpdateEmployee(Convert.ToInt32(ID.Text), Fname.Text, Lname.Text, (int)SSN.Value, (float)OSSalary.Value, (float)Salary.Value, Hdate.Value, (string)Type.SelectedItem, (int?)MGR, (int)OwnID.SelectedItem, (int)ContID.SelectedItem); if (r > 0) { MessageBox.Show("The Employee is Updated successfully! :) "); } else { MessageBox.Show("Employee Not Updated, Check your input again. "); } dataGridView1.Refresh(); SH_ALL_Click(sender, e); return; }
public override byte[] ReadOut() { if (disposed) { return(null); } Int16 data = 0; int err = DASP52032Connector.DASP52032_ReadBackGpio((byte)devnum, ref data); if (err != 0) { FN.fatal("DASP52032_real.ReadOut: Ошибка: " + DASP52032Connector.GetError(err)); } values_out[0] = (byte)(data & 0xFF); values_out[1] = (byte)((data >> 8) & 0xFF); return(values_out); }
public override void Write(byte[] _values_out) { if (disposed) { return; } Int16 data = 0; data |= (Int16)(_values_out[0]); data |= (Int16)(_values_out[1] << 8); int err = DASP52032Connector.DASP52032_WriteGpio((byte)devnum, data); if (err != 0) { FN.fatal("DASP52032_real.Write: Ошибка: " + DASP52032Connector.GetError(err)); } }
public AddGroupSession(int expenseTypeID, PatientGrid individual, int staffID, DateTime expenseDueDate, DateTime startDateTime, DateTime endDateTime, int appointmentID) { ClientFirstName = individual.FirstName; ClientLastName = individual.LastName; ClientOQNumber = individual.PatientOQ; ExpenseTypeID = expenseTypeID; Individual = individual; StaffID = staffID; AppointmentID = appointmentID; ExpenseDueDate = expenseDueDate; StartDateTime = startDateTime; EndDateTime = endDateTime; InitializeComponent(); Grant.IsEnabled = false; ExpensePaidDate.IsEnabled = false; FN.Focus(); }
public void EnterPersonalDetails() { Title.Click(); FN.SendKeys(ConfigurationManager.AppSettings["Firstname"]); SN.SendKeys(ConfigurationManager.AppSettings["Surname"]); DOB.SendKeys(ConfigurationManager.AppSettings["DOB"]); TN.SendKeys(ConfigurationManager.AppSettings["Telephonenumber"]); Emp.Click(); ResiStatus.Click(); GrossAnnualIncome.SendKeys(ConfigurationManager.AppSettings["GAI"]); HouseNo.SendKeys(ConfigurationManager.AppSettings["House"]); PostCode.SendKeys(ConfigurationManager.AppSettings["PCode"]); MoveinYear.SendKeys(ConfigurationManager.AppSettings["Year"]); FindMyAddress.Click(); System.Threading.Thread.Sleep(1000); //SelectAddress.Click(); //System.Threading.Thread.Sleep(1000); Next.Click(); }
public override int ReadOut() { Select S = new Select(string.Format("select {0} from {1}.BoardSQL where DevNum={2}", OutputSide, schema, Devnum.ToString())); if (!S.Read()) { FN.fatal("BoardSQL.ReadOut: " + S.SQL + " - не нашли записей"); } string sval = S[0] as string; values_out = 0; int i = 0; foreach (char c in sval) { SetBit(ref values_out, i++, c == '1'); } S.Dispose(); return(values_out); }
public void Should_Serialize_AllComponents() { var field = new FN { Surname = new ST { Value = "FN.Surname" }, OwnSurnamePrefix = new ST { Value = "FN.OwnSurnamePrefix" }, OwnSurname = new ST { Value = "FN.OwnSurname" }, SurnamePrefixFromPartnerSpouse = new ST { Value = "FN.SurnamePrefixFromPartnerSpouse" }, SurnameFromPartnerSpouse = new ST { Value = "FN.SurnameFromPartnerSpouse" } }; Assert.AreEqual(All, field.ToString()); }
public ER Cancel(FN fncd) { switch (fncd) { case FN.TFN_TCP_ACP_CEP: break; case FN.TFN_TCP_CON_CEP: break; case FN.TFN_TCP_CLS_CEP: break; case FN.TFN_TCP_SND_DAT: break; case FN.TFN_TCP_RCV_DAT: break; case FN.TFN_TCP_GET_BUF: break; case FN.TFN_TCP_RCV_BUF: break; case FN.TFN_TCP_SND_OOB: break; case FN.TFN_TCP_ALL: break; default: return(ER.E_PAR); } return(ER.E_OK); }
/// <summary> /// 현재 고과상태의 위아래 한단계 콤보리스트를 생성한다. /// </summary> /// <param name="pComboBox"></param> /// <param name="pEnumWholeTp"></param> /// <param name="pYearMonth"></param> public static void SetComboValue_STATUS(ref SAPbouiCOM.ComboBox pComboBox, FN.Enum_WholeTp pEnumWholeTp, string pSTATUS) { SAPbobsCOM.Recordset oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset); StringBuilder sb = new StringBuilder(); string sQry = string.Empty; string Status = string.Empty; try { if (string.IsNullOrEmpty(pSTATUS)) { Status = "0"; } else { sb.Clear(); sb.AppendFormat(" SELECT U_SORT FROM [@KIS_AD00201] WHERE Code = 'HR10' AND U_SMLCD = '{0}' ", pSTATUS); oRS.DoQuery(sb.ToString()); Status = oRS.Fields.Item(0).Value.ToString(); } sb.Clear(); sb.AppendLine(" SELECT U_SMLCD, U_SMLNM FROM [@KIS_AD00201] WHERE CODE = 'HR10' AND U_USEYN = 'Y' "); sb.AppendFormat(" AND U_SORT BETWEEN '{0}'-1 AND '{0}'+1 ", Status); sQry = sb.ToString(); oRS.DoQuery(sQry); if (!oRS.EoF) { FN.SetComboClear(ref pComboBox); if (pEnumWholeTp == FN.Enum_WholeTp.m_Space) pComboBox.ValidValues.Add("", ""); for (int iLooper = 0; iLooper < oRS.RecordCount; iLooper++) { pComboBox.ValidValues.Add(oRS.Fields.Item(0).Value.ToString(), oRS.Fields.Item(1).Value.ToString()); oRS.MoveNext(); } if (!string.IsNullOrEmpty(pSTATUS)) pComboBox.Select(pSTATUS, SAPbouiCOM.BoSearchKey.psk_ByValue); } } catch (Exception) { throw; } finally { System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS); oRS = null; } }
/// <summary> /// SAP 시작할때 가져온 공통코드를 사용하여 콤보 바인딩 /// </summary> /// <param name="oForm"></param> /// <param name="itemUID"></param> /// <param name="eWholeTp"></param> /// <param name="strFilterExpr"></param> /// <param name="codeColName"></param> /// <param name="descColNmae"></param> public static void LComboBind(SAPbouiCOM.Form oForm, string itemUID, FN.Enum_WholeTp eWholeTp, string strFilterExpr = "", string codeColName = "U_SMLCD", string descColNmae = "U_SMLNM") { #region LComboBind try { string columnUID = string.Empty; string dbName = string.Empty; string fieldName = string.Empty; string[] aItemUID = itemUID.Split('.'); itemUID = aItemUID[0]; columnUID = (aItemUID.Length > 1 ? aItemUID[1] : ""); string itemType = oForm.Items.Item(itemUID).Type.ToString(); // commonCodeDataTable와 동일한 스키마를 가진 임시테이블 System.Data.DataTable Dt = commonCodeDataTable.Clone(); // 조건에 일치하는 행(DataRow)만 추출 //IEnumerable<DataRow> rows = from commonCode in commonCodeDataTable.AsEnumerable() DataRow[] dr = commonCodeDataTable.Select(strFilterExpr); foreach (DataRow row in dr) { DataRow tempRow = Dt.NewRow(); for (int i = 0; i < Dt.Columns.Count; i++) { tempRow.SetField(i, row[i]); } Dt.Rows.Add(tempRow); } switch (itemType) { case "it_COMBO_BOX": SAPbouiCOM.ComboBox oComboBox = (SAPbouiCOM.ComboBox)oForm.Items.Item(itemUID).Specific; SetComboBox(Dt, oComboBox, eWholeTp, strFilterExpr, codeColName, descColNmae); break; case "it_MATRIX": SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(itemUID).Specific; SAPbouiCOM.Column oMatrixColumn = oMatrix.Columns.Item(columnUID); SetComboBox(Dt, oMatrixColumn, eWholeTp, strFilterExpr, codeColName, descColNmae); break; case "it_GRID": SAPbouiCOM.Grid oGrid = (SAPbouiCOM.Grid)oForm.Items.Item(itemUID).Specific; SAPbouiCOM.EditTextColumn oGridColumn = (SAPbouiCOM.EditTextColumn)oGrid.Columns.Item(columnUID); oGridColumn.Type = SAPbouiCOM.BoGridColumnType.gct_ComboBox; SAPbouiCOM.ComboBoxColumn oComboColumn = (SAPbouiCOM.ComboBoxColumn)oGrid.Columns.Item(columnUID); oComboColumn.DisplayType = SAPbouiCOM.BoComboDisplayType.cdt_Description; SetComboBox(Dt, oComboColumn, eWholeTp, strFilterExpr, codeColName, descColNmae); break; default: break; } } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("LComboBind " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } #endregion }
/// <summary> /// OFPR 기준이며 입력년월 기준으로 6개월 전 6개월 이후의 콤보리스트를 생성한다. /// </summary> /// <param name="pComboBox"></param> /// <param name="pEnumWholeTp"></param> /// <param name="pYearMonth"></param> public static void SetComboValue_YearMonth(ref SAPbouiCOM.ComboBox pComboBox, FN.Enum_WholeTp pEnumWholeTp, string pYearMonth) { SAPbobsCOM.Recordset oRS = (SAPbobsCOM.Recordset)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.BoRecordset); StringBuilder sb = new StringBuilder(); string strDate = string.Empty; try { if (string.IsNullOrEmpty(pYearMonth)) { strDate = FN.SetDateFormatToDB(DateTimeLibrary.FirstDayOfCurrentMonth(), FN.eDateType.n_YYYYMMDD); } else strDate = pYearMonth + "01"; sb.AppendLine(" SELECT CONVERT(NVARCHAR(10), ROW_NUMBER () OVER (ORDER BY Code)) AS SEQ, CONVERT (NVARCHAR (6), F_RefDate, 112) AS Code, CONVERT (NVARCHAR (7), F_RefDate, 120) AS [Desc] "); sb.AppendLine(" FROM OFPR "); sb.AppendFormat(" WHERE F_RefDate BETWEEN DATEADD (MM, -6, CONVERT (DATE, '{0}')) AND DATEADD (MM, 6, CONVERT (DATE, '{0}')) ", strDate); oRS.DoQuery(sb.ToString()); if (!oRS.EoF) { FN.SetComboClear(ref pComboBox); if (pEnumWholeTp == FN.Enum_WholeTp.m_Space) pComboBox.ValidValues.Add("", ""); for (int iLooper = 0; iLooper < oRS.RecordCount; iLooper++) { pComboBox.ValidValues.Add(oRS.Fields.Item(1).Value.ToString(), oRS.Fields.Item(2).Value.ToString()); oRS.MoveNext(); } if (!string.IsNullOrEmpty(pYearMonth)) pComboBox.Select(pYearMonth, SAPbouiCOM.BoSearchKey.psk_ByValue); } } catch (Exception) { throw; } finally { System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS); oRS = null; } }
public void FirstN(string FirstName) { FN.SendKeys(FirstName); }
/// <summary> /// Grid ComboBox /// </summary> /// <param name="Dt"></param> /// <param name="oComboColumn"></param> /// <param name="eWholeTp"></param> /// <param name="strFilterExpr"></param> public static void SetComboBox(System.Data.DataTable Dt, SAPbouiCOM.ComboBoxColumn oComboColumn, FN.Enum_WholeTp eWholeTp, string strFilterExpr, string codeColName, string descColNmae) { #region Grid ComboBox try { while (true) { if (oComboColumn.ValidValues.Count > 0) { oComboColumn.ValidValues.Remove(0); } else { break; } } if (eWholeTp == FN.Enum_WholeTp.m_Space) oComboColumn.ValidValues.Add("", ""); else if (eWholeTp == FN.Enum_WholeTp.m_TotalTxt) oComboColumn.ValidValues.Add("", "전체"); string strTemp = ""; for (int i = 0; i < Dt.Rows.Count; i++) { strTemp = Dt.Rows[i][descColNmae].ToString(); strTemp = (strTemp.Length > 50 ? strTemp.Substring(0, 47) + "..." : strTemp);//자리수 처리 oComboColumn.ValidValues.Add(Dt.Rows[i][codeColName].ToString(), strTemp); } //if (strDefaultValue != null) //oComboBox.Select(strDefaultValue, SAPbouiCOM.BoSearchKey.psk_ByValue); } catch (Exception ex) { B1Connections.theAppl.StatusBar.SetText("SetComboBox " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } #endregion }
public ER tcp_can_cep(ID cepid, FN fncd) { ER Result = ER.E_NOEXS; TcpCep TcpCep; if (g_Kernel == null) return ER.E_DLT; g_Kernel.LockCPU(); try { TcpCep = g_Kernel.Nucleus.GetTcpCep(cepid); if (TcpCep == null) Result = ER.E_NOEXS; else Result = TcpCep.Cancel(fncd); } finally { g_Kernel.UnlockCPU(); } return Result; }
private async void BtnGuardarEmpleados_Clicked(object sender, EventArgs e) { string connectionString = ConfigurationManager.AppSettings["ipServer"]; try { var rolIDV = (PosicionesListView)pickerPosiciones.SelectedItem; var areaProduccionIDV = (SubDepartamentosListView)pickerSubDepartamentos.SelectedItem; var codigoEmpleadoV = codigoEmpleado.Text; var nombreV = nombre.Text; var apellidoV = apellido.Text; var sexoV = sexo.SelectedIndex; var direccionV = direccion.Text; var telefonoV = telefono.Text; var cedulaV = cedula.Text; var fnV = FN.Date; var fechaIngresoV = FechaIngreso.Date; if (string.IsNullOrEmpty(rolIDV.ToString())) { await DisplayAlert("Validacion", "Ingresar el puesto del empleado", "Aceptar"); pickerPosiciones.Focus(); return; } if (string.IsNullOrEmpty(areaProduccionIDV.ToString())) { await DisplayAlert("Validacion", "Ingresar el departamento del empleado", "Aceptar"); pickerSubDepartamentos.Focus(); return; } if (string.IsNullOrEmpty(codigoEmpleadoV)) { await DisplayAlert("Validacion", "Ingresar el codigo del empleado", "Aceptar"); codigoEmpleado.Focus(); return; } if (string.IsNullOrEmpty(nombreV)) { await DisplayAlert("Validacion", "Ingrese el nombre de Usuario", "Aceptar"); nombre.Focus(); return; } if (string.IsNullOrEmpty(apellidoV)) { await DisplayAlert("Validacion", "Ingresar el apellido del empleado", "Aceptar"); apellido.Focus(); return; } if (string.IsNullOrEmpty(direccionV)) { await DisplayAlert("Validacion", "Ingreser la direccion del empleado", "Aceptar"); direccion.Focus(); return; } if (string.IsNullOrEmpty(telefonoV)) { await DisplayAlert("Validacion", "Ingresar el numero telefonico del empleado", "Aceptar"); telefono.Focus(); return; } if (string.IsNullOrEmpty(cedulaV)) { await DisplayAlert("Validacion", "Ingreser la cedula del empleado", "Aceptar"); cedula.Focus(); return; } if (string.IsNullOrEmpty(fnV.ToString())) { await DisplayAlert("Validacion", "Ingresar la fecha de nacimiento del empleado", "Aceptar"); FN.Focus(); return; } if (string.IsNullOrEmpty(fechaIngresoV.ToString())) { await DisplayAlert("Validacion", "Ingresar la fecha de ingreso del empleado", "Aceptar"); FechaIngreso.Focus(); return; } HttpClient client = new HttpClient(); client.BaseAddress = new Uri(connectionString); var empleados = new Emple() { EmpleadoID = 0, PosicionID = rolIDV.PosicionID, SubDepartamentoID = areaProduccionIDV.SubDepartamentoID, CodigoEmpleado = codigoEmpleadoV, Nombres = nombreV, Apellidos = apellidoV, Sexo = (sexo.SelectedIndex == 0) ? false : true, Direccion = direccionV, Telefono = telefonoV, Fecha_Nacimiento = fnV, Cedula = cedulaV, Edad = DateTime.Now.Year - fnV.Value.Year, FechaIngreso = fechaIngresoV }; //Convetir a Json var json = JsonConvert.SerializeObject(empleados); StringContent stringContent = new StringContent(json, Encoding.UTF8, "application/json"); //Ejecutar el api el introduces el metodo var request = await client.PostAsync("/api/Empleados/registrar", stringContent); if (request.IsSuccessStatusCode) { var responseJson = await request.Content.ReadAsStringAsync(); var respuesta = JsonConvert.DeserializeObject <Request>(responseJson); //Status if (respuesta.status) { await MaterialDialog.Instance.AlertAsync(message : "Usuario registrado correctamente", title : "Registro", acknowledgementText : "Aceptar"); } else { await MaterialDialog.Instance.AlertAsync(message : "Usuario no pudo registrarse correctamente", title : "Registro", acknowledgementText : "Aceptar"); } } else { await MaterialDialog.Instance.AlertAsync(message : "Error", title : "Error", acknowledgementText : "Aceptar"); } } catch (Exception ex) { await MaterialDialog.Instance.AlertAsync(message : ex.Message, title : "Error", acknowledgementText : "Aceptar"); } }
private void button1_Click(object sender, EventArgs e) { if (val == 1) { //Citire date client String q, FN, LN, Gr = "01"; int CNP; FN = Convert.ToString(textBox1.Text); LN = Convert.ToString(textBox2.Text); CNP = Convert.ToInt32(textBox3.Text); if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false && radioButton4.Checked == false) { MessageBox.Show("Check blood type"); } else if (radioButton1.Checked == true) { Gr = Convert.ToString(radioButton1.Text); } else if (radioButton2.Checked == true) { Gr = Convert.ToString(radioButton2.Text); } else if (radioButton3.Checked == true) { Gr = Convert.ToString(radioButton3.Text); } else { Gr = Convert.ToString(radioButton4.Text); } //Verificare existenta client SqlConnection con = new SqlConnection(init); con.Open(); q = "Select CNP from Info_Client where CNP =" + CNP; SqlCommand cmd = new SqlCommand(q, con); SqlDataReader read = cmd.ExecuteReader(); if (read.Read()) { con.Close(); MessageBox.Show("Client already in DataBase"); } else { con.Close(); con.Open(); q = "insert into Info_Client(CNP, Nume, Prenume, Grupa_sanguina) values('" + CNP + "', '" + FN.ToUpper() + "', '" + LN.ToUpper() + "', '" + Gr + "')"; cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Done!"); } label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox1.Hide(); textBox2.Hide(); textBox3.Hide(); radioButton1.Hide(); radioButton2.Hide(); radioButton3.Hide(); radioButton4.Hide(); button1.Hide(); radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false; } if (val == 2) { String q, CNP; CNP = Convert.ToString(textBox1.Text); CNPMaster = Convert.ToString(textBox1.Text); SqlConnection con = new SqlConnection(init); con.Open(); q = "Select * from Info_Client where CNP =" + CNP; SqlCommand cmd = new SqlCommand(q, con); SqlDataReader read = cmd.ExecuteReader(); if (read.Read()) { label1.Text = "First name"; label2.Text = "Last name"; label3.Text = "CNP"; label4.Text = "Blood type"; button1.Text = "Execute"; textBox1.Text = read["Nume"].ToString(); textBox2.Text = read["Prenume"].ToString(); textBox3.Text = read["CNP"].ToString(); textBox3.ReadOnly = true; label2.Show(); label3.Show(); textBox2.Show(); textBox3.Show(); radioButton1.Show(); radioButton2.Show(); radioButton3.Show(); radioButton4.Show(); comboBox1.Show(); if (read["Grupa_sanguina"].ToString().Equals("01")) { radioButton1.Checked = true; } else if (read["Grupa_sanguina"].ToString().Equals("A2")) { radioButton2.Checked = true; } else if (read["Grupa_sanguina"].ToString().Equals("B3")) { radioButton3.Checked = true; } else { radioButton4.Checked = true; } con.Close(); radioButton1.Enabled = false; radioButton2.Enabled = false; radioButton3.Enabled = false; radioButton4.Enabled = false; val = 3; } else { MessageBox.Show("Client not found"); con.Close(); textBox1.Text = null; } } if (val == 3) { if (comboBox1.Text.ToString().Equals("Delete")) { String q, CNP; CNP = Convert.ToString(textBox3.Text); SqlConnection con = new SqlConnection(init); con.Open(); q = "Delete from Info_Client where CNP =" + CNP; SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Done!"); label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox1.Hide(); textBox2.Hide(); textBox3.Hide(); radioButton1.Hide(); radioButton2.Hide(); radioButton3.Hide(); radioButton4.Hide(); comboBox1.Hide(); button1.Hide(); radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false; } if (comboBox1.Text.ToString().Equals("Modify")) { String q, FN, LN, Gr = "01", CNP; SqlConnection con = new SqlConnection(init); con.Open(); FN = Convert.ToString(textBox1.Text); LN = Convert.ToString(textBox2.Text); CNP = Convert.ToString(textBox3.Text); if (radioButton1.Checked == false && radioButton2.Checked == false && radioButton3.Checked == false && radioButton4.Checked == false) { MessageBox.Show("Check blood type"); } else if (radioButton1.Checked == true) { Gr = Convert.ToString(radioButton1.Text); } else if (radioButton2.Checked == true) { Gr = Convert.ToString(radioButton2.Text); } else if (radioButton3.Checked == true) { Gr = Convert.ToString(radioButton3.Text); } else { Gr = Convert.ToString(radioButton4.Text); } q = "update Info_Client set Nume='" + FN.ToUpper() + "',Prenume='" + LN.ToUpper() + "',Grupa_sanguina='" + Gr + "' where CNP='" + CNP + "'"; SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("Done!"); label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox1.Hide(); textBox2.Hide(); textBox3.Hide(); radioButton1.Hide(); radioButton2.Hide(); radioButton3.Hide(); radioButton4.Hide(); comboBox1.Hide(); button1.Hide(); radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false; } if (comboBox1.Text.ToString().Equals("New Appointment")) { Form4 f4 = new Form4(); this.Hide(); f4.ShowDialog(); this.Show(); label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); textBox1.Text = null; textBox2.Text = null; textBox3.Text = null; textBox1.Hide(); textBox2.Hide(); textBox3.Hide(); radioButton1.Hide(); radioButton2.Hide(); radioButton3.Hide(); radioButton4.Hide(); button1.Hide(); radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false; comboBox1.Hide(); } if (comboBox1.Text.ToString().Equals("Delete Future Appointment")) { if (listBox1.SelectedItem != null) { String q; string[] tokens = listBox1.SelectedItem.ToString().Split(' '); q = "delete from Consultatie where Data='" + tokens[0] + "' and Ora='" + tokens[1] + "' and CNP='" + CNPMaster + "'"; SqlConnection con = new SqlConnection(init); con.Open(); SqlCommand cmd = new SqlCommand(q, con); cmd.ExecuteNonQuery(); con.Close(); listBox1.Items.Clear(); con.Open(); q = "select C.Data, C.Ora, I.Nume, I.Prenume from Consultatie C join Info_Stomatolog I on C.ID_Stomatolog=I.ID_Stomatolog and C.CNP='" + CNPMaster + "' and (C.Data>GETDATE() or (C.Data=GETDATE() and C.Ora>(SELECT CONVERT(TIME,GETDATE()))))"; cmd = new SqlCommand(q, con); SqlDataReader read = cmd.ExecuteReader(); while (read.Read()) { listBox1.Items.Add(read["Data"].ToString().Substring(0, read["Data"].ToString().IndexOf(' ')) + " " + read["Ora"].ToString().Substring(0, 5) + " " + read["Nume"].ToString() + " " + read["Prenume"].ToString()); } con.Close(); } } if (comboBox1.Text.ToString().Equals("Complete Appointment")) { if (listBox1.SelectedIndex != -1) { Form5 f5 = new Form5(); Consult = listBox1.SelectedItem.ToString(); this.Hide(); f5.ShowDialog(); this.Show(); } } if (comboBox1.Text.ToString().Equals("Bill Appointment")) { if (listBox1.SelectedIndex != -1) { Consult = listBox1.SelectedItem.ToString(); Form6 f6 = new Form6(); this.Hide(); f6.ShowDialog(); this.Show(); } } } }
private async void EventModificar_Clicked(object sender, EventArgs e) { string connectionString = ConfigurationManager.AppSettings["ipServer"]; try { var id = IdEmpleado.Text; var nombreV = Nombre.Text; var apellidoV = Apellido.Text; var sexoV = Sexo.SelectedIndex; var direccionV = Direccion.Text; var telefonoV = telefono.Text; var cedulaV = cedula.Text; var fnV = FN.Date; if (string.IsNullOrEmpty(nombreV)) { await DisplayAlert("Validacion", "Ingrese el nombre de Usuario", "Aceptar"); Nombre.Focus(); return; } if (string.IsNullOrEmpty(apellidoV)) { await DisplayAlert("Validacion", "Ingresar el apellido del empleado", "Aceptar"); Apellido.Focus(); return; } if (string.IsNullOrEmpty(direccionV)) { await DisplayAlert("Validacion", "Ingreser la direccion del empleado", "Aceptar"); Direccion.Focus(); return; } if (string.IsNullOrEmpty(telefonoV)) { await DisplayAlert("Validacion", "Ingresar el numero telefonico del empleado", "Aceptar"); telefono.Focus(); return; } if (string.IsNullOrEmpty(cedulaV)) { await DisplayAlert("Validacion", "Ingreser la cedula del empleado", "Aceptar"); cedula.Focus(); return; } if (string.IsNullOrEmpty(fnV.ToString())) { await DisplayAlert("Validacion", "Ingresar la fecha de nacimiento del usuario", "Aceptar"); FN.Focus(); return; } HttpClient client = new HttpClient(); client.BaseAddress = new Uri(connectionString); var empleados = new Emple() { EmpleadoID = int.Parse(id), Nombres = nombreV, Apellidos = apellidoV, Sexo = (Sexo.SelectedIndex == 0) ? false : true, Direccion = direccionV, Telefono = telefonoV, Fecha_Nacimiento = fnV, Cedula = cedulaV, Edad = DateTime.Now.Year - fnV.Value.Year }; var json = JsonConvert.SerializeObject(empleados); StringContent stringContent = new StringContent(json, Encoding.UTF8, "application/json"); var request = await client.PostAsync("/api/Empleados/modificar", stringContent); if (request.IsSuccessStatusCode) { var responseJson = await request.Content.ReadAsStringAsync(); var respuesta = JsonConvert.DeserializeObject <Request>(responseJson); if (respuesta.status) { await MaterialDialog.Instance.AlertAsync(message : "Usuario se modifico correctamente", title : "Registro", acknowledgementText : "Aceptar"); } else { await MaterialDialog.Instance.AlertAsync(message : "Usuario no pudo modificarse correctamente", title : "Registro", acknowledgementText : "Aceptar"); } } else { await MaterialDialog.Instance.AlertAsync(message : "Error", title : "Error", acknowledgementText : "Aceptar"); } } catch (Exception ex) { await MaterialDialog.Instance.AlertAsync(message : ex.Message, title : ex.Message, acknowledgementText : "Aceptar"); } }
override public TJCRDIR Dir(string file) { var QuakePAK = file; //var SupportLevel = false; var Returner = new TJCRDIR(); TJCREntry E; var BT = QuickStream.ReadFile(QuakePAK, QuickStream.LittleEndian); //var Level = ""; //Local LevelFiles$[] = ["THINGS","LINEDEFS","SIDEDEFS","VERTEXES","SEGS","SSECTORS","NODES","SECTORS","REJECT","BLOCKMAP","BEHAVIOR"] ' All files used in a DOOM/HERETIC/HEXEN level, in which I must note that "BEHAVIOR" is only used in HEXEN. if (BT == null) { //'JCRD_DumpError = "JCR_FetchQuakePAK(~q"+QuakePAK+"~q): QuakePAK file could not be read" JCR6.JERROR = "QuakePAK file could not be read!\n\n" + QuakePAK; BT.Close(); return(null); } var Header = BT.ReadString(4); switch (Header) { case "PACK": break; //Print "Quake Pack?" default: JCR6.JERROR = "JCR_Fetch(\"" + QuakePAK + "\"): Requested file is not a QuakePAK file"; BT.Close(); return(null); } Returner.CFGbool["__CaseSensitive"] = false; //'Next in the QuakePAK files are 2 32bit int values telling how many files the QuakePAK file contains and where in the QuakePAK file the File Table is stored var DirOffset = BT.ReadInt(); var FileCount = BT.ReadInt(); string FN; string[] FNS; //DebugLog "This QuakePAK contains "+(FileCount/64)+" entries starting at "+DirOffset BT.Position = DirOffset; //And let's now read all the crap for (int Ak = 0; Ak < FileCount; Ak += 64) { //'DebugLog "Reading entry #"+Ak if (BT.EOF) { break; } E = new TJCREntry(); //E.PVars = New StringMap ' Just has to be present to prevent crashes in viewer based software. E.MainFile = QuakePAK; FN = BT.ReadString(56); E.Offset = BT.ReadInt(); E.Size = BT.ReadInt(); FNS = FN.Split((char)0); E.Entry = FNS[0]; //'Replace(Trim(ReadString(BT,8)),Chr(0),"") E.CompressedSize = E.Size; E.Storage = "Store"; // QuakePAK does not support compression, so always deal this as "Stored" //'E.Encryption = 0 ' QuakePAK does not support encryption, so always value 0 //'If SupportLevel ' If set the system will turn DOOM levels into a folder for better usage. When unset the system will just dump everything together with not the best results, but hey, who cares :) //'Print "File = "+E.FileName+" >> Level = ~q"+Level+"~q >> Len="+Len(E.FileName)+" >> 1 = "+Left(E.FileName,1)+" >> 3 = "+Mid(E.FileName,3,1) //'If Level="" //Rem //If(Left(E.FileName, 3) = "MAP") //Level = "MAP_" + E.FileName + "/" //ElseIf((Len(E.FileName) = 4 And Left(E.FileName, 1) = "E" And Mid(E.FileName, 3, 1) = "M")) //Level = "MAP_" + E.FileName + "/" //ElseIf Level<>"" //End Rem //var Ok = false; // For Local S$= EachIn LevelFiles // If E.FileName = S Ok = True // //'Print "Comparing "+E.FileName+" with "+S+" >>>> "+Ok // //Next //'If Ok E.FileName = Level+E.FileName Else level="" //'EndIf //'EndIf //Print "Adding: " + E.FileName Returner.Entries[E.Entry.ToUpper()] = E; } BT.Close(); //'Return Ret return(Returner); }
/// <summary> /// Method used to add a property to the instance. Will be placed in the correct class Property. /// </summary> /// <param name="input">The vCard.Property to add.</param> public void AddProperty(Props.IProperty input) { if (input == null || input.IsValueNull) { return; } switch (input.Property) { case KnownProperties.ADR: ADR.AddIfNotNull(input as Props.ADR); break; case KnownProperties.ANNIVERSARY: ANNIVERSARY = input as Props.ANNIVERSARY; break; case KnownProperties.BDAY: BDAY = input as Props.BDAY; break; case KnownProperties.CALADRURI: CALADRURI.AddIfNotNull(input as Props.CALADRURI); break; case KnownProperties.CALURI: CALURI.AddIfNotNull(input as Props.CALURI); break; case KnownProperties.CATEGORIES: CATEGORIES.AddIfNotNull(input as Props.CATEGORIES); break; case KnownProperties.CLIENTPIDMAP: CLIENTPIDMAP.AddIfNotNull(input as Props.CLIENTPIDMAP); break; case KnownProperties.EMAIL: EMAIL.AddIfNotNull(input as Props.EMAIL); break; case KnownProperties.FBURL: FBURL.AddIfNotNull(input as Props.FBURL); break; case KnownProperties.FN: FN.AddIfNotNull(input as Props.FN); break; case KnownProperties.GENDER: GENDER = input as Props.GENDER; break; case KnownProperties.GEO: GEO.AddIfNotNull(input as Props.GEO); break; case KnownProperties.IMPP: IMPP.AddIfNotNull(input as Props.IMPP); break; case KnownProperties.KEY: KEY.AddIfNotNull(input as Props.KEY); break; case KnownProperties.KIND: { char k = (input as Props.KIND).Value.ToLower()[0]; if (k == 'i') { KIND = Kinds.Individual; } else if (k == 'g') { KIND = Kinds.Group; } else if (k == 'o') { KIND = Kinds.Org; } else if (k == 'l') { KIND = Kinds.Location; } else { KIND = Kinds.Individual; } break; } case KnownProperties.LANG: LANG.AddIfNotNull(input as Props.LANG); break; case KnownProperties.LOGO: LOGO.AddIfNotNull(input as Props.LOGO); break; case KnownProperties.MEMBER: MEMBER.AddIfNotNull(input as Props.MEMBER); break; case KnownProperties.N: N = input as Props.N; break; case KnownProperties.NICKNAME: NICKNAME.AddIfNotNull(input as Props.NICKNAME); break; case KnownProperties.NOTE: NOTE.AddIfNotNull(input as Props.NOTE); break; case KnownProperties.ORG: ORG.AddIfNotNull(input as Props.ORG); break; case KnownProperties.PHOTO: PHOTO.AddIfNotNull(input as Props.PHOTO); break; case KnownProperties.PRODID: PRODID = input as Props.PRODID; break; case KnownProperties.RELATED: RELATED.AddIfNotNull(input as Props.RELATED); break; case KnownProperties.REV: REV = input as Props.REV; break; case KnownProperties.ROLE: ROLE.AddIfNotNull(input as Props.ROLE); break; case KnownProperties.SOUND: SOUND.AddIfNotNull(input as Props.SOUND); break; case KnownProperties.SOURCE: SOURCE.AddIfNotNull(input as Props.SOURCE); break; case KnownProperties.TEL: TEL.AddIfNotNull(input as Props.TEL); break; case KnownProperties.TITLE: TITLE.AddIfNotNull(input as Props.TITLE); break; case KnownProperties.TZ: TZ.AddIfNotNull(input as Props.TZ); break; case KnownProperties.UID: UID = input as Props.UID; break; case KnownProperties.URL: URL.AddIfNotNull(input as Props.URL); break; case KnownProperties.VERSION: VERSION = input as Props.VERSION; break; case KnownProperties.XML: XML.AddIfNotNull(input as Props.XML); break; default: return; } }
/// <summary> /// 메트릭스의 행을 추가합니다. /// </summary> /// <param name="SelectedType"></param> private void SetMatrixAddRow(FN.RowSelectMode SelectedType) { SAPbouiCOM.DBDataSource oKIS_SD00501_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00501_HRD"); oMatrix = oForm.Items.Item("mtx1").Specific; //대행사 확정여부에 따른 활성,비활성 아이템 if (string.IsNullOrEmpty(FN.GetItemValue(ref oForm, "edtBPENTRY"))) { FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_SD00501_HRD, SelectedType, "U_ITMGRPCD"); ////oMatrix.CommonSetting.SetRowEditable 메소드로 인하여 모든 컬럼이 활성화 되는 버그(?)가 있다.서식세팅 확인버튼을 눌러주면 정상화됨. SetColumnEnable(ref oMatrix, "U_LINENUM,U_OPENAMT,U_OPENAMTB,U_BTYPE,U_BENTRY,U_BLINEID,U_TTYPE,U_TENTRY,U_TLINEID,U_STATUS", false); SetMatrixRowNumbering(oMatrix, "U_LINENUM"); SetMatrixColumnVATGRP(gl_U_VATCD, gl_U_VATCDBP); } oKIS_SD00501_HRD = null; }
/// <summary> /// 메트릭스의 행을 추가합니다. /// </summary> /// <param name="SelectedType"></param> private void SetMatrixAddRow(FN.RowSelectMode SelectedType) { SAPbouiCOM.DBDataSource oKIS_SD00301_HRD = oForm.DataSources.DBDataSources.Item("@KIS_SD00301_HRD"); oMatrix = oForm.Items.Item("mtx1").Specific; FN.SetMatrixAddRow(ref oForm, ref oMatrix, ref oKIS_SD00301_HRD, SelectedType, "U_ITMGRPCD"); oMatrix.CommonSetting.SetRowEditable(oMatrix.VisualRowCount, true); ////oMatrix.CommonSetting.SetRowEditable 메소드로 인하여 모든 컬럼이 활성화 되는 버그(?)가 있다.서식세팅 확인버튼을 눌러주면 정상화됨. SetColumnEnable(ref oMatrix, "U_LINENUM,U_OPENAMT,U_OPENAMTB,U_BTYPE,U_BENTRY,U_BLINEID,U_TTYPE,U_TENTRY,U_TLINEID,U_STATUS", false); SetMatrixRowNumbering(oMatrix, "U_LINENUM"); SetMatrixColumnVATGRP(gl_U_VATCD, gl_U_VATCDBP); oMatrix.AutoResizeColumns(); oKIS_SD00301_HRD = null; }
public override string ToString() { return(string.Format("FirstName: {0} LastName: {1}\r\nFN: {2} Tel: {3}\r\nEmail: {4} GroupNumber: {5}\r\n", FirstName.PadRight(21, ' '), LastName, FN.PadRight(28, ' '), Tel, Email.PadRight(25, ' '), GroupNumber)); }