Beispiel #1
0
 private void itemChuyenBan_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (gvBan.GetFocusedRowCellValue("ID") == null)
         {
             XtraMessageBox.Show("Hãy chọn [Bàn] cần chuyển.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         if (gvBan.GetFocusedRowCellValue("HDID") == null)
         {
             XtraMessageBox.Show("Bàn đang trống, không thể thực hiện chức năng này.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         XtraInputBoxArgs args = new XtraInputBoxArgs();
         // set required Input Box options
         args.Caption            = "CHUYỂN BÀN";
         args.Prompt             = "Chọn bàn chuyển tới";
         args.DefaultButtonIndex = 0;
         //
         LookUpEdit lookBan = new LookUpEdit();
         lookBan.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Name", "Tên bàn", 300));
         lookBan.Properties.ShowFooter    = lookBan.Properties.ShowHeader = lookBan.Properties.ShowLines = false;
         lookBan.Properties.DataSource    = db.BANs.Select(p => new { Name = p.Name + p.Number, p.ID });
         lookBan.Properties.DisplayMember = "Name";
         lookBan.Properties.ValueMember   = "ID";
         //
         args.Editor          = lookBan;
         args.DefaultResponse = (int)gvBan.GetFocusedRowCellValue("ID");
         var result = XtraInputBox.Show(args).ToString();
         db.Update_HD2((int)gvBan.GetFocusedRowCellValue("HDID"), int.Parse(result.ToString()), (int)gvBan.GetFocusedRowCellValue("ID"));
         LoadData();
     }
     catch { }
 }
        private async void Sb_Update_Click(object sender, EventArgs e)
        {
            try
            {
                if (Gv_Categories.FocusedRowHandle < 0)
                {
                    return;
                }
                var id           = Gv_Categories.GetFocusedRowCellValue("Id").ToString();
                var categoryName = Gv_Categories.GetFocusedRowCellDisplayText("CategoryName");
                var result       = XtraInputBox.Show(this, "请输入", "修改书籍类别信息", categoryName, MessageBoxButtons.YesNo);
                if (string.IsNullOrEmpty(result))
                {
                    return;
                }
                var resultMessage = await _propertiesApi.UpdateCategory(id, result);

                if (resultMessage.ResultCode != 1)
                {
                    PopupProvider.Warning(resultMessage.ResultMessage);
                    return;
                }

                PopupProvider.Success(resultMessage.ResultMessage);
            }
            catch (Exception exception)
            {
                PopupProvider.Error("修改异常!", exception);
            }
        }
Beispiel #3
0
        public void Fechas()
        {
            XtraInputBoxArgs args = new XtraInputBoxArgs();

            // set required Input Box options
            args.Caption            = "Fecha";
            args.Prompt             = "Seleccione Fecha";
            args.DefaultButtonIndex = 0;
            //args.Showing += Args_Showing;
            // initialize a DateEdit editor with custom settings
            DateEdit editor = new DateEdit();

            editor.Properties.CalendarView  = DevExpress.XtraEditors.Repository.CalendarView.TouchUI;
            editor.Properties.Mask.EditMask = "MMMM d, yyyy";
            args.Editor = editor;
            // a default DateEdit value
            args.DefaultResponse = DateTime.Now.Date.AddDays(3);
            // display an Input Box with the custom editor
            try
            {
                var result = XtraInputBox.Show(args).ToString();
                //gCVenta.DataSource = facturas.Where(x => x.Fecha.Value.ToString("MM/dd/yyyy") == Convert.ToDateTime(result).ToString("MM/dd/yyyy"));
            }
            catch (Exception) { }
        }
Beispiel #4
0
        private void btnAddChapter_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var book = treeList.GetDataRecordByNode(treeList.FocusedNode) as IbeTreeItem;

            if (book.Type == IbeTreeItemType.Book)
            {
                var response = XtraInputBox.Show("Type chapter number (arabic):", "Add chapter", "", MessageBoxButtons.OKCancel);
                if (response.IsNotNullOrEmpty())
                {
                    var item = new IbeChapterTreeItem()
                    {
                        Text     = response,
                        ParentID = book.ID,
                        ID       = $"{Guid.NewGuid()}",
                        IsNew    = true,
                        Tag      = -1,
                        Number   = response.ToInt(),
                    };
                    TreeItems.Add(item);
                    treeList.RefreshDataSource();

                    treeList.FocusedNode.Expand();
                    treeList.FocusedNode = treeList.FindNodeByKeyID(item.ID);
                }
            }
        }
Beispiel #5
0
        private void btnAddVerse_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var chapter = treeList.GetDataRecordByNode(treeList.FocusedNode) as IbeTreeItem;

            if (chapter.Type == IbeTreeItemType.Chapter)
            {
                var response = XtraInputBox.Show("Type verse number (arabic):", "Add verse", "", MessageBoxButtons.OKCancel);
                if (response.IsNotNullOrEmpty())
                {
                    var item = new IbeVerseTreeItem()
                    {
                        Text             = response,
                        ParentID         = chapter.ID,
                        ID               = $"{Guid.NewGuid()}",
                        IsNew            = true,
                        Tag              = -1,
                        Value            = String.Empty,
                        Number           = response.ToInt(),
                        StartFromNewLine = false
                    };
                    TreeItems.Add(item);
                    treeList.RefreshDataSource();

                    treeList.FocusedNode.Expand();
                    treeList.FocusedNode = treeList.FindNodeByKeyID(item.ID);
                }
            }
        }
