Beispiel #1
0
        /// <summary>
        /// Xử lý xóa dữ liệu
        /// </summary>
        private void Xoa()
        {
            DanhMucProcess danhmucProcess = new Presentation.Process.DanhMucProcess();

            try
            {
                if (grDanhSach.SelectedItems.Count > 0)
                {
                    int[] arrid = new int[grDanhSach.SelectedItems.Count];
                    List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                    for (int i = 0; i < grDanhSach.SelectedItems.Count; i++)
                    {
                        DataRow dtr = (DataRow)grDanhSach.SelectedItems[i];
                        arrid[i] = int.Parse(dtr[1].ToString());
                    }
                    if (danhmucProcess.XoaTinhTP(arrid.ToArray(), ref listResponseDetail))
                    {
                        LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
                        LoadDuLieu();
                    }
                    else
                    {
                        LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Error);
                    }
                }
                else
                {
                    LMessage.ShowMessage("M.DungChung.ChuaChonBanGhi", LMessage.MessageBoxType.Warning);
                    return;
                }
            }
            catch (Exception ex)
            {
            }
            danhmucProcess = null;
        }
Beispiel #2
0
        /// <summary>
        /// Xoa du lieu
        /// </summary>
        void Xoa()
        {
            DanhMucProcess danhmucProcess = new Presentation.Process.DanhMucProcess();

            try
            {
                if (idTinhTP == null)
                {
                    LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Warning);
                }
                else
                {
                    int[] listID = new int[1];
                    List <ClientResponseDetail> listResponseDetail = new List <ClientResponseDetail>();

                    listID[0] = idTinhTP;
                    if (danhmucProcess.XoaTinhTP(listID.ToArray(), ref listResponseDetail))
                    {
                        LMessage.ShowMessage("M.DungChung.XoaThanhCong", LMessage.MessageBoxType.Information);
                        if (OnSavingComleted != null)
                        {
                            OnSavingComleted(null, EventArgs.Empty);
                        }
                        PresentationWPF.CustomControl.CommonFunction.CloseUserControl(this);
                    }
                    else
                    {
                        LMessage.ShowMessage("M.DungChung.XoaKhongThanhCong", LMessage.MessageBoxType.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex);
            }
        }