private void btnGuardar_Click(object sender, EventArgs e)
        {
            try{
                string msg = string.Empty;
                LimpiaError();

                if (rtxtNombre.Text.Trim().Equals(string.Empty))
                {
                    errorProvider1.SetError(rtxtNombre, "Ingrese el nombre");
                    msg = "- Ingrese el nombre" + Environment.NewLine;
                }

                if (rtxtUsuario.Text.Trim().Equals(string.Empty))
                {
                    errorProvider1.SetError(rtxtUsuario, "Ingrese el usuario");
                    msg += "- Ingrese el usuario" + Environment.NewLine;
                }

                if (rtxtContrasenia.Text.Trim().Equals(string.Empty))
                {
                    errorProvider1.SetError(rtxtContrasenia, "Ingrese la contraseña");
                    msg += "- Ingrese la contraseña" + Environment.NewLine;
                }
                else
                if (!rtxtContrasenia.Text.Trim().Equals(rtxtRepContrasenia.Text.Trim()))
                {
                    errorProvider1.SetError(rtxtRepContrasenia, "Las contraseñas no coinciden");
                    msg += "- Las contraseñas no coinciden" + Environment.NewLine;
                }

                if (rtxtCorreo.Text.Trim().Equals(string.Empty))
                {
                    errorProvider1.SetError(rtxtCorreo, "Ingrese el correo eléctronico");
                    msg += "- Ingrese el correo eléctronico" + Environment.NewLine;
                }
                else
                if (!reg.IsMatch(rtxtCorreo.Text.Trim()))
                {
                    errorProvider1.SetError(rtxtCorreo, "Correo eléctronico invalido");
                    msg += "- Correo eléctronico invalido" + Environment.NewLine;
                }
                else
                if (!rtxtCorreo.Text.Trim().Equals(rtxtRepCorreo.Text.Trim()))
                {
                    errorProvider1.SetError(rtxtRepCorreo, "Los correos no coinciden");
                    msg += "- Los correos no coinciden" + Environment.NewLine;
                }

                errorProvider1.SetError(rtxtCorreo, "");
                if (!reg.IsMatch(rtxtCorreo.Text.Trim()))
                {
                    errorProvider1.SetError(rtxtCorreo, "Correo eléctronico invalido");
                    msg += "Correo eléctronico invalido" + Environment.NewLine;
                }

                errorProvider1.SetError(rtxtRepContrasenia, "");
                if (!rtxtContrasenia.Text.Trim().Equals(rtxtRepContrasenia.Text.Trim()))
                {
                    errorProvider1.SetError(rtxtRepContrasenia, "Las contraseñas no coinciden");
                    msg += "Las contraseñas no coinciden" + Environment.NewLine;
                }

                if (msg.Equals(string.Empty))
                {
                    UsuariosBE us = new UsuariosBE();
                    us.ID         = Id;
                    us.Nombre     = rtxtNombre.Text.Trim();
                    us.Usuario    = rtxtUsuario.Text.Trim();
                    us.Contrasena = new EncriptadorBP().EncriptarTexto(rtxtContrasenia.Text.Trim());
                    us.Correo     = rtxtCorreo.Text.Trim();
                    us.Activo     = rchkActivo.Checked;
                    us.EsSuper    = chkSuper.Checked;

                    ResultadoBE res = new ResultadoBE();

                    //Si Id = 0, entonces es un usuario nuevo
                    if (Id.Equals(0))
                    {
                        res = oSeguridad.GuardaUsuario(us, BaseWinBP.UsuarioLogueado.ID);
                        msg = "Se guardo correctamente el nuevo usuario";
                    }
                    else
                    {
                        res = oSeguridad.ActualizaUsuario(us, BaseWinBP.UsuarioLogueado.ID);
                        msg = "Se actualizo correctamente el usuario";
                    }

                    if (res.EsValido)
                    {
                        RadMessageBox.Show("Se actualizo correctamente el usuario", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        btnRefrescar_Click(null, null);
                    }
                    else
                    {
                        RadMessageBox.Show(res.Error, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                }
                else
                {
                    RadMessageBox.Show(msg, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                }
            }catch (Exception ex) {
                RadMessageBox.Show("Ocurrió un error al guardar los datos\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
        private void grid_CommandCellClick(object sender, EventArgs e)
        {
            GridCommandCellElement gridCell = (GridCommandCellElement)sender;
            string name = gridCell.ColumnInfo.Name.ToLower();

            GridViewRowInfo row = gridCell.RowElement.RowInfo;
            long            id  = row.Cells["Id"].Value.ToLong();

            int driverId = row.Cells["DriverId"].Value.ToInt();

            bool rtn = false;

            if (name == "btndelete")
            {
                if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to delete a Booking ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question))
                {
                    RadGridView grid = gridCell.GridControl;
                    grid.CurrentRow.Delete();
                }
            }
            else if (name == "btnrecall")
            {
                if (row.Cells["Status"].Value.ToStr() == "POB" || row.Cells["Status"].Value.ToStr() == "STC")

                {
                    ENUtils.ShowMessage("Job cannot be Re-Call as driver is on " + row.Cells["Status"].Value.ToStr() + " Status.");
                    return;
                }
                else if (row.Cells["StatusId"].Value.ToInt() == Enums.BOOKINGSTATUS.DISPATCHED || row.Cells["StatusId"].Value.ToInt() == Enums.BOOKINGSTATUS.CANCELLED)
                {
                    if (General.GetQueryable <Booking>(null).Count(c => c.Id == id && (c.AcceptedDateTime != null || c.Fleet_Driver != null && c.Fleet_Driver.HasPDA == true)) > 0)
                    {
                        ENUtils.ShowMessage("Job cannot be Re-Call as driver is on " + row.Cells["Status"].Value.ToStr() + " Status.");
                        return;
                    }
                }


                if (DialogResult.Yes == RadMessageBox.Show("Are you sure you want to Re-Call a Booking ? ", "", MessageBoxButtons.YesNo, RadMessageIcon.Question))
                {
                    new Thread(delegate()
                    {
                        General.ReCallBooking(id, driverId);
                    }).Start();
                }
                else
                {
                    return;
                }
            }
            else if (name == "btnredespatch")
            {
                rtn = General.ShowDespatchForm(General.GetObject <Booking>(c => c.Id == id));
            }

            if (name == "btnrecall" || name == "btnredespatch")
            {
                if (name == "btnredespatch" && rtn == false)
                {
                    return;
                }


                Thread.Sleep(500);
                PopulateData();

                (Application.OpenForms.OfType <Form>().FirstOrDefault(c => c.Name == "frmBookingDashBoard") as frmBookingDashBoard).RefreshActiveData();



                // General.RefreshListWithoutSelected<frmBookingDashBoard>("frmBookingDashBoard1");
            }
        }
        public ProfileForm(Profile profile, Configuration configuration)
        {
            _configuration = configuration;
            Profile        = profile;
            InitializeComponent();
            LoadLocalization();
            otherCheckBox.Checked = true;
            if (Profile.AllowedReleaseTypes != null)
            {
                foreach (string item in Profile.AllowedReleaseTypes)
                {
                    switch (item)
                    {
                    case "snapshot":
                        snapshotsCheckBox.Checked = true;
                        break;

                    case "old_beta":
                        betaCheckBox.Checked = true;
                        break;

                    case "old_alpha":
                        alphaCheckBox.Checked = true;
                        break;

                    default:
                        continue;
                    }
                }
            }
            if (Profile.DisallowedReleaseTypes != null)
            {
                foreach (string item in Profile.DisallowedReleaseTypes)
                {
                    switch (item)
                    {
                    case "modified":
                        otherCheckBox.Checked = false;
                        break;

                    default:
                        continue;
                    }
                }
            }
            GetVersions();
            nameBox.Text = Profile.ProfileName;
            if (Profile.WorkingDirectory != null)
            {
                GameDirectoryCheckBox.Checked = true;
                gameDirectoryBox.Text         = Profile.WorkingDirectory;
            }
            else
            {
                gameDirectoryBox.Text = _configuration.McDirectory;
            }
            if (Profile.WindowInfo != null)
            {
                xResolutionBox.Text = Profile.WindowInfo.Width.ToString();
                yResolutionBox.Text = Profile.WindowInfo.Height.ToString();
            }
            if (Profile.ConnectionSettigs != null)
            {
                FastConnectCheckBox.Checked = true;
                ipTextBox.Text   = Profile.ConnectionSettigs.ServerIp;
                portTextBox.Text = Profile.ConnectionSettigs.ServerPort.ToString();
            }
            switch (Profile.LauncherVisibilityOnGameClose)
            {
            case Profile.LauncherVisibility.HIDDEN:
                stateBox.SelectedIndex = 1;
                break;

            case Profile.LauncherVisibility.CLOSED:
                stateBox.SelectedIndex = 2;
                break;

            default:
                stateBox.SelectedIndex = 0;
                break;
            }
            if (Java.JavaExecutable == @"\bin\java.exe")
            {
                RadMessageBox.Show(this, _configuration.Localization.JavaDetectionFailed,
                                   _configuration.Localization.Error, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
            javaExecutableBox.Text         = Profile.JavaExecutable ?? Java.JavaExecutable;
            JavaExecutableCheckBox.Checked = javaExecutableBox.Text != Java.JavaExecutable;
            javaArgumentsBox.Text          = Profile.JavaArguments ?? "-Xmx1024M";
            JavaArgumentsCheckBox.Checked  = javaArgumentsBox.Text != "-Xmx1024M";
        }
Exemple #4
0
        async Task CheckUpAsync(string text, RadButton rbd)
        {
            radGridView1.Enabled = false;

            if (rbd.Name == "radButton3")
            {
                var studentRequested = new StudentsLookupModel {
                    MatricNo = text
                };

                var student = await client.GetStudentsInfoAsync(studentRequested);

                if (student.Name.Equals(string.Empty))
                {
                    radGridView1.Enabled = true;
                    RadMessageBox.Show("Not found on Server!!!", "Alert");
                }
                else
                {
                    // student.
                    //  pictureBox1.Image = convertfrombytesarray(Convert.FromBase64String(student.ProfilePicture.ToBase64()));
                    StudentsTempProfiles studentTemp = new StudentsTempProfiles();
                    radGridView1.Enabled    = true;
                    studentTemp.matricNo    = student.MatricNo;
                    studentTemp.name        = student.Name;
                    studentTemp.bloodGroup  = student.BloodGroup;
                    studentTemp.school      = student.School;
                    studentTemp.programme   = student.Programme;
                    studentTemp.profilePics = convertfrombytesarray(Convert.FromBase64String(student.ProfilePicture.ToBase64()));
                    _bs.DataSource          = studentTemp;
                    studentTemp             = null;
                }
            }
            else if (rbd.Name == "radButton1")
            {
                List <StudentsTempProfiles> studentTempList = new List <StudentsTempProfiles>();
                using (var call = client.GetAllStudentsInfo(new StudentLookup()))
                {
                    while (await call.ResponseStream.MoveNext())
                    {
                        StudentsTempProfiles studentTemp = new StudentsTempProfiles();
                        var currentStudentObj            = call.ResponseStream.Current;
                        studentTemp.matricNo    = currentStudentObj.MatricNo;
                        studentTemp.name        = currentStudentObj.Name;
                        studentTemp.bloodGroup  = currentStudentObj.BloodGroup;
                        studentTemp.school      = currentStudentObj.School;
                        studentTemp.programme   = currentStudentObj.Programme;
                        studentTemp.profilePics = convertfrombytesarray(Convert.FromBase64String(currentStudentObj.ProfilePicture.ToBase64()));


                        studentTempList.Add(studentTemp);
                        //MessageBox.Show(currentStudentObj.Name);
                        _bs.DataSource = studentTempList;
                    }

                    radGridView1.Enabled = true;
                }
            }
            else if (rbd.Name == "radButton4")
            {
                var studentRequested = new StudentsLookupModel {
                    MatricNo = text
                };
                var studentList = client.DeleteAStudent(studentRequested);

                List <StudentsTempProfiles> studentTempList = new List <StudentsTempProfiles>();
                while (await studentList.ResponseStream.MoveNext())
                {
                    StudentsTempProfiles studentTemp = new StudentsTempProfiles();
                    var currentStudentObj            = studentList.ResponseStream.Current;
                    studentTemp.matricNo    = currentStudentObj.MatricNo;
                    studentTemp.name        = currentStudentObj.Name;
                    studentTemp.bloodGroup  = currentStudentObj.BloodGroup;
                    studentTemp.school      = currentStudentObj.School;
                    studentTemp.programme   = currentStudentObj.Programme;
                    studentTemp.profilePics = convertfrombytesarray(Convert.FromBase64String(currentStudentObj.ProfilePicture.ToBase64()));


                    studentTempList.Add(studentTemp);
                    //MessageBox.Show(currentStudentObj.Name);
                    _bs.DataSource = studentTempList;
                }
                radGridView1.Enabled = true;
            }
            _bs.ResetBindings(false);
            radGridView1.DataSource = _bs;
            AdjustRadGridViewColumns(radGridView1);
        }
 public static void ShowMessage(string message)
 {
     RadMessageBox.SetThemeName(theme);
     RadMessageBox.Show(message);
 }
Exemple #6
0
        private void SaveNewItem(short StatusID, bool print)
        {
            string iLogID = string.Empty;
            string mobil  = string.Empty
            , sopir       = string.Empty
            , keterangan  = null;
            int kernetid  = -1
            , sopirid     = -1
            , mobilid     = -1
            , kotaid      = -19
            , salesid     = -1
            , custid      = -1
            , custtypeid  = -1;
            int paid      = 0;

            custtypeid = 2;

            string[] sep = { "_" };
            custid = int.Parse(rddSup.SelectedValue.ToString().Split(sep, StringSplitOptions.RemoveEmptyEntries)[0]);

            using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter())
            {
                //Always Create with status created
                iLogID = tbl.pInsertLogProdChild(dtpTanggal.Value
                                                 , parentid_
                                                 , 1
                                                 , kernetid
                                                 , sopirid
                                                 , mobilid
                                                 , kotaid
                                                 , custid
                                                 , mobil
                                                 , sopir
                                                 , keterangan
                                                 , custid
                                                 , custtypeid
                                                 , int.Parse(transtypeid_)
                                                 , NBConfig.ValidUserName
                                                 , StatusID, paid, 0).ToString();
            }

            custtypeid = int.Parse(rddSup.Tag.ToString());
            foreach (GridViewRowInfo item in radGridView1.Rows)
            {
                using (sinarekDataSetTableAdapters.logdetailTableAdapter tbl = new sinarekDataSetTableAdapters.logdetailTableAdapter())
                {
                    try
                    {
                        tbl.pInsertLogOther(int.Parse(iLogID)
                                            , item.Cells["keterangan"].Value.ToString()
                                            , (int.Parse(item.Cells["status"].Value.ToString()) == 5 ? 1 : 0)
                                            , int.Parse(item.Cells["custtypeid"].Value.ToString())
                                            , int.Parse(item.Cells["custtypetoid"].Value.ToString())
                                            , null
                                            , decimal.Parse(item.Cells["quantity"].Value.ToString())
                                            , int.Parse(item.Cells["productid"].Value.ToString())
                                            , int.Parse(item.Cells["status"].Value.ToString())
                                            , 0
                                            , NBConfig.ValidUserName);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }

            MessageBox.Show("Data sudah terinput.", "SMS");

            //Print
            DialogResult res = RadMessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptTM rpt = new rptTM();
                rpt.ReportParameters["user"].Value  = NBConfig.ValidUserName;
                rpt.ReportParameters["logid"].Value = iLogID;

                IReportDocument iRpt = (IReportDocument)rpt;
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...
                InstanceReportSource reportSource = new InstanceReportSource();
                reportSource.ReportDocument = iRpt;
                // Print the report using the printer settings.
                reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);

                using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter())
                {
                    tbl.UpdatePrinted(NBConfig.ValidUserName, long.Parse(iLogID));
                }
                helper.PrintLog(this.GetType().Name, rpt.Name, this.Text + ":LogID-" + iLogID);
            }
            else
            {
                helper.NotifMessage("Transaksi masuk ini dapat dilihat di daftar transaksi yg belum di print.");
            }
        }
Exemple #7
0
        private void rbtnCiphe_Click(object sender, EventArgs e)
        {
            try
            {
                string CipherText = "";

                if (!String.IsNullOrEmpty(rtbInput.Text))
                {
                    CipherText = rtbInput.Text;
                }
                else
                {
                    rtbOutput.Text = "";
                    RadMessageBox.Show("輸入內容為空!", "系統提示", MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    return;
                }

                ContentList = new List <string>();
                foreach (char item in CipherText)
                {
                    ContentList.Add(getString(item));   //儲存明文字串
                }
                List <int> intList = new List <int>();  //儲存明文分解過後的Int字串
                List <int> Keytemp = new List <int>();  //金鑰字串
                List <int> result  = new List <int>();  //輸出密文



                foreach (string item in ContentList)    //分解字串
                {
                    int tempInt = 0;
                    if (Convert.ToInt32(item[0]) >= 65 && 90 >= Convert.ToInt32(item[0]))    //A-Z
                    {
                        tempInt              = Convert.ToInt32(item[0]) - 64;
                        intList.Add(tempInt %= 10);
                    }
                    else if (Convert.ToInt32(item[0]) >= 97 && 122 >= Convert.ToInt32(item[0]))    //a-z
                    {
                        tempInt = Convert.ToInt32(item[0]) - 96;
                        if (tempInt / 10 > 0) //二位數
                        {
                            intList.Add(tempInt / 10);
                            intList.Add(tempInt % 10);
                        }
                        else
                        {
                            intList.Add(tempInt % 10);
                        }
                    }
                    else if (Convert.ToInt32(item[0]) >= 48 && 57 >= Convert.ToInt32(item[0]))   //0-9
                    {
                        tempInt = Convert.ToInt32(item[0]) - 48;
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 41)  // !
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 42)  // *
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 43)  // +
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 45)  // -
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 47)  // /
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 64)  // @
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 94)  // ^
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 95)  // _
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 126)  // ~
                    {
                        tempInt = Convert.ToInt32(item[0]);
                        intList.Add(tempInt);
                    }
                    else if (Convert.ToInt32(item[0]) == 13 || Convert.ToInt32(item[0]) == 10)  // \r  ||  \n
                    {
                    }
                    else
                    {
                        if (Convert.ToInt32(item[0]) == 32)
                        {
                            RadMessageBox.Show("欲加密的文字不可輸入空格(Space).", "系統提示", MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                        }
                        else
                        {
                            RadMessageBox.Show("請輸入\"A-Za-z0-9!*+-/@^_~\"範圍內的數字.", "系統提示", MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                        }
                        rtbOutput.Text = "";
                        return;
                    }
                }


                for (int i = 0; i < intList.Count; i++) //加密金鑰
                {
                    if (i == 0)
                    {
                        Keytemp.Add(1);
                    }
                    else
                    {
                        Keytemp.Add(1 + 2 * i);
                    }
                }

                int ix = 0;
                foreach (int item in intList)
                {
                    result.Add((item + Keytemp[ix++]) % 10);   //明文+金鑰 取最後一位
                }

                //輸出
                string resultStr = "", resultStr2 = "";
                foreach (int item in result)
                {
                    resultStr  += item + ",";
                    resultStr2 += item;
                }
                rtbOutput.Text  = resultStr.Length > 1 ? "含逗號:" + resultStr.Substring(0, resultStr.Length - 1) : "含逗號:" + resultStr;
                rtbOutput.Text += Environment.NewLine + Environment.NewLine + "不含逗號:" + resultStr2;
            }
            catch (Exception ex)
            {
                string errorMsg = ex.Message + "\r\n\r\n" + ex.StackTrace;
                RadMessageBox.Show($"rbtnCiphe_Click()\r\n{errorMsg}", "系統提示", MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
Exemple #8
0
 private void rmiAbout_Click(object sender, EventArgs e)
 {
     RadMessageBox.Show("Copyright © Ismael Heredia 2020", program_title, MessageBoxButtons.OK, RadMessageIcon.Info, MessageBoxDefaultButton.Button1);
 }
        private void Form_MayorDetalladoReport_Load(object sender, EventArgs e)
        {
            if (fechaFin >= fechaInicio)
            {
                try
                {
                    if (checkExcel == true)
                    {
                        reports.rptLibroMayorExcel _rptLibroMayor = new reports.rptLibroMayorExcel();
                        //pase 05
                        _rptLibroMayor.DataSourceConnections[0].SetConnection(objCnx.server(), objCnx.database(), objCnx.user(), objCnx.password());

                        _rptLibroMayor.SetParameterValue("@MonedaID", monedaId);
                        _rptLibroMayor.SetParameterValue("@Desde", fechaInicio.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("@Hasta", fechaFin.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("@Detallado", 1);
                        _rptLibroMayor.SetParameterValue("@EmpresaID", empresaId);
                        _rptLibroMayor.SetParameterValue("@Ejercicio", periodoId);
                        _rptLibroMayor.SetParameterValue("@EstablecimientoID", _sucursalId);
                        _rptLibroMayor.SetParameterValue("name_report", "FORMATO 06.01 : LIBRO MAYOR");
                        _rptLibroMayor.SetParameterValue("date_range", fechaInicio.ToShortDateString() + " - " + fechaFin.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("currency", "Expresado en " + monedaNom);
                        _rptLibroMayor.SetParameterValue("empresa", empresa);
                        _rptLibroMayor.SetParameterValue("periodo", periodoId);
                        _rptLibroMayor.SetParameterValue("ruc", rucParam);
                        _rptLibroMayor.SetParameterValue("address", direccParam);
                        _rptLibroMayor.SetParameterValue("Fecha", "FECHA:" + DateTime.Now.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("Hora", "HORA:" + DateTime.Now.ToShortTimeString());
                        crvLibros.ReportSource = _rptLibroMayor;
                    }
                    else
                    {
                        String Mes = "";
                        Mes = MonthName(fechaInicio.Month).ToUpper();
                        //reports.rptLibroMayor _rptLibroMayor = new reports.rptLibroMayor();

                        CrystalDecisions.CrystalReports.Engine.ReportClass _rptLibroMayor;
                        if (checkVertical)
                        {
                            _rptLibroMayor = new reports.rptLibroMayorVert();
                        }
                        else
                        {
                            _rptLibroMayor = new reports.rptLibroMayor();
                        }


                        //pase 06
                        _rptLibroMayor.DataSourceConnections[0].SetConnection(objCnx.server(), objCnx.database(), objCnx.user(), objCnx.password());

                        _rptLibroMayor.SetParameterValue("@MonedaID", monedaId);
                        _rptLibroMayor.SetParameterValue("@Desde", fechaInicio.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("@Hasta", fechaFin.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("@Detallado", 1);
                        _rptLibroMayor.SetParameterValue("@EmpresaID", empresaId);
                        _rptLibroMayor.SetParameterValue("@Ejercicio", periodoId);
                        _rptLibroMayor.SetParameterValue("@EstablecimientoID", _sucursalId);
                        _rptLibroMayor.SetParameterValue("name_report", "FORMATO 06.01 : LIBRO MAYOR");
                        _rptLibroMayor.SetParameterValue("date_range", fechaInicio.ToShortDateString() + " - " + fechaFin.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("currency", "EXPRESADO EN " + monedaNom.ToUpper());
                        _rptLibroMayor.SetParameterValue("empresa", empresa.ToUpper());
                        _rptLibroMayor.SetParameterValue("periodo", "EJERCICIO: " + periodoId + " - " + Mes);
                        _rptLibroMayor.SetParameterValue("ruc", "RUC: " + rucParam);
                        _rptLibroMayor.SetParameterValue("address", direccParam.ToUpper());
                        _rptLibroMayor.SetParameterValue("Fecha", "FECHA:  " + DateTime.Now.ToShortDateString());
                        _rptLibroMayor.SetParameterValue("Hora", "HORA :  " + DateTime.Now.ToShortTimeString());
                        crvLibros.ReportSource = _rptLibroMayor;
                    }
                }
                catch
                {
                    RadMessageBox.Show("Ha ocurrido un error inesperado", "Error:", MessageBoxButtons.OK, RadMessageIcon.Error);
                }
            }
            else
            {
                RadMessageBox.Show("El rango de fechas es incorrecto", "Error:", MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
Exemple #10
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            frmLookupSetup frmLookupSetupCopy = new frmLookupSetup();
            string         gv_Command         = null;

            try
            {
                if (string.IsNullOrEmpty(txtID.Text) | Information.IsDBNull(txtID.Text))
                {
                    RadMessageBox.Show("ID cannot be blank");
                    return;
                }


                gv_Command = "Update tbl_Setup_miscLookupList set ";

                gv_Command = gv_Command + " ID = '" + txtID.Text + "',";

                gv_Command = gv_Command + " FieldValue = '" + txtLookupValue.Text + "'";

                gv_Command = gv_Command + " Where lookupid = " + frmLookupSetupCopy.rdcLookupList.Tables[rdcLookupListTable].Rows[0]["LookupID"];

                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, gv_Command);


                modGlobal.gv_sql = " update tbl_setup_savedadhocreportcriteria ";
                modGlobal.gv_sql = modGlobal.gv_sql + " set [value] = '" + txtID.Text + "'";
                modGlobal.gv_sql = modGlobal.gv_sql + " Where lookupid = " + frmLookupSetupCopy.rdcLookupList.Tables[rdcLookupListTable].Rows[0]["LookupID"];
                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql);

                modGlobal.gv_sql = " update tbl_setup_submitcleanuprecord ";
                modGlobal.gv_sql = modGlobal.gv_sql + " set [value] = '" + txtID.Text + "'";
                modGlobal.gv_sql = modGlobal.gv_sql + " Where lookupid = " + frmLookupSetupCopy.rdcLookupList.Tables[rdcLookupListTable].Rows[0]["LookupID"];
                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql);

                modGlobal.gv_sql = " update tbl_setup_submitcriteria ";
                modGlobal.gv_sql = modGlobal.gv_sql + " set [value] = '" + txtID.Text + "'";
                modGlobal.gv_sql = modGlobal.gv_sql + " Where lookupid = " + frmLookupSetupCopy.rdcLookupList.Tables[rdcLookupListTable].Rows[0]["LookupID"];
                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql);

                modGlobal.gv_sql = " update tbl_setup_tablevalidation ";
                modGlobal.gv_sql = modGlobal.gv_sql + " set [value] = '" + txtID.Text + "'";
                modGlobal.gv_sql = modGlobal.gv_sql + " Where lookupid = " + frmLookupSetupCopy.rdcLookupList.Tables[rdcLookupListTable].Rows[0]["LookupID"];
                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql);

                this.Close();
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }
Exemple #11
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            oCatalogos = new WCF_Catalogos.Hersan_CatalogosClient();
            AccesoriosBE obj = new AccesoriosBE();

            try {
                if (txtClave.Text.Trim().Length == 0 || txtNombre.Text.Trim().Length == 0)
                {
                    RadMessageBox.Show("Debe capturar todos los datos para continuar", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    return;
                }
                foreach (GridViewRowInfo oRow in gvDatos.Rows)
                {
                    if ((oRow.Cells["Nombre"].Value.ToString() == txtNombre.Text.Trim() ||
                         oRow.Cells["Clave"].Value.ToString() == txtClave.Text.Trim()) &&
                        int.Parse(txtId.Text) == 0)
                    {
                        RadMessageBox.Show("El accesorio capturado ya existe", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                        LimpiarCampos();
                        return;
                    }
                }

                obj.Id     = int.Parse(txtId.Text);
                obj.Clave  = txtClave.Text;
                obj.Nombre = txtNombre.Text;
                obj.DatosUsuario.Estatus       = chkEstatus.Checked;
                obj.DatosUsuario.IdUsuarioCreo = BaseWinBP.UsuarioLogueado.ID;

                //PROCESO DE GUARDADO Y ACTUALIZACION
                if (txtId.Text == "0")
                {
                    int Result = oCatalogos.ENS_Accesorios_Guardar(obj);
                    if (Result == 0)
                    {
                        RadMessageBox.Show("Ocurrió un error al guardar el accesorio", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                    else
                    {
                        RadMessageBox.Show("Accesorio guardado correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        LimpiarCampos();
                        CargarDatos();
                    }
                }
                else
                {
                    int Result = oCatalogos.ENS_Accesorios_Actualizar(obj);
                    if (Result == 0)
                    {
                        RadMessageBox.Show("Ocurrió un error al actualizar los datos", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                    else
                    {
                        RadMessageBox.Show("Información actualizada correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        LimpiarCampos();
                        CargarDatos();
                    }
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrió un error al actualizar la información\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            } finally {
                oCatalogos = null;
            }
        }
Exemple #12
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try {
                UsuariosBE Usuario = BaseWinBP.UsuarioLogueado;
                errorProvider1.SetError(rtxtUsuario, "");
                errorProvider1.SetError(rtxtContrasenia, "");
                errorProvider1.SetError(txtNuevaContra, "");
                string msg = string.Empty;

                if (rtxtUsuario.Text.Trim().Length.Equals(0))
                {
                    msg = "- Ingrese la contraseña anterior" + Environment.NewLine;
                    errorProvider1.SetError(rtxtUsuario, "Ingrese la contraseña anterior");
                }

                if (rtxtContrasenia.Text.Trim().Length.Equals(0))
                {
                    msg += "- Ingrese la nueva contraseña" + Environment.NewLine;
                    errorProvider1.SetError(rtxtContrasenia, "Ingrese la nueva contraseña");
                }

                if (txtNuevaContra.Text.Trim().Length.Equals(0))
                {
                    msg += "- Repita la nueva contraseña" + Environment.NewLine;
                    errorProvider1.SetError(rtxtContrasenia, "Repipta la nueva contraseña");
                }

                if (!rtxtContrasenia.Text.Trim().Equals(txtNuevaContra.Text.Trim()))
                {
                    msg += "- Las contraseñas no coinciden";
                    errorProvider1.SetError(rtxtContrasenia, "Las contraseñas no coinciden");
                }


                if (msg.Length.Equals(0))
                {
                    if (RadMessageBox.Show("Esta acción cambiará la contraseña y cerrará el sistema\nDesea continuar...?", this.Text, MessageBoxButtons.YesNo, RadMessageIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        //WCF_Seguridad.SIAC_SeguridadClient wcf = new WCF_Seguridad.SIAC_SeguridadClient();

                        //Se valida primero el usuario
                        ValidaIngresoBE val = wcf.ValidaUsuario(Usuario.Usuario, new EncriptadorBP().EncriptarTexto(rtxtUsuario.Text.Trim()));
                        if (val.EsIngresoValido)
                        {
                            //Se cambia el password y se sale de la aplicación
                            Usuario.Contrasena = new EncriptadorBP().EncriptarTexto(txtNuevaContra.Text.Trim());
                            if (wcf.CambiaContrasenia(Usuario) == 0)
                            {
                                RadMessageBox.Show("Ocurrió un error, la contraseña no puede ser cambiada", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                                this.Close();
                            }
                            else
                            {
                                RadMessageBox.Show("Contraseña cambiada correctamente, ahora el sistema se cerrará", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                                Application.Exit();
                            }
                        }
                        else
                        {
                            RadMessageBox.Show("La contraseña capturada es incorrecta\ncorrija e intente de nuevo", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                        }
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    RadMessageBox.Show("Datos Obligatorios" + Environment.NewLine + msg, this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                    this.DialogResult = DialogResult.None;
                }
            } catch (Exception ex) {
                throw ex;
            }
        }
Exemple #13
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            #region "  CheckFillTextBox "

            if (EmpComboBox.Text == "")
            {
                EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed;

                EmpComboBox.Focus();

                return;
            }
            else
            {
                EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White;
            }
            if (EmpComboBox.SelectedValue == null)
            {
                EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.OrangeRed;

                EmpComboBox.Focus();

                return;
            }
            else
            {
                EmpComboBox.MultiColumnComboBoxElement.BackColor = Color.White;
            }

            if (radDropDownList1.Text == "")
            {
                radDropDownList1.BackColor = Color.OrangeRed;

                radDropDownList1.Focus();

                return;
            }
            else
            {
                radDropDownList1.BackColor = Color.White;
            }


            #endregion

            var q = WorkCmd.CheckWork(int.Parse(EmpComboBox.SelectedValue.ToString()), LeaveDateTimePicker.Value.Date);
            if (q != null)
            {
                if (RadMessageBox.Show(this, "هل تريد حفظ التغيرات", "تنبيه", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
                {
                    LvTb.EmpId     = int.Parse(EmpComboBox.SelectedValue.ToString());
                    LvTb.LeaveDate = LeaveDateTimePicker.Value.Date;
                    LvTb.LeaveTime = leaveTimeTimeEdit.Time.TimeOfDay;
                    LvTb.BackTime  = backTimeTimeEdit.Time.TimeOfDay;
                    LvTb.LeaveType = radDropDownList1.Text;
                    LeaveCmdClass.EditLeave(LvTb);
                }
                if (RadMessageBox.Show(this, "هل يتم اعتماد ساعة العودة  ساعة الانصراف", "تنبيه", MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
                {
                    var ListData = WorkCmd.GetWorkInfo(int.Parse(EmpComboBox.SelectedValue.ToString()), LeaveDateTimePicker.Value.Date);

                    foreach (var item in ListData)
                    {
                        Startime            = DateTime.Parse(item.startTime.ToString());
                        UserClass.XWorkTime = float.Parse(item.RealWorkTimeNo.ToString());
                    }

                    float     compMonth = (backTimeTimeEdit.Time.Minute + backTimeTimeEdit.Time.Hour * 60) - (Startime.Minute + Startime.Hour * 60);
                    float     Totaltime = compMonth / 60;
                    WorkTable tb1       = new WorkTable()
                    {
                        EmpId          = int.Parse(EmpComboBox.SelectedValue.ToString()),
                        WorkDate       = LeaveDateTimePicker.Value.Date,
                        startTime      = Startime.TimeOfDay,
                        endtime        = leaveTimeTimeEdit.Time.TimeOfDay,
                        RealWorkTimeNo = UserClass.XWorkTime,
                        WorkTime       = Totaltime,
                        DefernceTime   = (Totaltime - UserClass.XWorkTime),
                        WorkFinsh      = "true"
                    };
                    WorkCmd.EditWorkUser(tb1);
                    RadMessageBox.Show("تمت الاضافة واعتماد ساعة الانتهاء من الدوام", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info);
                }

                RadMessageBox.Show("تمت الاضافة بدون اعتماد ساعةالانتهاء من الدوام", "تمت", MessageBoxButtons.OK, RadMessageIcon.Info);
            }
            else
            {
                RadMessageBox.Show("يرجى اولا تسجيل الحضور", "خطأ", MessageBoxButtons.OK, RadMessageIcon.Error);
                return;
            }
        }
Exemple #14
0
        private void InitForm()
        {
            //窗体关闭时dispose
            this.FormClosed += (s, e) => {
                if (bll != null)
                {
                    bll.Dispose();
                    bll = null;
                }
            };

            data = new Helpers.VirtualGridData <Models.AppRole> {
                Grid = this.vgUserRoles, LoadedCount = 0, PerLoadSize = 100
            };
            this.Text = "角色管理";
            this.vgUserRoles.AutoSizeColumnsMode       = VirtualGridAutoSizeColumnsMode.Fill;//
            this.vgUserRoles.EnableAlternatingRowColor = true;
            this.vgUserRoles.Selection.Multiselect     = false;
            this.vgUserRoles.SelectionMode             = VirtualGridSelectionMode.FullRowSelect;
            this.vgUserRoles.AllowAddNewRow            = false;
            //this.vgUserRoles.AllowDelete = false;
            this.vgUserRoles.AllowEdit      = false;
            this.vgUserRoles.FilterChanged += (s, e) => { Helpers.VirtualGridDataHelper.InitalLoad <Models.AppRole>(data); };
            this.vgUserRoles.SortChanged   += (s, e) => { Helpers.VirtualGridDataHelper.InitalLoad <Models.AppRole>(data); };
            //表格删除时
            this.vgUserRoles.UserDeletedRow += (s, e) =>
            {
                DeleteEntry();
            };
            //双击编辑
            this.vgUserRoles.CellDoubleClick += (s, e) => {
                var cell = this.vgUserRoles.CurrentCell;
                if (cell == null)
                {
                    return;
                }
                if (cell.RowIndex < 0)
                {
                    return;
                }

                var current = data.Data[cell.RowIndex];
                UserRolesAddEditForm form = new UserRolesAddEditForm();
                form.EditMode = Enums.EditFormMode.Edit;
                form.UserRole = current;


                var dr = form.ShowDialog(this);

                if (dr == DialogResult.OK)
                {
                    this.vgUserRoles.BeginUpdate();
                    data.Data[cell.RowIndex] = form.UserRole;
                    this.vgUserRoles.EndUpdate();
                    this.vgUserRoles.SelectCell(cell.RowIndex, cell.ColumnIndex);
                }
            };
            //按钮编辑
            this.btnEdit.Click += (s, e) => {
                var cell = this.vgUserRoles.CurrentCell;
                if (cell == null)
                {
                    RadMessageBox.Show(this, "请选择一行!", "", MessageBoxButtons.OK, RadMessageIcon.Error);
                    return;
                }
                if (cell.RowIndex < 0)
                {
                    return;
                }

                var current = data.Data[cell.RowIndex];
                UserRolesAddEditForm form = new UserRolesAddEditForm();
                form.EditMode = Enums.EditFormMode.Edit;
                form.UserRole = current;
                var dr = form.ShowDialog(this);
                //form.FormClosed += (ss, ee) => { Helpers.VirtualGridDataHelper.InitalLoad<Models.UserRole>(data, syncContext); };
                if (dr == DialogResult.OK)
                {
                    this.vgUserRoles.BeginUpdate();
                    data.Data[cell.RowIndex] = form.UserRole;
                    this.vgUserRoles.EndUpdate();
                    this.vgUserRoles.SelectCell(cell.RowIndex, cell.ColumnIndex);
                }
            };


            this.btnReLoad.Click += (s, e) => {
                Helpers.VirtualGridDataHelper.InitalLoad <Models.AppRole>(data);
            };

            this.btnAdd.Click += (s, e) => {
                UserRolesAddEditForm form = new UserRolesAddEditForm();
                //form.StartPosition = FormStartPosition.WindowsDefaultLocation;
                form.EditMode = Enums.EditFormMode.Add;
                var dr = form.ShowDialog(this);
                if (dr == DialogResult.OK)
                {
                    this.vgUserRoles.BeginUpdate();
                    this.data.Data.Insert(0, form.UserRole);
                    this.vgUserRoles.RowCount++;
                    this.vgUserRoles.EndUpdate();
                    this.vgUserRoles.SelectCell(0, 0);
                }
            };

            this.btnDelete.Click += (s, e) => { DeleteEntry(); };

            Helpers.VirtualGridDataHelper.InitalLoad <Models.AppRole>(data);

            //设置Column宽度 命令列,使用ID列做为命令列
            //this.vgUserRoles.TableElement.ColumnsViewState.SetItemSize(0, 30);

            //this.vgUserRoles.ColumnWidthChanging += (s, e) => {
            //    //ID列为命令按钮,固定大小,不允许resize
            //    int idIndex = Array.IndexOf(ModelHelper.GetColumnNames(typeof(UserRole)), "ID");
            //    if (e.ColumnIndex == idIndex)
            //    {
            //        e.Cancel = true;
            //    }
            //};

            //this.vgUserRoles.CreateCellElement += (s, e) => {
            //    //ID列约定为命令按钮
            //    int idIndex = Array.IndexOf(ModelHelper.GetColumnNames(typeof(UserRole)), "ID");
            //    if (e.RowIndex >= 0 && e.ColumnIndex == idIndex)
            //    {
            //        var cmd = new Helpers.VirtualGridEditCommandCellElement();
            //        cmd.EditButtonClicked += (ss, ee) => {
            //            var id = (int)cmd.Value;
            //            var entity =  data.Data.FirstOrDefault(x => x.ID == id);
            //            if (entity!=null)
            //            {
            //                UserRolesAddEditForm form = new UserRolesAddEditForm();
            //                form.EditMode = Enums.EditFormMode.Edit;
            //                form.UserRole = entity;
            //                var dr = form.ShowDialog(this);
            //                if (dr == DialogResult.OK)
            //                {
            //                    Helpers.VirtualGridDataHelper.InitalLoad<Models.UserRole>(data, System.Threading.SynchronizationContext.Current);
            //                }
            //            }
            //        };
            //        cmd.DeleteButtonClicked += (ss, ee) => { };
            //        e.CellElement = cmd;
            //    }

            //};
            //this.vgUserRoles.CellFormatting += (s, e) => {
            //    //ID列约定为命令按钮
            //    int idIndex = Array.IndexOf(ModelHelper.GetColumnNames(typeof(UserRole)), "ID");
            //    if (e.CellElement.RowIndex == -3 && e.CellElement.ColumnIndex == idIndex)
            //    {
            //        e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
            //    }
            //    if (e.CellElement.RowIndex == -1 && e.CellElement.ColumnIndex == idIndex)
            //    {
            //        e.CellElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
            //    }
            //};
        }
Exemple #15
0
        private void cmdAddSet_Click(object sender, EventArgs e)
        {
            var    i      = 0;
            string NewSet = null;


            try
            {
                int NewIndSID = modDBSetup.FindMaxRecID("tbl_Setup_IndicatorSet", "IndicatorSetID");


                NewSet = RadInputBox.Show("Please enter the description of the new Indicator Set:", "Add New Set", "");

                if (string.IsNullOrEmpty(NewSet))
                {
                    return;
                }

                modGlobal.gv_sql = "Insert into  tbl_setup_IndicatorSet (IndicatorSetID, IndicatorSetDesc, State, RecordStatus) ";
                modGlobal.gv_sql = string.Format("{0} Values ({1},'{2}',", modGlobal.gv_sql, NewIndSID, NewSet);
                if (string.IsNullOrEmpty(modGlobal.gv_State))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " null, ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} '{1}',", modGlobal.gv_sql, modGlobal.gv_State);
                }
                if (string.IsNullOrEmpty(modGlobal.gv_status))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " null ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} '{1}'", modGlobal.gv_sql, modGlobal.gv_status);
                }
                modGlobal.gv_sql = modGlobal.gv_sql + ")";

                DALcop.ExecuteCommand(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql);

                RefreshIndicatorSet();
                cboIndicatorSet.Text = NewSet;

                //set the selected list item to the new one
                for (i = 0; i <= cboIndicatorSet.Items.Count - 1; i++)
                {
                    if (Support.GetItemData(cboIndicatorSet, i) == NewIndSID)
                    {
                        cboIndicatorSet.SelectedIndex = i;
                        break; // TODO: might not be correct. Was : Exit For
                    }
                }
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }
Exemple #16
0
        private void Form_CuentaCorrienteReport3_Load(object sender, EventArgs e)
        {
            if (fechaFin >= fechaInicio)
            {
                try
                {
                    if (checkExcel == true)
                    {
                        reports.rptLibroCajaCuentaCorrienteExcel _rptLibroCtaCorriente = new reports.rptLibroCajaCuentaCorrienteExcel();
                        //pase 07
                        _rptLibroCtaCorriente.DataSourceConnections[0].SetConnection(objCnx.server(), objCnx.database(), objCnx.user(), objCnx.password());

                        _rptLibroCtaCorriente.SetParameterValue("@MonedaID", monedaId);
                        _rptLibroCtaCorriente.SetParameterValue("@Desde", fechaInicio.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("@Hasta", fechaFin.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("@Detallado", 0);
                        _rptLibroCtaCorriente.SetParameterValue("@EmpresaID", empresaId);
                        _rptLibroCtaCorriente.SetParameterValue("@Ejercicio", periodoId);
                        //_rptLibroCtaCorriente.SetParameterValue("@EstablecimientoID", sucursalId);
                        _rptLibroCtaCorriente.SetParameterValue("@EstablecimientoID", empresaId);
                        _rptLibroCtaCorriente.SetParameterValue("name_report", "Libro Caja y Bancos(Mov Cta Corriente)");
                        _rptLibroCtaCorriente.SetParameterValue("date_range", fechaInicio.ToShortDateString() + " - " + fechaFin.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("currency", "Expresado en " + monedaNom);
                        _rptLibroCtaCorriente.SetParameterValue("empresa", empresa);
                        _rptLibroCtaCorriente.SetParameterValue("periodo", periodoId);
                        _rptLibroCtaCorriente.SetParameterValue("ruc", rucParam);
                        _rptLibroCtaCorriente.SetParameterValue("address", direccParam);
                        crvLibros.ReportSource = _rptLibroCtaCorriente;
                    }
                    else
                    {
                        String Mes = "";
                        Mes = MonthName(fechaInicio.Month).ToUpper();
                        reports.rptLibroCajaCuentaCorrientea3 _rptLibroCtaCorriente = new reports.rptLibroCajaCuentaCorrientea3();
                        //pase 08
                        _rptLibroCtaCorriente.DataSourceConnections[0].SetConnection(objCnx.server(), objCnx.database(), objCnx.user(), objCnx.password());

                        _rptLibroCtaCorriente.SetParameterValue("@MonedaID", monedaId);
                        _rptLibroCtaCorriente.SetParameterValue("@Desde", fechaInicio.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("@Hasta", fechaFin.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("@Detallado", 0);
                        _rptLibroCtaCorriente.SetParameterValue("@EmpresaID", empresaId);
                        _rptLibroCtaCorriente.SetParameterValue("@Ejercicio", periodoId);
                        //_rptLibroCtaCorriente.SetParameterValue("@EstablecimientoID", sucursalId);
                        _rptLibroCtaCorriente.SetParameterValue("@EstablecimientoID", empresaId);
                        _rptLibroCtaCorriente.SetParameterValue("name_report", "FORMATO 01.02 LIBRO CAJA Y BANCOS DETALLE DE LOS MOVIMIENTOS DE LA CUENTA CORRIENTE");
                        _rptLibroCtaCorriente.SetParameterValue("date_range", fechaInicio.ToShortDateString() + " - " + fechaFin.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("currency", "EXPRESADO EN " + monedaNom.ToUpper());
                        _rptLibroCtaCorriente.SetParameterValue("empresa", empresa.ToUpper());
                        _rptLibroCtaCorriente.SetParameterValue("periodo", "EJERCICIO: " + periodoId + " - " + Mes);
                        _rptLibroCtaCorriente.SetParameterValue("ruc", "RUC: " + rucParam);
                        _rptLibroCtaCorriente.SetParameterValue("address", direccParam.ToUpper());
                        _rptLibroCtaCorriente.SetParameterValue("Fecha", "FECHA:  " + DateTime.Now.ToShortDateString());
                        _rptLibroCtaCorriente.SetParameterValue("Hora", "HORA :  " + DateTime.Now.ToShortTimeString());


                        // _rptLibroCtaCorriente.PrintOptions.PaperSize("", 10, 10);
                        crvLibros.ReportSource = _rptLibroCtaCorriente;
                    }
                }
                catch
                {
                    RadMessageBox.Show("Ha ocurrido un error inesperado", "Error:", MessageBoxButtons.OK, RadMessageIcon.Error);
                }
            }
            else
            {
                RadMessageBox.Show("El rango de fechas es incorrecto", "Error:", MessageBoxButtons.OK, RadMessageIcon.Error);
            }
        }
Exemple #17
0
        public void RefreshIndicatorSet()
        {
            string setDesc         = null;
            var    LIndex          = 0;
            var    Table_ListIndex = 0;

            try
            {
                modGlobal.gv_sql = "Select * from tbl_setup_IndicatorSet ";
                if (string.IsNullOrEmpty(modGlobal.gv_State))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " Where (State = '' or State is null) ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} Where State = '{1}'", modGlobal.gv_sql, modGlobal.gv_State);
                }
                if (string.IsNullOrEmpty(modGlobal.gv_status))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " and (RecordStatus = '' or RecordStatus is null) ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} and RecordStatus = '{1}'", modGlobal.gv_sql, modGlobal.gv_status);
                }
                modGlobal.gv_sql = modGlobal.gv_sql + " order by IndicatorsetDesc ";

                //LDW modGlobal.gv_rs = modGlobal.gv_cn.OpenResultset(modGlobal.gv_sql, RDO.ResultsetTypeConstants.rdOpenStatic);
                const string sqlTableName2 = "tbl_setup_Indicator";
                modGlobal.gv_rs = DALcop.DalConnectDataSet(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql, sqlTableName2, modGlobal.gv_rs);

                cboIndicatorSet.Items.Clear();
                Table_ListIndex = -1;
                LIndex          = -1;
                //LDW while (!modGlobal.gv_rs.EOF)
                foreach (DataRow myRow2 in modGlobal.gv_rs.Tables[sqlTableName2].Rows)
                {
                    LIndex          = LIndex + 1;
                    Table_ListIndex = LIndex;
                    if (Information.IsDBNull(myRow2.Field <string>("EffDate")))
                    {
                        setDesc = myRow2.Field <string>("IndicatorSetDesc");
                    }
                    else
                    {
                        setDesc = string.Format("{0} ({1})", myRow2.Field <string>("IndicatorSetDesc"), myRow2.Field <string>("EffDate"));
                    }
                    cboIndicatorSet.Items.Add(new ListBoxItem(setDesc, myRow2.Field <int>("IndicatorSetID")).ToString());
                    //LDW modGlobal.gv_rs.MoveNext();
                }
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }
Exemple #18
0
        public List <GClass16> method_4()
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GClass15.Class15 class15 = new GClass15.Class15();
            // ISSUE: reference to a compiler-generated field
            class15.gclass15_0 = this;
            // ISSUE: reference to a compiler-generated field
            class15.list_0 = new List <GClass16>();
            int num;
            // ISSUE: reference to a compiler-generated method
            FrmWait frmWait = new FrmWait("USB Helper is preparing your mods...", new Action(class15.method_0), (Action <Exception>)(exception_0 => num = (int)RadMessageBox.Show(exception_0.Message)));

            // ISSUE: reference to a compiler-generated field
            return(class15.list_0);
        }
 private void DisplayMessage(string message)
 {
     RadMessageBox.Show(this, message, "Warning", MessageBoxButtons.OK, RadMessageIcon.Exclamation,
                        MessageBoxDefaultButton.Button1);
 }
Exemple #20
0
        public List <string> method_0(string string_0)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GClass15.Class13 class13 = new GClass15.Class13();
            string_0 = string_0.ToUpper();
            // ISSUE: reference to a compiler-generated field
            class13.gclass14_0 = this.method_2(string_0);
            List <string> stringList = new List <string>();

            // ISSUE: reference to a compiler-generated field
            if (this.method_3(string_0) || class13.gclass14_0 == null)
            {
                return(stringList);
            }
            foreach (string installedMod in this.InstalledMods)
            {
                GClass14 gclass14 = this.method_2(installedMod);
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (gclass14 != null && ((IEnumerable <string>)gclass14.Files).Any <string>(class13.func_0 ?? (class13.func_0 = new Func <string, bool>(class13.method_0))))
                {
                    int num = (int)RadMessageBox.Show(string.Format("You cannot add the mod {0} since it conflicts with {1}.", (object)string_0, (object)installedMod));
                    return(stringList);
                }
            }
            // ISSUE: reference to a compiler-generated field
            foreach (string recommendedMod in class13.gclass14_0.RecommendedMods)
            {
                if (this.method_2(recommendedMod) != null && !this.method_3(recommendedMod) && RadMessageBox.Show(string.Format("It is recommended that you also add the mod {0}. Should I add it for you?", (object)recommendedMod), "Add mode", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    stringList.Add(recommendedMod);
                    stringList.AddRange((IEnumerable <string>) this.method_0(recommendedMod));
                }
            }
            // ISSUE: reference to a compiler-generated field
            foreach (string requiredMod in class13.gclass14_0.RequiredMods)
            {
                if (this.method_2(requiredMod) != null && !this.method_3(requiredMod))
                {
                    int num = (int)RadMessageBox.Show(string.Format("The mod additional mod {0} is required. It will be enabled automatically.", (object)requiredMod));
                    stringList.Add(requiredMod);
                    stringList.AddRange((IEnumerable <string>) this.method_0(requiredMod));
                }
            }
            stringList.Add(string_0);
            this.method_8(string_0);
            this.method_6();
            return(stringList);
        }
Exemple #21
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            oCHumano = new WCF_CHumano.Hersan_CHumanoClient();
            DataTable oData = new DataTable("Datos");

            try {
                oData.Columns.Add("Id");
                oData.Columns.Add("Concepto");
                oData.Columns.Add("Tipo");
                oData.Columns.Add("Estatus");

                PerfilesBE obj = new PerfilesBE();
                oList.ForEach(item => {
                    obj.Id = int.Parse(txtId.Text);
                    obj.Puesto.Departamentos.Id = int.Parse(cboDepto.SelectedValue.ToString());
                    obj.Puesto.Id   = int.Parse(cboPuestos.SelectedValue.ToString());
                    obj.Experiencia = cboExperiencia.Text;
                    obj.DatosUsuario.IdUsuarioCreo = BaseWinBP.UsuarioLogueado.ID;

                    #region Carga Detalle
                    DataRow oRow = oData.NewRow();
                    if (item.Grupo.Contains("EDUCACIÓN"))
                    {
                        oRow["Id"]       = item.Id;
                        oRow["Concepto"] = "EDUCACIÓN";
                        oRow["Tipo"]     = item.Tipo;
                        oRow["Estatus"]  = item.DatosUsuario.Estatus;
                    }
                    if (item.Grupo.Contains("FUNCIONES"))
                    {
                        oRow["Id"]       = item.Id;
                        oRow["Concepto"] = "FUNCIONES";
                        oRow["Tipo"]     = string.Empty;
                        oRow["Estatus"]  = item.DatosUsuario.Estatus;
                    }
                    if (item.Grupo.Contains("COMPETENCIAS"))
                    {
                        oRow["Id"]       = item.Id;
                        oRow["Concepto"] = "COMPETENCIAS";
                        oRow["Tipo"]     = string.Empty;
                        oRow["Estatus"]  = item.DatosUsuario.Estatus;
                    }
                    oData.Rows.Add(oRow);
                    #endregion
                });

                /* ALTA DE PERFIL */
                if (int.Parse(txtId.Text) == 0)
                {
                    int Result = oCHumano.CHU_Perfiles_Guardar(obj, oData);
                    if (Result != 0)
                    {
                        RadMessageBox.Show("Perfil guardado correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                    }
                    else
                    {
                        RadMessageBox.Show("Ocurrió un error al guardar el perfil", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                }
                else
                {
                    int Result = oCHumano.CHU_Perfiles_Actualiza(obj, oData);
                    if (Result != 0)
                    {
                        RadMessageBox.Show("Perfil actualizado correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                    }
                    else
                    {
                        RadMessageBox.Show("Ocurrió un error al actualizar el perfil", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                    }
                }
                LimpiarCampos();
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrió un error al guardar el perfil\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            } finally {
                oCHumano = null;
            }
        }
Exemple #22
0
 private void radButton2_Click(object sender, EventArgs e)
 {
     set_config();
     RadMessageBox.Show("Saved configuration!");
 }
Exemple #23
0
 public bool method_16(string string_7, bool bool_6, bool bool_7 = false, IEnumerable <GClass12> ienumerable_0 = null, bool bool_8 = false)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     GClass30.Class49 class49 = new GClass30.Class49();
     // ISSUE: reference to a compiler-generated field
     class49.bool_0      = false;
     GClass28.gclass30_0 = this;
     if (bool_6)
     {
         string_7 = Path.Combine(string_7, this.method_12());
     }
     if (this.System == GEnum3.const_1)
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         GClass30.Class50 class50 = new GClass30.Class50();
         // ISSUE: reference to a compiler-generated field
         class50.class49_0 = class49;
         try
         {
             DriveInfo driveInfo          = new DriveInfo(Path.GetPathRoot(string_7));
             long      availableFreeSpace = driveInfo.AvailableFreeSpace;
             DataSize  size       = this.Size;
             long      totalBytes = (long)size.TotalBytes;
             if ((ulong)availableFreeSpace < (ulong)totalBytes)
             {
                 string format = "There isn't enough space left of {0}. Please free {1}.";
                 string name   = driveInfo.Name;
                 size = this.Size;
                 // ISSUE: variable of a boxed type
                 __Boxed <DataSize> local = (ValueType) new DataSize(size.TotalBytes - (ulong)driveInfo.AvailableFreeSpace);
                 int num = (int)RadMessageBox.Show(string.Format(format, (object)name, (object)local));
                 return(false);
             }
         }
         catch
         {
         }
         Directory.CreateDirectory(string_7);
         if (this.Boolean_0)
         {
             int num = (int)RadMessageBox.Show("Injectable titles cannot be unpacked");
             return(false);
         }
         // ISSUE: reference to a compiler-generated field
         class50.frmUnpackAnimation_0 = new frmUnpackAnimation(this);
         Class9 class9 = new Class9(this);
         // ISSUE: reference to a compiler-generated method
         class9.Event_1 += new EventHandler <GStruct0>(class50.method_0);
         // ISSUE: reference to a compiler-generated field
         class50.bool_0 = false;
         // ISSUE: reference to a compiler-generated method
         class9.Event_0 += new EventHandler <bool>(class50.method_1);
         // ISSUE: reference to a compiler-generated method
         class9.Event_2 += new EventHandler <Exception>(class50.method_2);
         if (ienumerable_0 != null)
         {
             class9.method_1(string_7, bool_7, ienumerable_0.ToList <GClass12>(), bool_8);
         }
         else
         {
             class9.method_1(string_7, bool_7, (List <GClass12>)null, bool_8);
         }
         // ISSUE: reference to a compiler-generated field
         if (!class50.bool_0)
         {
             // ISSUE: reference to a compiler-generated field
             int num1 = (int)class50.frmUnpackAnimation_0.ShowDialog();
         }
         try
         {
             if (this is GClass32 & bool_6)
             {
                 if (!string_7.Contains("EMULATORS"))
                 {
                     string path = Path.Combine(string_7, "meta", "meta.xml");
                     if (File.Exists(path))
                     {
                         XmlDocument xmlDocument = new XmlDocument();
                         xmlDocument.LoadXml(File.ReadAllText(path));
                         string innerText = xmlDocument.GetElementsByTagName("company_code")[0].InnerText;
                         string name      = new DirectoryInfo(string_7).Name;
                         string newName   = name.Substring(0, name.IndexOf("[")) + "[" + ((GClass32)this).ProductId + innerText.Substring(2) + "]";
                         FileSystem.RenameDirectory(string_7, newName);
                     }
                 }
             }
         }
         catch
         {
         }
     }
     else if (this.System == GEnum3.const_0)
     {
         GClass28.gclass30_0 = (GClass30)null;
         return(false);
     }
     GClass28.gclass30_0 = (GClass30)null;
     // ISSUE: reference to a compiler-generated field
     return(class49.bool_0);
 }
Exemple #24
0
        public ProfileForm(Profile profile, ApplicationContext appContext)
        {
            _applicationContext = appContext;
            CurrentProfile      = profile;
            InitializeComponent();
            LoadLocalization();
            if (CurrentProfile.AllowedReleaseTypes != null)
            {
                foreach (string item in CurrentProfile.AllowedReleaseTypes)
                {
                    switch (item)
                    {
                    case "snapshot":
                        snapshotsCheckBox.Checked = true;
                        break;

                    case "old_beta":
                        betaCheckBox.Checked = true;
                        break;

                    case "old_alpha":
                        alphaCheckBox.Checked = true;
                        break;

                    case "other":
                        otherCheckBox.Checked = true;
                        break;

                    case "forge":
                        forgeCheckBox.Checked = true;
                        goto case "modified";

                    case "liteloader":
                        liteCheckBox.Checked = true;
                        goto case "modified";

                    case "optifine":
                        optifineCheckBox.Checked = true;
                        goto case "modified";

                    case "combined":
                        combinedCheckBox.Checked = true;
                        goto case "modified";

                    case "modified":
                        VersionSelector.SelectedPage = modVersionsPage;
                        break;

                    default:
                        throw new ArgumentOutOfRangeException(nameof(item), item, null);
                    }
                }
            }
            GetVersions();
            nameBox.Text = CurrentProfile.ProfileName;
            if (CurrentProfile.WorkingDirectory != null)
            {
                GameDirectoryCheckBox.Checked = true;
                gameDirectoryBox.Text         = CurrentProfile.WorkingDirectory;
            }
            else
            {
                gameDirectoryBox.Text = _applicationContext.McDirectory;
            }
            if (CurrentProfile.WindowInfo != null)
            {
                xResolutionBox.Text = CurrentProfile.WindowInfo.X.ToString();
                yResolutionBox.Text = CurrentProfile.WindowInfo.Y.ToString();
            }
            if (CurrentProfile.FastConnectionSettigs != null)
            {
                FastConnectCheckBox.Checked = true;
                ipTextBox.Text   = CurrentProfile.FastConnectionSettigs.ServerIp;
                portTextBox.Text = CurrentProfile.FastConnectionSettigs.ServerPort.ToString();
            }
            switch (CurrentProfile.LauncherVisibilityOnGameClose)
            {
            case Profile.LauncherVisibility.HIDDEN:
                stateBox.SelectedIndex = 1;
                break;

            case Profile.LauncherVisibility.CLOSED:
                stateBox.SelectedIndex = 2;
                break;

            default:
                stateBox.SelectedIndex = 0;
                break;
            }
            if (Java.JavaExecutable == @"\bin\java.exe")
            {
                RadMessageBox.Show(this, _applicationContext.ProgramLocalization.JavaDetectionFailed,
                                   _applicationContext.ProgramLocalization.Error, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
            javaExecutableBox.Text         = CurrentProfile.JavaExecutable ?? Java.JavaExecutable;
            JavaExecutableCheckBox.Checked = javaExecutableBox.Text != Java.JavaExecutable;
            javaArgumentsBox.Text          = CurrentProfile.JavaArguments ?? "-Xmx1G";
            JavaArgumentsCheckBox.Checked  = javaArgumentsBox.Text != "-Xmx1G";
        }
Exemple #25
0
        private void btnGuardar_Click_1(object sender, EventArgs e)
        {
            oCHumano = new WCF_CHumano.Hersan_CHumanoClient();
            HorariosBE obj = new HorariosBE();

            try
            {
                if (!ValidarCampos())
                {
                    RadMessageBox.Show("Debe capturar todos los datos para continuar", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    return;
                }
                if (oList.FindAll(item => item.Nombre.Trim() == txtNombre.Text.Trim()).Count > 0 && int.Parse(txtId.Text) == 0)

                {
                    RadMessageBox.Show("El Horario capturado ya existe, no es posible guardar", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                    LimpiarCampos();
                    return;
                }

                if (RadMessageBox.Show("Desea guardar los datos capturados...?", this.Text, MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
                {
                    obj.Id                   = int.Parse(txtId.Text);
                    obj.Nombre               = txtNombre.Text;
                    obj.HoraEnt              = radHoraEnt.Value.Value.TimeOfDay.ToString();
                    obj.HoraSalida           = radHoraSal.Value.Value.TimeOfDay.ToString();
                    obj.HorSalComida         = radHorSalComida.Value.Value.TimeOfDay.ToString();
                    obj.HorEntComida         = radHorEntComida.Value.Value.TimeOfDay.ToString();
                    obj.Tolerancia           = int.Parse(txttolerancia.Text);
                    obj.DatosUsuario.Estatus = chkstatus.Checked;
                    //obj.DatosUsuario.IdUsuarioCreo = BaseWinBP.UsuarioLogueado.ID;
                    obj.DatosUsuario.IdUsuarioCreo = 1;

                    //PROCESO DE GUARDADO Y ACTUALIZACION
                    if (txtId.Text == "-1")
                    {
                        int Result = oCHumano.ABCHorarios_Guarda(obj);
                        if (Result == 0)
                        {
                            RadMessageBox.Show("Ocurrió un error al guardar el Horario", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                        }
                        else
                        {
                            RadMessageBox.Show("Horario guardado correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                            LimpiarCampos();
                            CargarDatos();
                        }
                    }
                    else
                    {
                        int Result = oCHumano.ABCHorarios_Actualizar(obj);
                        if (Result == 0)
                        {
                            RadMessageBox.Show("Ocurrió un error al actualizar los datos", this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                        }
                        else
                        {
                            RadMessageBox.Show("Información actualizada correctamente", this.Text, MessageBoxButtons.OK, RadMessageIcon.Info);
                            LimpiarCampos();
                            CargarDatos();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                RadMessageBox.Show("Ocurrió un error al actualizar la información\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
            }
            finally
            {
                oCHumano = null;
            }
        }
Exemple #26
0
        public void RefreshIndicator()
        {
            string JCAHOID         = null;
            var    LIndex          = 0;
            var    Table_ListIndex = 0;

            try
            {
                //retrieve the list of Indicators
                modGlobal.gv_sql = "Select * from tbl_setup_Indicator ";
                if (string.IsNullOrEmpty(modGlobal.gv_State))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " Where (State = '' or State is null) ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} Where State = '{1}'", modGlobal.gv_sql, modGlobal.gv_State);
                }
                if (string.IsNullOrEmpty(modGlobal.gv_status))
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " and (RecordStatus = '' or RecordStatus is null) ";
                }
                else
                {
                    modGlobal.gv_sql = string.Format("{0} and RecordStatus = '{1}'", modGlobal.gv_sql, modGlobal.gv_status);
                }
                modGlobal.gv_sql = modGlobal.gv_sql + " order by Description ";

                //LDW modGlobal.gv_rs = modGlobal.gv_cn.OpenResultset(modGlobal.gv_sql, RDO.ResultsetTypeConstants.rdOpenStatic);
                const string sqlTableName3 = "tbl_setup_Indicator";
                modGlobal.gv_rs = DALcop.DalConnectDataSet(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql, sqlTableName3, modGlobal.gv_rs);

                lstIndicators.Items.Clear();
                Table_ListIndex = -1;
                LIndex          = -1;
                //LDW while (!modGlobal.gv_rs.EOF)
                foreach (DataRow myRow3 in modGlobal.gv_rs.Tables[sqlTableName3].Rows)
                {
                    LIndex          = LIndex + 1;
                    Table_ListIndex = LIndex;
                    JCAHOID         = "";
                    if (!Information.IsDBNull(myRow3.Field <int>("JCAHOID")))
                    {
                        JCAHOID = myRow3.Field <int>("JCAHOID") + " - ";
                    }
                    if (Information.IsDBNull(myRow3.Field <string>("lastupdatedate")))
                    {
                        lstIndicators.Items.Add(JCAHOID + myRow3.Field <string>("Description"));
                    }
                    else
                    {
                        lstIndicators.Items.Add(string.Format("{0}{1} ({2})", JCAHOID, myRow3.Field <string>("Description"), myRow3.Field <string>("lastupdatedate")));
                    }

                    Support.SetItemData(lstIndicators, lstIndicators.Items.Count - 1, myRow3.Field <int>("IndicatorID"));
                    //LDW modGlobal.gv_rs.MoveNext();
                }
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }
 private void ButtonSaveComments_Click(object sender, EventArgs e)
 {
     Comments = textboxComments.Text;
     RadMessageBox.Show("Magnetic Separation comments saved.");
 }
Exemple #28
0
        public void RefreshIndicatorDep()
        {
            string IndDesc         = null;
            var    LIndex          = 0;
            var    Table_ListIndex = 0;

            try
            {
                modGlobal.gv_sql = "Select tbl_setup_Indicator.Description, tbl_setup_IndicatorDep.* ";
                modGlobal.gv_sql = modGlobal.gv_sql + " from tbl_setup_Indicator, tbl_setup_IndicatorDep ";
                modGlobal.gv_sql = modGlobal.gv_sql + " Where ";
                modGlobal.gv_sql = modGlobal.gv_sql + " tbl_setup_Indicator.IndicatorID = tbl_setup_IndicatorDep.IndicatorID ";
                if (lstIndicators.SelectedIndex > -1)
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " and tbl_setup_IndicatorDep.IndicatorParentID = " +
                                       Support.GetItemData(lstIndicators, lstIndicators.SelectedIndex);
                }
                else
                {
                    modGlobal.gv_sql = modGlobal.gv_sql + " and tbl_setup_IndicatorDep.IndicatorParentID = -1 ";
                }
                modGlobal.gv_sql = modGlobal.gv_sql + " order by tbl_setup_Indicator.Description ";
                //LDW modGlobal.gv_rs = modGlobal.gv_cn.OpenResultset(modGlobal.gv_sql, RDO.ResultsetTypeConstants.rdOpenStatic);
                const string sqlTableName1 = "tbl_setup_Indicator";
                modGlobal.gv_rs = DALcop.DalConnectDataSet(modGlobal.gv_cn.ConnectionString, modGlobal.gv_sql, sqlTableName1, modGlobal.gv_rs);

                lstRequiredIndicator.Items.Clear();
                Table_ListIndex = -1;
                LIndex          = -1;

                //LDW while (!modGlobal.gv_rs.EOF)
                foreach (DataRow myRow1 in modGlobal.gv_rs.Tables[sqlTableName1].Rows)
                {
                    LIndex          = LIndex + 1;
                    Table_ListIndex = LIndex;

                    if (Information.IsDBNull(myRow1.Field <string>("EffDate")))
                    {
                        IndDesc = myRow1.Field <string>("Description");
                    }
                    else
                    {
                        IndDesc = string.Format("{0} (Eff. as of: {1})", myRow1.Field <string>("Description"), myRow1.Field <string>("EffDate"));
                    }
                    lstRequiredIndicator.Items.Add(new ListBoxItem(IndDesc, myRow1.Field <int>("IndicatorDepID")).ToString());
                    //LDW modGlobal.gv_rs.MoveNext();
                }
            }
            catch (Exception ex)
            {
                const string errorMessage = "Oops...Something went wrong... ";

                // Create an EventLog instance and assign its source.
                EventLog appLog = new EventLog();
                appLog.Source = "CopSetup";

                appLog.WriteEntry(errorMessage + "Source: " + ex.Source + "=>" + "TargetSite: " + ex.TargetSite + "Exception #: " + ex.HResult + " => " + "Error Message: " +
                                  ex.Message + " => " + "Inner Exception: " + ex.InnerException + " => " + "Stack Trace: " + ex.StackTrace, EventLogEntryType.Error, 1002);

                RadMessageBox.Show(errorMessage + String.Format(format: "Exception: {0}  => Inner Exception: {1}", arg0: ex.Message, arg1: ex.InnerException));
            }
        }
Exemple #29
0
        private void cmdtinhluong_Click(object sender, EventArgs e)
        {
            if ((txtngaycongchuan.Text == "") || (txttileluong.Text == ""))
            {
                DialogResult rs = RadMessageBox.Show("\nBạn chưa nhập số ngày làm việc trong tháng và tỉ lệ lương.\nMở Form Tỉ lệ lương để nhập vào ?\n", "Thông báo", MessageBoxButtons.YesNo, RadMessageIcon.Question);
                if (rs == DialogResult.Yes)
                {
                    frmbangtileluong f = new frmbangtileluong();
                    f.MdiParent = this.MdiParent;
                    f.Show();
                    this.Close();
                }
            }

            else
            {
                //kiểm tra chấm công hết chưa
                bool bchamcong = false;
                for (int i = 0; i < dgv_bangluong.Rows.Count - 1; i++)
                {
                    //DataGridViewRow dgvrow = dgv_bangluong.Rows[i];
                    if (dgv_bangluong.Rows[i].Cells["mahieuqua"].Value.ToString() == "")
                    {
                        bchamcong = true;
                    }
                }
                if (bchamcong)
                {
                    RadMessageBox.Show("\nChưa chấm công xong !\n", "Thông Báo");
                }
                else
                //tính lương
                {
                    for (int i = 0; i < dgv_bangluong.Rows.Count - 1; i++)
                    {
                        cluong.tinhluong(thangkt, namkt, dgv_bangluong.Rows[i].Cells["manv"].Value.ToString(),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["luongcoban"].Value.ToString()),
                                         double.Parse(dgv_bangluong.Rows[i].Cells["tilehq"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["songaylv"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["sogiotangca"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["sogiotangcacn"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["songaynghiphep"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["songaynghingungviec"].Value.ToString()),
                                         double.Parse(dgv_bangluong.Rows[i].Cells["tileccvasinhhoat"].Value.ToString()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["phucapcv"].Value.ToString()),
                                         int.Parse(txtngaycongchuan.Text.Trim()),
                                         TileTB(double.Parse(txttileluong.Text.Trim()),
                                                dgv_bangluong.Rows.Count - 1,
                                                LaySNTheoLoai(), chieuqua.tilehq()),
                                         int.Parse(dgv_bangluong.Rows[i].Cells["phucapkhac"].Value.ToString()));
                    }
                    if (cboTo.Text != "")
                    {
                        //đưa dữ liệu vào datagirdview
                        HienThiTTGird(thangkt, namkt, cboPhong.SelectedValue.ToString(), cboTo.SelectedValue.ToString());
                    }
                    else
                    {
                        //đưa dữ liệu vào datagirdview
                        HienThiTTGird(thangkt, namkt, cboPhong.SelectedValue.ToString());
                    }
                    lamrong();
                }
            }
        }
Exemple #30
0
        private void SaveNewItem()
        {
            short  StatusID = 4;
            string iLogID   = string.Empty;
            string mobil    = string.Empty
            , sopir         = string.Empty
            , keterangan    = null;
            int kernetid    = -1
            , sopirid       = -1
            , mobilid       = -1
            , kotaid        = -1
            , salesid       = -1
            , custid        = -1
            , custtypeid    = -1
            , transtypeid   = -1;
            int paid        = 0;

            transtypeid = int.Parse(rddTipe.SelectedValue.ToString());
            kotaid      = int.Parse(rddTujuan.SelectedValue.ToString());
            salesid     = int.Parse(rddSales.SelectedValue.ToString());

            if (chkAntar.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            {
                sopirid  = int.Parse(rddSopir.SelectedValue.ToString());
                mobilid  = int.Parse(rddMobil.SelectedValue.ToString());
                kernetid = int.Parse(rddKernet.SelectedValue.ToString());
            }
            else
            {
                sopir = txtSopir.Text;
                mobil = txtMobil.Text;
            }

            switch (rddTipe.Text.ToLower())
            {
            case "pelanggan":
            case "staff":
            case "pegawai":
            case "satpam":
                custid     = int.Parse(rddPel.SelectedValue.ToString());
                custtypeid = int.Parse(rddPel.Tag.ToString());
                break;

            case "sales":
                custid     = int.Parse(rddSales.SelectedValue.ToString());
                custtypeid = int.Parse(rddPel.Tag.ToString());
                break;

            case "contoh":
                break;
            }
            using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter())
            {
                //Always Create with status created
                iLogID = tbl.pInsertLogProd(tanggalDateTimePicker.Value
                                            , 0
                                            , kernetid
                                            , sopirid
                                            , mobilid
                                            , kotaid
                                            , salesid
                                            , mobil
                                            , sopir
                                            , keterangan
                                            , custid
                                            , custtypeid
                                            , transtypeid
                                            , NBConfig.ValidUserName
                                            , StatusID, paid, 0).ToString();
            }

            foreach (GridViewRowInfo item in radGridView1.Rows)
            {
                using (sinarekDataSetTableAdapters.logdetailTableAdapter tbl = new sinarekDataSetTableAdapters.logdetailTableAdapter())
                {
                    tbl.pInsertLogDetail(int.Parse(iLogID)
                                         , int.Parse(item.Cells["productid"].Value.ToString())
                                         , decimal.Parse(item.Cells["quantity"].Value.ToString())
                                         , int.Parse(item.Cells["custtypetoid"].Value.ToString())
                                         , int.Parse(item.Cells["custtypeid"].Value.ToString())
                                         , int.Parse(item.Cells["status"].Value.ToString())
                                         , item.Cells["keterangan"].Value.ToString()
                                         , NBConfig.ValidUserName);
                }
            }

            RadMessageBox.Show("Data sudah terinput.", "SMS");

            //Print
            DialogResult res = RadMessageBox.Show("Siapkan kertas untuk print.", "SMS - Verification"
                                                  , MessageBoxButtons.OKCancel
                                                  , RadMessageIcon.Question
                                                  , MessageBoxDefaultButton.Button1);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                PrinterSettings printerSettings;
                ReportProcessor reportProcessor;

                rptSJ rpt = new rptSJ();
                rpt.ReportParameters["user"].Value  = NBConfig.ValidUserName;
                rpt.ReportParameters["logid"].Value = iLogID;
                //rpt.ReportParameters["custtypetoid"].Value = rddTipe.SelectedValue;

                IReportDocument iRpt = (IReportDocument)rpt;
                //// PrinterSettings
                printerSettings = new PrinterSettings();
                //// Adjust the printer settings if necessary...
                InstanceReportSource reportSource = new InstanceReportSource();
                reportSource.ReportDocument = iRpt;
                // Print the report using the printer settings.
                reportProcessor = new ReportProcessor();
                reportProcessor.PrintReport(reportSource, printerSettings);

                using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter())
                {
                    tbl.UpdatePrinted(NBConfig.ValidUserName, long.Parse(iLogID));
                }
                helper.PrintLog(this.GetType().Name, rpt.Name, this.Text + ":LogID-" + iLogID);
            }
            else
            {
                MessageBox.Show("Surat Jalan ini dapat dilihat di daftar surat jalan yg belum di print.");
            }
        }