Beispiel #6
0
        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            var result = XtraInputBox.Show("ระบุเลขที่ LOTNO ที่ต้องการค้นหา", "ค้นหาข้อมูล", null);

            Console.WriteLine(result);
            try
            {
                SplashScreenManager.ShowDefaultWaitForm();
                if (result != null)
                {
                    if (result.ToString() != "")
                    {
                        List <OrderData> obj = new OrderControllers().GetLotNoData(result.ToString());
                        if (obj.Count > 0)
                        {
                            gridControl.DataSource  = obj;
                            bsiRecordsCount.Caption = "RECORDS : " + obj.Count;
                        }
                        else
                        {
                            XtraMessageBox.Show("ไม่พบข้อมูลที่ต้องการค้นหา");
                        }
                    }
                }
                SplashScreenManager.CloseDefaultWaitForm();
            }
            catch (Exception ex)
            {
                new GreeterFunction().CreateLogSearch(result.ToString());
                XtraMessageBox.Show("ไม่พบข้อมูลที่ต้องการค้นหา");
            }
        }
Beispiel #7
0
        private void btnAddVerses_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var chapter = treeList.GetDataRecordByNode(treeList.FocusedNode) as IbeTreeItem;

            if (chapter.Type == IbeTreeItemType.Chapter)
            {
                var response = XtraInputBox.Show("Type verse count:", "Add verses", "1", MessageBoxButtons.OKCancel);
                if (response.IsNotNullOrEmpty())
                {
                    for (int i = 1; i < response.ToInt() + 1; i++)
                    {
                        var item = new IbeVerseTreeItem()
                        {
                            Text             = i.ToString(),
                            ParentID         = chapter.ID,
                            ID               = $"{Guid.NewGuid()}",
                            IsNew            = true,
                            Tag              = -1,
                            Value            = String.Empty,
                            Number           = i,
                            StartFromNewLine = false
                        };
                        TreeItems.Add(item);
                    }

                    (chapter as IbeChapterTreeItem).NumberOfVerses += response.ToInt();
                    txtChapterNumberOfVerses.Text = (chapter as IbeChapterTreeItem).NumberOfVerses.ToString();
                    chapter.Changed = true;

                    treeList.RefreshDataSource();
                    treeList.FocusedNode.Expand();
                }
            }
        }
Beispiel #8
0
        private string GetMessageBoxText(string caption, string label)
        {
            XtraInputBoxArgs args = new XtraInputBoxArgs(this, label, caption, string.Empty);
            var result            = XtraInputBox.Show(args);

            return((string)result);
        }
Beispiel #9
0
        private void btnPruebaCorreo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            XtraInputBoxArgs args = new XtraInputBoxArgs();

            // set required Input Box options
            args.Caption            = "Ingrese EMail Destino";
            args.Prompt             = "Direccion de Correo";
            args.DefaultButtonIndex = 0;
            //args.Showing += Args_Showing;
            // initialize a DateEdit editor with custom settings
            TextEdit editor = new TextEdit();

            args.Editor = editor;
            // a default DateEdit value
            args.DefaultResponse = "Correo Destino";
            // display an Input Box with the custom editor
            string result = string.Empty;

            result = XtraInputBox.Show(args).ToString();
            if (result != string.Empty)
            {
                CLS_Email Envio = new CLS_Email();
                Envio.EmailDestino = result;
                Envio.SendMailPrueba();
            }
        }
Beispiel #10
0
        private void TitleLabel_Click_1(object sender, EventArgs e)
        {
            XtraInputBoxArgs args = new XtraInputBoxArgs();

            args.Caption            = "Месяц табеля";
            args.Prompt             = "Табель за месяц";
            args.DefaultButtonIndex = 0;
            args.Showing           += Args_Showing;
            DateEdit editor = new DateEdit();

            editor.Properties.MaxValue      = DateTime.Now;
            editor.Properties.CalendarView  = DevExpress.XtraEditors.Repository.CalendarView.TouchUI;
            editor.Properties.Mask.EditMask = "MMMM yyyy";
            args.Editor          = editor;
            args.DefaultResponse = DateTime.Now.Date;
            var result = XtraInputBox.Show(args);

            if (result == null)
            {
                return;
            }
            searchdate = DateTime.Parse(result.ToString());
            ClearForm();
            GenerateForm();
        }
Beispiel #11
0
        private async void Sb_Update_Click(object sender, EventArgs e)
        {
            try
            {
                if (Gv_PublishingHouses.FocusedRowHandle < 0)
                {
                    return;
                }
                var name   = Gv_PublishingHouses.GetFocusedRowCellDisplayText("PublishingName");
                var id     = Gv_PublishingHouses.GetFocusedRowCellDisplayText("Id");
                var result = XtraInputBox.Show("请输入", "修改出版社信息", name);
                if (string.IsNullOrEmpty(result))
                {
                    return;
                }
                var resultMessage = await _propertiesApi.UpdatePublishingHouse(id, result);

                if (resultMessage.ResultCode != 1)
                {
                    PopupProvider.Warning(resultMessage.ResultMessage);
                    return;
                }

                PopupProvider.Success(resultMessage.ResultMessage);
            }
            catch (Exception exception)
            {
                PopupProvider.Error("添加异常!", exception);
            }
        }
Beispiel #12
0
        private void btnEditarAbono_Click(object sender, EventArgs e)
        {
            var row = gVCuentasCobrarHistorial.GetRow(gVCuentasCobrarHistorial.FocusedRowHandle) as Credito;

            if (row != null)
            {
                var resp   = new Repository <Credito>();
                var aux    = resp.Find(x => x.IDCredito == row.IDCredito);
                var result = XtraInputBox.Show("Ingrese el valor:", "Editar Abono", "0,00");
                int ejem   = 0;

                if (int.TryParse(result, out ejem))
                {
                    var data = gVCuentasCobrarHistorial.DataSource as List <Credito>;

                    var suma = data.Sum(x => x.Abona);

                    if (Convert.ToDecimal(result) > 0 && Convert.ToDecimal(result) <= suma)
                    {
                        aux.Abona = Convert.ToDecimal(result);
                        resp.Update(aux);
                        CargaGrid();
                    }
                    else
                    {
                        XtraMessageBox.Show("Valores no permitidos, revise e intente nueva mente");
                    }
                }
                //else
                //{
                //    XtraMessageBox.Show("Caracteres invalidos");
                //}
            }
        }
        private void lblStrong_Click(object sender, EventArgs e)
        {
            if (Word.StrongCode.IsNotNull() && StrongClick.IsNotNull())
            {
                StrongClick(this, Word.StrongCode);
            }
            else
            {
                var strongCode = XtraInputBox.Show("Insert Strong's code:", "Strong Codes", "");
                if (strongCode.IsNotNullOrEmpty())
                {
                    var sc = new XPQuery <StrongCode>(Word.Session).Where(x => x.Code == strongCode.ToInt() && x.Lang == Language.Greek).FirstOrDefault();
                    if (sc.IsNotNull())
                    {
                        Word.StrongCode = sc;
                        (Word.Session as UnitOfWork).CommitChanges();

                        lblStrong.DataBindings.Add("Text", Word.StrongCode, "Code");
                        lblStrong.BackColor = Color.Transparent;

                        AddStrongToolTip(Word.StrongCode);
                    }
                }
            }
        }
Beispiel #14
0
        private void btnAddChapters_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var book = treeList.GetDataRecordByNode(treeList.FocusedNode) as IbeTreeItem;

            if (book.Type == IbeTreeItemType.Book)
            {
                var response = XtraInputBox.Show("Type chapters count:", "Add chapters", "", MessageBoxButtons.OKCancel);
                if (response.IsNotNullOrEmpty())
                {
                    for (int i = 1; i < response.ToInt() + 1; i++)
                    {
                        var item = new IbeChapterTreeItem()
                        {
                            Text     = i.ToString(),
                            ParentID = book.ID,
                            ID       = $"{Guid.NewGuid()}",
                            IsNew    = true,
                            Tag      = -1,
                            Number   = i,
                        };
                        TreeItems.Add(item);
                    }

                    treeList.RefreshDataSource();
                    treeList.FocusedNode.Expand();
                }
            }
        }
Beispiel #15
0
        private void bbiPlConfirm_ItemClick(object sender, ItemClickEventArgs e)
        {
            //InvoiceConfirmInvForm frm = new InvoiceConfirmInvForm(ob.RefInv);
            //frm.ShowDialog();
            //bool chinvconfirm = new GreeterFunction().CheckUpdateInvoice(DateTime.Parse(bbiEtd.EditValue.ToString()));
            //if (chinvconfirm)
            //{
            //    string invno = bbiRefInv.EditValue.ToString();
            //    string invoiceno = new GreeterFunction().GetLastInvoice(invno);
            //    var result = XtraInputBox.Show("ระบุเลขที่เอกสาร", "ยืนยันการสร้าง Invoice", invoiceno);
            //    if (result.Length > 0)
            //    {
            //        string sql = $"UPDATE TXP_ISSTRANSENT e SET e.REFINVOICE = '{result}' WHERE e.ISSUINGKEY = '{invno}'";
            //        if (new ConnDB().ExcuteSQL(sql))
            //        {
            //            XtraMessageBox.Show("บันทึกข้อมูลเสร็จแล้ว");
            //            bbiInv.EditValue = invoiceno;
            //        }
            //    }
            //}
            string invno     = bbiRefInv.EditValue.ToString();
            string invoiceno = new GreeterFunction().GetLastInvoice(invno);
            var    result    = XtraInputBox.Show("ระบุเลขที่เอกสาร", "ยืนยันการสร้าง Invoice", invoiceno);

            if (result.Length > 0)
            {
                string sql = $"UPDATE TXP_ISSTRANSENT e SET e.REFINVOICE = '{result}' WHERE e.ISSUINGKEY = '{invno}'";
                if (new ConnDB().ExcuteSQL(sql))
                {
                    XtraMessageBox.Show("บันทึกข้อมูลเสร็จแล้ว");
                    bbiInv.EditValue = invoiceno;
                }
            }
        }
Beispiel #16
0
 private void btnGhiChu_Click(object sender, EventArgs e)
 {
     if (gvMenu.GetCheckedRows().Contains(gvMenu.FocusedRowHandle))
     {
         var result = XtraInputBox.Show("Nhập nội dung", "Ghi Chú", "");
         gvMenu.SetFocusedRowCellValue("GhiChu", result);
     }
 }
        private void lblNumberOfVerseWord_DoubleClick(object sender, EventArgs e)
        {
            var index = XtraInputBox.Show("Set word index:", "Word Index", Word.NumberOfVerseWord);

            if (index != 0)
            {
                Word.NumberOfVerseWord = index;
            }
        }
        private void lblTransliteration_Click(object sender, EventArgs e)
        {
            var result = XtraInputBox.Show("Transliteration", "Transliteration", Word.Transliteration);

            if (result != Word.Transliteration && result.IsNotNullOrEmpty())
            {
                Word.Transliteration = result;
            }
        }
Beispiel #19
0
        private void btnUpPDF_Click(object sender, EventArgs e)
        {
            OpenDialog.Filter           = "Portable Document Format (*.PDF)|*.PDF";
            OpenDialog.FilterIndex      = 1;
            OpenDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);;
            OpenDialog.Title            = "Cargar Documento PDF";
            OpenDialog.CheckFileExists  = false;
            OpenDialog.Multiselect      = false;
            DialogResult result = OpenDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                TextEdit textEdit = new TextEdit();
                textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular;
                textEdit.Properties.MaxLength     = 100;
                //textEdit.Properties.Mask.EditMask = "f0";
                //textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.
                XtraInputBoxArgs args = new XtraInputBoxArgs();
                // set required Input Box options
                args.Caption            = "Ingrese el nombre del Archivo";
                args.Prompt             = "Descripción";
                args.DefaultButtonIndex = 0;
                //args.Showing += Args_Showing;
                // initialize a DateEdit editor with custom settings
                TextEdit editor = new TextEdit();
                args.Editor = editor;
                // a default DateEdit value
                args.DefaultResponse = "Archivo PDF";
                // display an Input Box with the custom editor
                args.Editor = textEdit;
                var result2 = XtraInputBox.Show(args).ToString();
                if (result2 != null)
                {
                    txtNombreArchivoPDF.Text = result2;
                    string     ar = OpenDialog.FileName;
                    FileStream fs = new FileStream(ar, FileMode.Open);
                    //Creamos un array de bytes para almacenar los datos leídos por fs.
                    Byte[] Archivo = new byte[fs.Length];
                    //Y guardamos los datos en el array data
                    fs.Read(Archivo, 0, Convert.ToInt32(fs.Length));
                    CLS_Activos udp = new CLS_Activos();
                    udp.Id_Activo        = vId_Activo;
                    udp.Opcion           = 1;
                    udp.NombreArchivoPDF = txtNombreArchivoPDF.Text;
                    udp.ArchivoPDF       = Archivo;
                    udp.MtdUpdateActivoArchivoPDF();
                    if (udp.Exito)
                    {
                        XtraMessageBox.Show("Se a agregado el PDF con Exito");
                    }
                    else
                    {
                        XtraMessageBox.Show(udp.Mensaje);
                    }
                }
            }
        }
Beispiel #20
0
        private void btnAgregar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenDialog.Filter           = "Formato de imagen PNG (*.png)|*.png |Formato de imagen JPEG (*.jpg)|*.jpg|La extensión de imagen .gif (*.gif)|*.gif";
            OpenDialog.FilterIndex      = 1;
            OpenDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);;
            OpenDialog.Title            = "Cargar Imagenes";
            OpenDialog.CheckFileExists  = false;
            OpenDialog.Multiselect      = false;
            DialogResult result = OpenDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                TextEdit textEdit = new TextEdit();
                textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular;
                textEdit.Properties.MaxLength     = 100;
                //textEdit.Properties.Mask.EditMask = "f0";
                //textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.
                XtraInputBoxArgs args = new XtraInputBoxArgs();
                // set required Input Box options
                args.Caption            = "Ingrese la descripcion de la imagen";
                args.Prompt             = "Descripción";
                args.DefaultButtonIndex = 0;
                //args.Showing += Args_Showing;
                // initialize a DateEdit editor with custom settings
                TextEdit editor = new TextEdit();
                args.Editor = editor;
                // a default DateEdit value
                args.DefaultResponse = "Descripcion de la Imagen";
                // display an Input Box with the custom editor
                args.Editor = textEdit;
                var result2 = XtraInputBox.Show(args).ToString();
                if (result2 != null)
                {
                    Descripction = result2;
                    gc.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside;
                    gc.Gallery.ImageSize       = new Size(120, 90);
                    gc.Gallery.ShowItemText    = true;
                    Serie++;
                    Valor = Serie.ToString();
                    Image  im1 = Image.FromFile(OpenDialog.FileName);
                    byte[] arr = null;
                    arr = ImageAArray(im1);
                    group1.Items.Add(new GalleryItem(im1, Valor, Descripction));
                    CLS_Activos ins = new CLS_Activos();
                    ins.Id_Activo   = vId_Activo;
                    ins.SerieImagen = Serie;
                    ins.Descripcion = Descripction;
                    ins.Imagen      = arr;
                    ins.MtdInsertarActivoImagen();
                    if (!ins.Exito)
                    {
                        XtraMessageBox.Show(ins.Mensaje);
                    }
                }
            }
        }
        private void lblGreekWord_DoubleClick(object sender, EventArgs e)
        {
            var sourceWord = XtraInputBox.Show("Insert source word:", "Source Word", Word.SourceWord);

            if (sourceWord.IsNotNullOrEmpty())
            {
                Word.SourceWord      = sourceWord;
                Word.Transliteration = TransliterationController.TransliterateWord(sourceWord);
            }
        }
        public string RequestLine()
        {
            string result = null;

            Invoke((MethodInvoker)(() =>
            {
                result = XtraInputBox.Show(this, "Response: ", "User response", string.Empty);
            }));

            return(result);
        }
Beispiel #23
0
        private void bbiConfirm_ItemClick(object sender, ItemClickEventArgs e)
        {
            string invoiceno = new GreeterFunction().GetLastInvoice(invno);
            var    result    = XtraInputBox.Show("ระบุเลขที่เอกสาร", "ยืนยันการสร้าง Invoice", invoiceno);

            if (result.Length > 0)
            {
                string sql = $"UPDATE TXP_ISSTRANSENT e SET e.REFINVOICE = '{result}' WHERE e.ISSUINGKEY = '{invno}'";
                if (new ConnDB().ExcuteSQL(sql))
                {
                    XtraMessageBox.Show("บันทึกข้อมูลเสร็จแล้ว");
                }
            }
        }
        private void btn_anaKategoriEkle_Click(object sender, EventArgs e)
        {
            string categoryName = XtraInputBox.Show("Ana kategori ismi giriniz : ", "Kategori Ekle", "");

            if (categoryName != null && categoryName != "")
            {
                MainCategory addMainCategory = new MainCategory()
                {
                    mainCategory_name = categoryName
                };
                XtraMessageBox.Show((createManager <MainCategory>(new MainCategory()).addMainCategory(addMainCategory)) ? "Kategori Ekledi..." : "Hata meydana geldi...!", "Bilgilendirme");
                mainCategoryFill(createManager <MainCategory>(new MainCategory()));
            }
        }
 private void bbiEditQty_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         var result = XtraInputBox.Show("ระบุจำนวน QTY ให้ถูกต้องด้วย", "Create PlType.", "");
         if (result != "")
         {
             gridView.SetFocusedRowCellValue("qty", int.Parse(result));
         }
     }
     catch (Exception)
     {
         XtraMessageBox.Show("กรุณาระบุข้อมูลให้ถูกต้องด้วย", "XPW Alert!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #26
0
        private void btnAddWords_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var currentControl = VerseControl;//this.Controls.OfType<Control>().Where(x => x is VerseEditorControl).FirstOrDefault() as VerseEditorControl;

            if (currentControl.IsNotNull())
            {
                var start = 1;
                if (currentControl.Verse.VerseWords.IsNotNull() && currentControl.Verse.VerseWords.Count > 0)
                {
                    start = currentControl.Verse.VerseWords.Max(x => x.NumberOfVerseWord) + 1;
                }
                var words = XtraInputBox.Show("Type words:", "Add words", "");
                if (words.IsNotNullOrEmpty())
                {
                    var table = words.Split(' ');
                    if (table.Length > 0)
                    {
                        for (int i = 0; i < table.Length; i++)
                        {
                            var _word = table[i];

                            var word = new VerseWord(Uow)
                            {
                                ParentVerse       = currentControl.Verse,
                                Translation       = String.Empty,
                                Transliteration   = TransliterationController.TransliterateWord(_word),
                                Citation          = false,
                                StrongCode        = null,
                                FootnoteText      = String.Empty,
                                GrammarCode       = null,
                                NumberOfVerseWord = start + i,
                                SourceWord        = _word,
                                WordOfJesus       = false
                            };

                            word.Save();


                            var control = currentControl.CreateVerseWordControl(word);
                            currentControl.VerseWordsControl.Controls.Add(control);
                        }

                        currentControl.Verse.Save();
                        Uow.CommitChanges();
                    }
                }
            }
        }
        private void bbiConfirmInvoice_ItemClick(object sender, ItemClickEventArgs e)
        {
            string invoiceno = new GreeterFunction().GetLastInvoice(refno.Replace("'", "").Trim());
            var    result    = XtraInputBox.Show("ระบุเลขที่เอกสาร", "ยืนยันการสร้าง Invoice", invoiceno);

            if (result.Length > 0)
            {
                string sql    = $"UPDATE TXP_ISSTRANSENT e SET e.REFINVOICE = '{result}',e.ISSUINGSTATUS=2 WHERE e.ISSUINGKEY = '{refno.Replace("'", "").Trim()}'";
                string sqlord = $"UPDATE TXP_ORDERPLAN e SET e.ORDERSTATUS=2 WHERE e.CURINV = '{refno.Replace("'", "").Trim()}'";
                new ConnDB().ExcuteSQL(sqlord);
                if (new ConnDB().ExcuteSQL(sql))
                {
                    XtraMessageBox.Show("บันทึกข้อมูลเสร็จแล้ว");
                    ReloadData();
                }
            }
        }
        private void btn_KategoriEkle_Click(object sender, EventArgs e)
        {
            string categoryName = XtraInputBox.Show("Kategori ismi giriniz!", "Kategori Ekle", "");


            if (categoryName != null && categoryName != "")
            {
                SubCategory addedCategory = new SubCategory()
                {
                    subCategory_name       = categoryName,
                    subCategory_mainCatgID = Convert.ToInt32(le_mainCategory.EditValue)
                };
                XtraMessageBox.Show((createManager <SubCategory>(new SubCategory()).addSubCategory(addedCategory)) ? "Kategori Ekledi..." : "Hata meydana geldi...!", "Bilgilendirme");
                subCategoryFill(new ProductManager <SubCategory>(), le_mainCategory.EditValue.ToString());
            }
            ;
        }
Beispiel #29
0
        private void btnAddWords_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (VerseControl.IsNotNull())
            {
                var start = 1;
                if (VerseControl.Verse.VerseWords.IsNotNull() && VerseControl.Verse.VerseWords.Count > 0)
                {
                    start = VerseControl.Verse.VerseWords.Max(x => x.NumberOfVerseWord) + 1;
                }
                var words = XtraInputBox.Show("Type words:", "Add words", "");
                if (words.IsNotNullOrEmpty())
                {
                    var table = words.Split(' ');
                    if (table.Length > 0)
                    {
                        VerseControl.Save(); // save changes before

                        for (int i = 0; i < table.Length; i++)
                        {
                            var _word = table[i];

                            var word = new VerseWord(Uow)
                            {
                                ParentVerse       = VerseControl.Verse,
                                Translation       = String.Empty,
                                Transliteration   = TransliterationController.TransliterateWord(_word),
                                Citation          = false,
                                StrongCode        = null,
                                FootnoteText      = String.Empty,
                                GrammarCode       = null,
                                NumberOfVerseWord = start + i,
                                SourceWord        = _word,
                                WordOfJesus       = false
                            };

                            word.Save();
                        }

                        VerseControl.Verse.Save();
                        Uow.CommitChanges();

                        VerseControl.LoadData(VerseControl.Verse);
                    }
                }
            }
        }
Beispiel #30
0
 private void itemCheckout_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (gvNhanVien.GetFocusedRowCellValue("ID") == null)
         {
             XtraMessageBox.Show("Bạn chưa chọn dòng cần [Check Out].", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         if ((bool?)gvNhanVien.GetFocusedRowCellValue("IsDangLam") != true)
         {
             XtraMessageBox.Show("Nhân viên này đã nghĩ việc.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         var objBC = db.BangCongs.FirstOrDefault(p => p.NVID == (int)gvNhanVien.GetFocusedRowCellValue("ID") && SqlMethods.DateDiffDay(p.BatDau.GetValueOrDefault(), DateTime.Now) == 0);
         if (objBC == null)
         {
             XtraMessageBox.Show("Nhân viên này chưa [Check In].", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         else
         {
             XtraInputBoxArgs args = new XtraInputBoxArgs();
             // set required Input Box options
             args.Caption            = "CHECK IN";
             args.Prompt             = "Chọn thời gian";
             args.DefaultButtonIndex = 0;
             //
             DateEdit lookBan = new DateEdit();
             lookBan.Properties.CalendarTimeEditing = DevExpress.Utils.DefaultBoolean.True;
             //
             args.Editor          = lookBan;
             args.DefaultResponse = DateTime.Now;
             //
             var result  = XtraInputBox.Show(args).ToString();
             var result1 = XtraInputBox.Show("Nhập nội dung", "Ghi Chú", objBC.GhiChu);
             objBC.KetThuc = DateTime.Parse(result);
             objBC.GhiChu  = result1;
         }
         db.SubmitChanges();
         XtraMessageBox.Show("Hoàn thành.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         LoadDetail();
     }
     catch { }
 }