Пример #1
0
        private void RemoveBreakpointMenuItem_Click(object sender, EventArgs e)
        {
            if (breakpointsGrid.SelectedItems.Count == 1)
            {
                GridEXRow row = breakpointsGrid.SelectedItems[0].GetRow();
                NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

                if (functionBreakpoint != null)
                {
                    RowDelete(breakpointsGrid.SelectedItems[0].GetRow());
                    breakpointsGrid.SelectedItems[0].GetRow().Delete();
                }
            }
        }
        private void lnkSuaDiaDanh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //lay du lieu tu luoi
            gridDiaDanh.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            DiaDanh objDiaDanh = new DiaDanh();

            if (gridDiaDanh.SelectedItems.Count > 0)
            {
                GridEXRow row = ((GridEXSelectedItem)gridDiaDanh.SelectedItems[0]).GetRow();
                objDiaDanh.DiaDanhID     = int.Parse(row.Cells["PK_DiaDanh"].Value.ToString());
                objDiaDanh.TenDiaDanh    = row.Cells["TenDiaDanh"].Value.ToString();
                objDiaDanh.DiaChi        = row.Cells["DiaChi"].Value.ToString();
                objDiaDanh.DienThoai     = row.Cells["DienThoai"].Value.ToString();
                objDiaDanh.GhiChu        = row.Cells["MoTa"].Value.ToString();
                objDiaDanh.LoaiDiaDanhID = int.Parse(row.Cells["FK_LoaiDiaDanh"].Value.ToString());
            }
            else
            {
                return;
            }

            frmDiaDanh frm = new frmDiaDanh(objDiaDanh, false);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                objDiaDanh = frm.GetDiaDanh();
                if (objDiaDanh.TenDiaDanh.Length <= 0)
                {
                    return;
                }

                if (objDiaDanh.DiaChi.Length <= 0)
                {
                    return;
                }


                if (!objDiaDanh.Update())
                {
                    new MessageBox.MessageBoxBA().Show("Lỗi cập nhật địa danh");
                    return;
                }
                else
                {
                    //Load lai grid
                    LoadDSDiaDanh(g_LoaiDiaDanhID);
                    new MessageBox.MessageBoxBA().Show("Cập nhật địa danh thành công");
                }
            }
        }
Пример #3
0
        private void DeactivateBreakpointMenuItem_Click(object sender, EventArgs e)
        {
            if (breakpointsGrid.SelectedItems.Count == 1)
            {
                GridEXRow row = breakpointsGrid.SelectedItems[0].GetRow();
                NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

                if (functionBreakpoint != null)
                {
                    DeactivateBreakpoint(functionBreakpoint);
                    NuGenUIHandler.Instance.UpdateBreakpoint(functionBreakpoint.MethodDefinition, functionBreakpoint);
                }
            }
        }
Пример #4
0
        private void Instance_DisplayHexaNumbersChanged()
        {
            for (int i = 0; i < objectsGrid.RowCount; i++)
            {
                GridEXRow row = objectsGrid.GetRow(i);

                NuGenIValueFormatter valueFormatter = NuGenHelperFunctions.TaggedObjects[(int)row.Cells[2].Value] as NuGenIValueFormatter;

                if (valueFormatter != null)
                {
                    row.Cells[1].Value = valueFormatter.GetFormattedString(NuGenSettings.Instance.DisplayHexaNumbers);
                }
            }
        }
Пример #5
0
        private void CtmMenu_Opening(object sender, CancelEventArgs e)
        {
            GridEXRow currentRow = gridList.GetRow();

            btnNew.Enabled = MANAGE_ROLE.ALLOW_ADD_MEMBERSHIP;
            if (currentRow == null)
            {
                btnView.Enabled = btnEdit.Enabled = false;
            }
            else
            {
                btnEdit.Enabled = MANAGE_ROLE.ALLOW_EDIT_MEMBERSHIP;
                btnView.Enabled = MANAGE_ROLE.ALLOW_VIEW_MEMBERSHIP;
            }
        }
Пример #6
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            GridEXRow currentRow = gridList.GetRow();

            if (currentRow != null || currentRow.RowType == RowType.Record)
            {
                Guid          id            = Guid.Parse(currentRow.Cells["ID"].Value.ToString());
                FrmMemberShip frmMemberShip = new FrmMemberShip(true, id);
                frmMemberShip.ShowDialog();
                if (frmMemberShip.SaveCompleted)
                {
                    LoadData();
                }
            }
        }
Пример #7
0
        private void ToggleBreakpointActive(NuGenBreakpointInformation breakpoint, bool isActive)
        {
            GridEXRow row = FindRow(breakpoint);

            row.BeginEdit();
            breakpoint.State = (isActive ? BreakpointState.Active : BreakpointState.Inactive);

            if (row != null)
            {
                row.Cells[0].Value = isActive;
            }

            row.EndEdit();
            NuGenProject.Instance.IsSaved = false;
        }
Пример #8
0
        private void gridMayTinhTongDai_DoubleClick(object sender, EventArgs e)
        {
            gridMayTinhTongDai.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            if (gridMayTinhTongDai.SelectedItems.Count > 0)
            {
                GridEXRow row           = gridMayTinhTongDai.SelectedItems[0].GetRow();
                string    IP            = row.Cells["IP_Address"].Value.ToString();
                string    Line_Vung     = row.Cells["Line_Vung"].Value.ToString();
                string    Line_Vung_Gop = row.Cells["LineGop"].Value.ToString();
                bool      IsActive      = row.Cells["IsHoatDong"].Value.ToString() == "1" ? true : false;

                new frmThemMayTinh(IP, Line_Vung, IsActive, Taxi.Business.KieuMayTinh.MAYTONGDAI, false, 0, Line_Vung_Gop).ShowDialog();
                this.GetDSMayTinhTongDai();
            }
        }
Пример #9
0
        private void CtmsMenuBarOnOpening(object sender, CancelEventArgs cancelEventArgs)
        {
            GridEXRow currentRow = gridList.GetRow();

            btnNew.Enabled = MANAGE_ROLE.ALLOW_ADD_COMPANY;
            if (currentRow == null)
            {
                btnView.Enabled = btnEdit.Enabled = false;
            }
            else
            {
                btnEdit.Enabled = MANAGE_ROLE.ALLOW_EDIT_COMPANY;
                btnView.Enabled = MANAGE_ROLE.ALLOW_VIEW_COMPANY;
            }
        }
Пример #10
0
        private void btnRemoveItem_Click(object sender, EventArgs e)
        {
            //Get selected row
            GridEXRow item = gridEX1.CurrentRow;

            if (item != null && item.RowType == RowType.Record)
            {
                //Delete the row.
                item.Delete();
            }
            else
            {
                MessageBox.Show("Select an item to delete.");
            }
        }
Пример #11
0
        public void AddBreakpoint(NuGenBreakpointInformation breakpoint)
        {
            breakpointsGrid.AddItem();
            GridEXRow row = breakpointsGrid.GetRow(breakpointsGrid.RowCount - 1);

            row.BeginEdit();
            test = row;

            row.Cells[0].Value = (breakpoint.State == BreakpointState.Active);
            row.Cells[1].Value = breakpoint.DisplayName;
            row.Cells[2].Value = breakpoint.OffsetValue;
            NuGenHelperFunctions.TaggedObjects.Add((String)row.Cells[1].Value + (String)row.Cells[2].Value, breakpoint);

            row.EndEdit();
        }
Пример #12
0
        private void gridEX_SelectionChanged(object sender, System.EventArgs e)
        {
            if (File.Exists(_tempFile))
            {
                try
                {
                    File.Delete(_tempFile);
                }
                catch {}
            }

            if (gridEX.SelectedItems.Count == 0)
            {
                return;
            }

            GridEXSelectedItem i = gridEX.SelectedItems[0];

            if (i != null)
            {
                GridEXRow row = i.GetRow();

                string idBandeja     = ( string )row.Cells["IdBandeja"].Value;
                string nombreArchivo = ( string )row.Cells["NombreArchivo"].Value;
                byte[] bytes         = _bandeja.GetContenidoArhivo(idBandeja, nombreArchivo);

                _tempFile = Path.ChangeExtension(Path.GetTempFileName(), ".xml");
                try
                {
                    File.Delete(Path.ChangeExtension(_tempFile, ".tmp"));
                }
                catch
                {
                }

                FileStream fs = new FileStream(_tempFile, FileMode.Create);
                ZipUtil.Decompress(bytes, fs);
                fs.Flush();
                fs.Close();

                object o = null;

                axWebBrowser.Navigate(_tempFile, ref o, ref o, ref o, ref o);
            }


            //Job j = Job.Read( bytes );
        }
        private void gridBaoCaoBieuMau1_FormattingRow_1(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            try
            {
                if (e.Row.RowType == RowType.Record)
                {
                    GridEXRow row = e.Row;

                    if (row.Cells["HDTruoc"] != null && row.Cells["HDTruoc"].Value.ToString() == "1")
                    {
                        row.Cells["HDTruoc"].Text = "x";
                    }
                    else
                    {
                        row.Cells["HDTruoc"].Text = "";
                    }
                    if (row.Cells["KhongHDTruoc"] != null && row.Cells["KhongHDTruoc"].Value.ToString() == "1")
                    {
                        row.Cells["KhongHDTruoc"].Text = "x";
                    }
                    else
                    {
                        row.Cells["KhongHDTruoc"].Text = "";
                    }

                    if (row.Cells["HDSau"] != null && row.Cells["HDSau"].Value.ToString() == "1")
                    {
                        row.Cells["HDSau"].Text = "x";
                    }
                    else
                    {
                        row.Cells["HDSau"].Text = "";
                    }

                    if (row.Cells["KhongHDSau"] != null && row.Cells["KhongHDSau"].Value.ToString() == "1")
                    {
                        row.Cells["KhongHDSau"].Text = "x";
                    }
                    else
                    {
                        row.Cells["KhongHDSau"].Text = "";
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #14
0
        /// <summary>
        /// Update the group text with the amount of checked villages / total villages
        /// </summary>
        private void UpdateGroupRecordText(GridEXRow row)
        {
            if (row.RowType == RowType.GroupHeader)
            {
                // Set group totals
                int totalRecords = row.GetRecordCount();
                int totalChecked = row.GetChildRecords().Count(x => x.CheckState == RowCheckState.Checked);
                row.GroupCaption = string.Format(ControlsRes.PolygonControl_Grid_GroupText, row.GroupValue, totalChecked, totalRecords);

                GridEXRow[] children = row.GetChildRows();
                foreach (var child in children)
                {
                    UpdateGroupRecordText(child);
                }
            }
        }
 private void gridMayDienThoai_DoubleClick(object sender, EventArgs e)
 {
     gridMayDienThoai.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (gridMayDienThoai.SelectedItems.Count > 0)
     {
         GridEXRow row           = gridMayDienThoai.SelectedItems[0].GetRow();
         string    IP            = row.Cells["IP_Address"].Value.ToString();
         string    Line_Vung     = row.Cells["Line_Vung"].Value.ToString();
         string    Line_Vung_Gop = row.Cells["LineGop"].Value.ToString();
         bool      IsActive      = row.Cells["IsHoatDong"].Value.ToString() == "1";
         bool      IsG5_Type     = row.Cells["G5_Type"].Value.ToString() == "1";
         string    Extension     = row.Cells["Extension"].Value.To <string>();
         new frmThemMayTinh(IP, Line_Vung, IsActive, KieuMayTinh.MAYDIENTHOAI, false, 0, Line_Vung_Gop, IsG5_Type, Extension).ShowDialog();
         this.GetDSMayTinhDienThoai();
     }
 }
Пример #16
0
        public void AddModules(ModuleWrapper[] modules)
        {
            modulesGrid.BeginGridUpdate();

            int rowsCount = modulesGrid.RowCount;

            for (int index = 0; index < modules.Length; index++)
            {
                ModuleWrapper module = modules[index];
                GridEXRow     row    = modulesGrid.AddItem();

                AddModuleToGrid(module, row);
            }

            modulesGrid.EndGridUpdate();
        }
Пример #17
0
        private void gridMayTinhMoiKhach_DoubleClick(object sender, EventArgs e)
        {
            gridMayMoiKhach.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            if (gridMayMoiKhach.SelectedItems.Count > 0)
            {
                GridEXRow row           = gridMayMoiKhach.SelectedItems[0].GetRow();
                string    IP            = row.Cells["IP_Address"].Value.ToString();
                string    Line_Vung     = row.Cells["Line_Vung"].Value.ToString();
                string    Line_Vung_Gop = row.Cells["LineGop"].Value.ToString();
                bool      IsActive      = row.Cells["IsHoatDong"].Value.ToString() == "1" ? true : false;
                int       No            = Convert.ToInt16(row.Cells["MK"].Value);

                new frmThemMayTinh(IP, Line_Vung, IsActive, Taxi.Business.KieuMayTinh.MAYMOIKHACH, false, No, Line_Vung_Gop).ShowDialog();
                this.GetDSMayTinhMoiKhach();
            }
        }
Пример #18
0
        private void LoadAllRoad(string MaCungXN, int ProvinceID)
        {
            try
            {
                clsRoad           clsRoads = new clsRoad();
                List <RoadEntity> lstRoad  = clsRoads.GetAllRoadbyMAXN_ProvinceID(MaCungXN, ProvinceID);
                #region Update All Kinh Do - Vi Do
                //gridBaoCaoBieuMau1.DataSource = lstRoad;
                //float viDo = 0;
                //float kinhDo = 0;
                //string toaDo = "";
                //foreach (clsRoadEntity item in lstRoad)
                //{
                //    if (item.KinhDo > 0 && item.ViDo > 0) continue;

                //    toaDo = GetGeobyAddressBA2(item.NameVN);
                //    if (toaDo != "*" && toaDo != string.Empty)
                //    {
                //        string[] arrString = toaDo.Split(' ');
                //        float.TryParse(arrString[0], NumberStyles.AllowDecimalPoint ,new CultureInfo("vi-VN", true), out viDo);
                //        float.TryParse(arrString[1], NumberStyles.AllowDecimalPoint, new CultureInfo("vi-VN", true), out kinhDo);
                //    }

                //    new clsRoad().Update_TenVietTat(item.ID, item.VietTat, item.NameVN, item.NameEN, kinhDo, viDo);
                //}
                #endregion

                gridVietTatTenDuong.SetDataBinding(lstRoad, "ListRoad");

                GridEXFilterCondition Filter = new GridEXFilterCondition(gridVietTatTenDuong.RootTable.Columns["NameVN"], ConditionOperator.Equal, G_NameVN);

                if (gridVietTatTenDuong.Find(Filter, -1, 1))
                {
                    GridEXRow row = ((GridEXSelectedItem)gridVietTatTenDuong.SelectedItems[0]).GetRow();

                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.BackColor = System.Drawing.Color.DodgerBlue;
                    row.RowStyle       = RowStyle;
                    //gridVietTatTenDuong.RootTable.ApplyFilter(ab);
                }
            }
            catch (Exception ex)
            {
                LogError.WriteLogError(this.Name, ex);
            }
        }
Пример #19
0
        private void DisplayWatchExpression(GridEXRow watchRow)
        {
            NuGenIValueFormatter          watchValueFormatter = null;
            NuGenExpressionValueRefresher expressionRefresher = null;

            try
            {
                NuGenParser parser                     = new NuGenParser();
                string      watchExpression            = (string)watchRow.Cells[0].Value;
                List <NuGenBaseExpression> expressions = parser.Parse(watchExpression);
                expressionRefresher = new NuGenExpressionValueRefresher(expressions, ActiveFrameRefresher, EvaluationContext.EvaluationHandler, watchExpression);

                watchValueFormatter = ValueDisplayer.CreateSimpleFormatter(expressionRefresher.GetRefreshedValue());
            }
            catch (NuGenParserException parserException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Parser exception", parserException.Message);
            }
            catch (NuGenEvaluationException evaluationException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", evaluationException.Message);
            }
            catch (NuGenEvaluationHandlerException evaluationHandlerException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation running exception", evaluationHandlerException.Message);
            }
            catch (NugenMissingModuleException missingModuleException)
            {
                watchValueFormatter = new NuGenMissingModuleFormatter(missingModuleException.MissingModule);
            }
            catch (InvalidOperationException invalidOperationException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", invalidOperationException.Message);
            }
            catch (Exception exception)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Unexpected exception", exception.Message);
            }

            if (watchValueFormatter != null)
            {
                watchValueFormatter.ValueRefresher = expressionRefresher;
                watchRow.Cells[1].Value            = watchValueFormatter.GetFormattedString(NuGenSettings.Instance.DisplayHexaNumbers);
                NuGenHelperFunctions.TaggedObjects[(int)watchRow.Cells[2].Value] = watchValueFormatter;
            }
        }
Пример #20
0
        private void ShowModules()
        {
            modulesGrid.BeginGridUpdate();
            modulesGrid.ClearItems();

            List <ModuleWrapper> modules = NuGenDebugEventHandler.Instance.EventObjects.Process.GetModules();

            for (int index = 0; index < modules.Count; index++)
            {
                ModuleWrapper module = modules[index];
                GridEXRow     row    = modulesGrid.AddItem();

                AddModuleToGrid(module, row);
            }

            modulesGrid.EndGridUpdate();
        }
Пример #21
0
        private void dgEvents_SelectionChanged(object sender, EventArgs e)
        {
            if (dgEvents.SelectedItems.Count > 0)
            {
                // Get the current select item
                GridEXRow selectedRow = dgEvents.SelectedItems[0].GetRow();

                if (selectedRow.RowIndex != -1)
                {
                    lastIndex = (uint)selectedRow.Cells["Index"].Value;

                    // Do this asynchronously
                    FillMessageDelegate del    = new FillMessageDelegate(FillMessage);
                    IAsyncResult        result = del.BeginInvoke(selectedRow, null, null);
                }
            }
        }
Пример #22
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     try{
         if (gridBaoCaoBieuMau1.RowCount > 0)
         {
             for (int iRow = 0; iRow < gridBaoCaoBieuMau1.RowCount; iRow++)
             {
                 GridEXRow row = gridBaoCaoBieuMau1.GetRow(iRow);
                 KiemSoatXeLienLac.UpdateTenLaiXe(row.Cells["Sohieutaxi"].Value.ToString(), DateTime.Parse(row.Cells["Giorahoatdong"].Value.ToString()), row.Cells["Tenlaixe"].Value.ToString());
             }
         }
     }
     catch (Exception ex)
     {
         // LogError.WriteLog ("Loi luu thong UpdateTenLaiXe ",ex);
     }
 }
        /// <summary>
        /// Set data on the form
        /// </summary>
        private void setDataInput(GridEXRow row)
        {
            g_FormStatus = 2;
            refreshForm(g_FormStatus);
            string IDKhachDat = row.Cells["PK_KhachDatID"].Value.ToString();

            g_IDKhachDat              = Int32.TryParse(IDKhachDat, out g_IDKhachDat) ? g_IDKhachDat : 0;
            txtTenKH.Text             = row.Cells["TenKhachHang"].Value.ToString();
            txtDiaChi.Text            = row.Cells["DiaChi"].Value.ToString();
            calThoiDiemTiepNhan.Value = Convert.ToDateTime(row.Cells["ThoiDiemTiepNhan"].Value);
            txtDienThoai.Text         = row.Cells["SoDienThoai"].Value.ToString();
            txtKenh.Value             = row.Cells["VungKenh"].Value;
            bool isLapLai = Convert.ToBoolean(row.Cells["IsLapLai"].Value);

            calNgayBatDau.IsNullDate = false;
            calNgayBatDau.Text       = row.Cells["ThoiDiemBatDau"].Value.ToString();
            calNgayBatDau.Value      = Convert.ToDateTime(row.Cells["ThoiDiemBatDau"].Value);

            if (isLapLai)
            {
                rbLapLai.Checked          = true;
                calNgayKetThuc.IsNullDate = false;
                calNgayKetThuc.Value      = Convert.ToDateTime(row.Cells["ThoiDiemKetThuc"].Value);
            }
            else
            {
                rbMotLan.Checked          = true;
                calNgayKetThuc.IsNullDate = false;
                calNgayKetThuc.Value      = calNgayBatDau.Value.Date;
            }
            setNgayTrongTuan(row.Cells["NgayTrongTuanLapLai"].Value.ToString());
            calGioDon.Value = Convert.ToDateTime(row.Cells["GioDon"].Value);

            int SoPhutBaoTruoc = Int32.TryParse(row.Cells["SoPhutBaoTruoc"].Value.ToString(), out SoPhutBaoTruoc) ? SoPhutBaoTruoc : 0;

            cbSoPhut.Value = SoPhutBaoTruoc;
            txtGhiChu.Text = row.Cells["GhiChu"].Value.ToString();
            SetThongTinLoaiXe2(row.Cells["LoaiXe"].Value.ToString());
            txtSoLuong.Text             = row.Cells["SoLuongXe"].Value.ToString();
            txtSoTien.Text              = row.Cells["SoTien"].Value.ToString();
            txtSoKm.EditValue           = row.Cells["SoKm"].Value;
            cboHeThongDat.SelectedIndex = int.Parse(row.Cells["FK_SystemBookID"].Value.ToString());
            string a = row.Cells["DiaChiTra"].Value.ToString();

            txtDiaChiTra.Text = row.Cells["DiaChiTra"].Value.ToString();
        }
Пример #24
0
        /// <summary>
        /// - Hien thi anh trang thai tuong ung voi trang thai lenh
        /// - thay doi mau nen cua khach VIP, moi gioi, khach binh thuong
        /// - Thay mau chu cua dia chi cua khach goi lai
        /// - thay doi may cua cuoc goi khong phai cua minh phu trach
        /// </summary>
        private void HienThiAnhTrangThai_MauChu(GridEXRow row)
        {
            try
            {
                BaoCaoBieuMau3 objBC3 = (BaoCaoBieuMau3)row.DataRow;

                // thay doi mau nen cua khach VIP, moi gioi, khach binh thuong
                if (objBC3.KieuKhachHangGoiDen == Taxi.Utils.KieuKhachHangGoiDen.KhachHangMoiGioi)
                {
                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.BackColor = Color.MediumOrchid;
                    RowStyle.ForeColor = Color.White;
                    row.Cells["PhoneNumber"].FormatStyle = RowStyle;
                }
                else if (objBC3.KieuKhachHangGoiDen == Taxi.Utils.KieuKhachHangGoiDen.KhachHangVIP)
                {
                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.BackColor = Color.Blue;
                    row.Cells["PhoneNumber"].FormatStyle = RowStyle;
                }
                else if (objBC3.KieuKhachHangGoiDen == Taxi.Utils.KieuKhachHangGoiDen.KhachHangVang ||
                         objBC3.KieuKhachHangGoiDen == Taxi.Utils.KieuKhachHangGoiDen.KhachHangBac)
                {
                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.BackColor = Color.ForestGreen;
                    row.Cells["PhoneNumber"].FormatStyle = RowStyle;
                }
                if (objBC3.GoiLai || objBC3.LenhDienThoai.Contains("gọi lại"))
                {
                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.ForeColor = Color.Red;
                    row.RowStyle       = RowStyle;
                }
                if (objBC3.FileVoicePath.Length <= 0)
                {
                    GridEXFormatStyle RowStyle = new GridEXFormatStyle();
                    RowStyle.BackColor = Color.Violet;
                    row.Cells["RingNumber"].FormatStyle = RowStyle;
                }
            }
            catch (Exception ex)
            {
                ////  LogError.WriteLog("Lỗi xử lý hiển thị màu của lưới", ex);
            }
        }
Пример #25
0
        private void modulesGrid_CellDoubleClick(object sender, EventArgs e)
        {
            if (modulesGrid.SelectedItems.Count > 0)
            {
                GridEXRow selectedRow = modulesGrid.SelectedItems[0].GetRow();
                string    moduleName  = (string)selectedRow.Cells["Name"].Value;

                if (!NuGenProject.Instance.IsAssemblyLoaded(moduleName))
                {
                    string message = string.Format("Would you like to add the {0} assembly to the project?", moduleName);

                    if (MessageBox.Show(message, "DILE - Load assembly?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        AddSelectedModuleToProject(selectedRow, moduleName);
                    }
                }
            }
        }
Пример #26
0
 private void UpdateRecord()
 {
     gridLoaiXe.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (gridLoaiXe.SelectedItems.Count > 0)
     {
         GridEXRow row   = gridLoaiXe.SelectedItems[0].GetRow();
         int       ID    = int.Parse(row.Cells["LoaiXeID"].Value.ToString());
         string    Name  = row.Cells["TenLoaiXe"].Value.ToString();
         int       SoCho = 4;
         Int32.TryParse(row.Cells["SoCho"].Value.ToString(), out SoCho);
         if (SoCho < 4)
         {
             SoCho = 4;
         }
         new frmLoaiXe(ID, Name, SoCho).ShowDialog();
         this.LoadDiaDanh();
     }
 }
Пример #27
0
 /// <summary>
 /// Mo form DOiTac de edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void grdDoiTac_DoubleClick(object sender, EventArgs e)
 {
     grdDoiTac.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (grdDoiTac.SelectedItems.Count > 0)
     {
         GridEXRow      row       = ((GridEXSelectedItem)grdDoiTac.SelectedItems[0]).GetRow();
         BangKe         objBangKe = (BangKe)((GridEXSelectedItem)grdDoiTac.SelectedItems[0]).GetRow().DataRow;
         frmBangKeInput frm       = new frmBangKeInput(objBangKe, dtDoiTac, false);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             LoadListBangKe();
         }
         else
         {
             return;
         }
     }
 }
Пример #28
0
 private void SuaBangKe()
 {
     grdDoiTac.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
     if (grdDoiTac.SelectedItems.Count > 0)
     {
         GridEXRow      row       = ((GridEXSelectedItem)grdDoiTac.SelectedItems[0]).GetRow();
         BangKe         objBangKe = (BangKe)((GridEXSelectedItem)grdDoiTac.SelectedItems[0]).GetRow().DataRow;
         frmBangKeInput frm       = new frmBangKeInput(objBangKe, dtDoiTac, false);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             LoadListBangKe();
         }
     }
     else
     {
         new MessageBox.MessageBox().Show("Bạn chưa nhập bảng kê để cập nhật", "Thông báo", Taxi.MessageBox.MessageBoxButtons.OK, Taxi.MessageBox.MessageBoxIcon.Error);
     }
 }
Пример #29
0
        public void NhapDuLieuVaoTruyenDi2(int iRowPosition)
        {
            grdChuyenDV.SelectionMode = Janus.Windows.GridEX.SelectionMode.SingleSelection;
            if (grdChuyenDV.SelectedItems.Count > 0)
            {
                ThongTinPhanAnh objThongTinPA = (ThongTinPhanAnh)((GridEXSelectedItem)grdChuyenDV.SelectedItems[0]).GetRow().DataRow;
                //Thu doi mau
                GridEXRow         rowSelect = ((GridEXSelectedItem)grdChuyenDV.SelectedItems[0]).GetRow();
                GridEXFormatStyle RowStyle  = new GridEXFormatStyle();
                RowStyle.BackColor = System.Drawing.SystemColors.Highlight;
                rowSelect.RowStyle = RowStyle;

                List <int> lstCongTyID = new List <int>();
                lstCongTyID = objThongTinPA.GetDonViXuLy(Convert.ToInt32(objThongTinPA.ID));
                //End - Thu doi mau
                frmThongTinPhanAnhInput frmPAInPut = new frmThongTinPhanAnhInput(objThongTinPA, RoleNhanVien, true, lstCongTyID);

                DialogResult _dialogResult = frmPAInPut.ShowDialog(this);
                if (_dialogResult == DialogResult.Yes)
                {
                    LoadPhanAnh_ChuyenDonVi(rowSelect.Position);
                }
                else if (_dialogResult == DialogResult.OK)
                {
                    if (frmPAInPut.chkTrangThai.Checked)
                    {
                        LoadPhanAnh_ChuyenDonVi(0);
                    }
                    else
                    {
                        LoadPhanAnh_ChuyenDonVi(rowSelect.Position);
                    }
                }
                else
                {
                    LoadPhanAnh_ChuyenDonVi(rowSelect.Position);
                }

                //tra ve mau cu
                RowStyle           = new GridEXFormatStyle();
                RowStyle.BackColor = System.Drawing.SystemColors.Window;
                rowSelect.RowStyle = RowStyle;
            }
        }
Пример #30
0
        private void DinhDangCells(GridEXRow row)
        {
            try
            {
                BaoCaoBieuMau14 objBC14 = (BaoCaoBieuMau14)row.DataRow;

                if (!objBC14.Is_Hoatdong)
                {
                    row.Cells[3].Text = "";
                }
                if (!objBC14.Khonghoatdong)
                {
                    row.Cells[4].Text = "";
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #31
0
        private void deleteRecord(string module, string column, GridEXRow row, GridEX gridEX)
        {
            string value = row.Cells[column].Text;
            DataRow[] mDataRow = ((DataTable)gridEX.DataSource).Select(string.Format("{0} = '{1}'", column, value));
            if (mDataRow.Length > 0)
            {
                DataRow dr = mDataRow[0];
                if (dr.RowState == DataRowState.Added)
                {
                    switch (module)
                    {
                        case TAB_KEY_AREA:
                            dtArea.Rows.Remove(dr);
                            break;

                        case TAB_KEY_CATEGORY:
                            dtCategory.Rows.Remove(dr);
                            break;

                        case TAB_KEY_STORE:
                            dtStore.Rows.Remove(dr);
                            break;

                        case TAB_KEY_ITEM:
                            dtItem.Rows.Remove(dr);
                            break;

                        case TAB_KEY_ITEM_DESC:
                            dtItemDesc.Rows.Remove(dr);
                            break;

                        default:
                            return;
                    }
                }
                else
                {
                    dr["REC_DELETED"] = 1;
                }

            }
        }
        private decimal GetLastPrice(GridEXRow gridExRow)
        {
            if (gridExRow.Cells[QheDoituongThuoc.Columns.KieuGiamgia].Value.ToString() == "0")
            {
                return Utility.DecimaltoDbnull(gridExRow.Cells[QheDoituongThuoc.Columns.DonGia].Value,0) *
                       (100 - Utility.DecimaltoDbnull(gridExRow.Cells[QheDoituongThuoc.Columns.TyleGiamgia].Value))/100;

            }
            else
            {
                return Utility.DecimaltoDbnull(gridExRow.Cells[QheDoituongThuoc.Columns.DonGia].Value, 0) -Utility.DecimaltoDbnull(gridExRow.Cells[QheDoituongThuoc.Columns.TyleGiamgia].Value,0);
            }
        }
 private QheDoituongThuoc CreateObjectTypeService(GridEXRow gridExRow)
 {
     QheDoituongThuoc objectTypeService=new QheDoituongThuoc();
     objectTypeService.DonGia = Utility.DecimaltoDbnull(
         gridExRow.Cells[QheDoituongThuoc.Columns.DonGia].Value, 0);
     objectTypeService.PhuthuDungtuyen = Utility.DecimaltoDbnull(
         gridExRow.Cells[QheDoituongThuoc.Columns.PhuthuDungtuyen].Value, 0);
     objectTypeService.IdThuoc = Utility.Int16Dbnull(gridExRow.Cells[QheDoituongThuoc.Columns.IdThuoc].Value);
     objectTypeService.IdDoituongKcb =
         Utility.Int16Dbnull(gridExRow.Cells[QheDoituongThuoc.Columns.IdDoituongKcb].Value, -1);
     objectTypeService.TyleGiamgia =
       Utility.Int16Dbnull(gridExRow.Cells[QheDoituongThuoc.Columns.TyleGiamgia].Value, -1);
     objectTypeService.KieuGiamgia =
      Utility.sDbnull(gridExRow.Cells[QheDoituongThuoc.Columns.KieuGiamgia].Value);
     return objectTypeService;
 }
Пример #34
0
 /// <summary>
 /// hàm thực hiệnv iệc add nhóm cls vào cls đang dùng
 /// </summary>
 /// <param name="gridExRow"></param>
 private void AddNhomCLS(GridEXRow gridExRow)
 {
 }
Пример #35
0
        /// <summary>
        /// hàm thực hiệnv iệc add nhóm cls vào cls đang dùng
        /// </summary>
        /// <param name="gridExRow"></param>
        private void AddNhomCLS(GridEXRow gridExRow)
        {
            //DataRow newDr = m_dtAssignDetail.NewRow();
            //newDr[KcbChidinhclsChitiet.Columns.IdChitietchidinh] = -1;

            //newDr[KcbChidinhclsChitiet.Columns.IdChidinh] = v_AssignId;
            //newDr[KcbChidinhclsChitiet.Columns.IdDichvu] =
            //    Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.IdLoaiDvu].Value, -1);
            //ServiceDetail_Id = Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.IdDvu].Value, -1);
            //newDr[KcbChidinhclsChitiet.Columns.IdChitietdichvu] = ServiceDetail_Id;
            ////newDr[KcbChidinhclsChitiet.Columns.OriginPrice] = Utility.DecimaltoDbnull(gridExRow.Cells["Price"].Value, 0);
            //newDr[KcbChidinhclsChitiet.Columns.DiscountType] = 1;
            //newDr[DmucDichvuclsChitiet.Columns.TenChitietdichvu] = Utility.sDbnull(gridExRow.Cells["TEN_DVU"].Value, "");
            //newDr["IsNew"] = 1;
            //newDr["IsLocked"] = 0;
            //newDr[DmucDoituongkcb.Columns.IdDoituongKcb] = objLuotkham.ObjectTypeId;
            //newDr[KcbChidinhclsChitiet.Columns.DisplayOnReport] = 1;
            //newDr[KcbChidinhclsChitiet.Columns.SoLuong] = Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.SoLuong].Value, 1);
            //newDr[KcbChidinhclsChitiet.Columns.TuTuc] = 0;
            //newDr[DmucDichvucl.Columns.TenDichvu] = Utility.sDbnull(gridExRow.Cells["TEN_LOAI_DVU"].Value, "");
            //newDr[KcbChidinhclsChitiet.Columns.IdBacsiChidinh] = globalVariables.gv_StaffID;
            //IEnumerable<GridEXRow> query = from dichvu in grdServiceDetail.GetDataRows().AsEnumerable()
            //                               where
            //                                   Utility.Int32Dbnull(
            //                                       dichvu.Cells[DmucDichvuclsChitiet.Columns.IdChitietdichvu].Value) ==
            //                                   ServiceDetail_Id
            //                               select dichvu;
            //if (query.Count() > 0)
            //{
            //    GridEXRow exRow = query.FirstOrDefault();
            //    newDr[KcbChidinhclsChitiet.Columns.DonGia] = Utility.DecimaltoDbnull(exRow.Cells[.IdDichvu].Value, 0);
            //    newDr[KcbChidinhclsChitiet.Columns.PhuThu] = Utility.DecimaltoDbnull(exRow.Cells[KcbChidinhclsChitiet.Columns.PhuThu].Value, 0);
            //    newDr[KcbChidinhclsChitiet.Columns.OriginPrice] = Utility.DecimaltoDbnull(exRow.Cells["Price"].Value, 0);

            //    newDr[KcbChidinhclsChitiet.Columns.IdGoiDvu] = Utility.Int32Dbnull(exRow.Cells["ID_GOI_DVU"].Value, -1);
            //    newDr[KcbChidinhclsChitiet.Columns.TrongGoi] = Utility.Int32Dbnull(exRow.Cells["TRONG_GOI"].Value, 0);
            //}
            //else
            //{
            //    SqlQuery sqlQuery = new Select().From(LObjectTypeService.Schema)
            //        .Where(LObjectTypeService.Columns.MaDtuong).IsEqualTo(objLuotkham.MaDoiTuong)
            //        .And(LNhomDvuCl.Columns.IdDvu).IsEqualTo(ServiceDetail_Id);
            //    var objectTypeService = sqlQuery.ExecuteSingle<LObjectTypeService>();
            //    if (objectTypeService != null)
            //    {
            //        newDr[KcbChidinhclsChitiet.Columns.PhuThu] = Utility.DecimaltoDbnull(objectTypeService.Surcharge, 0);
            //        newDr[KcbChidinhclsChitiet.Columns.DonGia] = Utility.DecimaltoDbnull(objectTypeService.Surcharge, 0);
            //        newDr[KcbChidinhclsChitiet.Columns.IdGoiDvu] = -1;
            //        newDr[KcbChidinhclsChitiet.Columns.TrongGoi] = 0;
            //    }
            //}

            ////  newDr["TT"] = Utility.DecimaltoDbnull(drv[KcbChidinhclsChitiet.Columns.PhuThu], 0) + Utility.DecimaltoDbnull(drv["Price"], 0);

            //m_dtAssignDetail.Rows.Add(newDr);
        }
Пример #36
0
        /// <summary>
        /// Update the group text with the amount of checked villages / total villages
        /// </summary>
        private void UpdateGroupRecordText(GridEXRow row)
        {
            if (row.RowType == RowType.GroupHeader)
            {
                // Set group totals
                int totalRecords = row.GetRecordCount();
                int totalChecked = row.GetChildRecords().Count(x => x.CheckState == RowCheckState.Checked);
                row.GroupCaption = string.Format("{0} ({1} / {2} villages)", row.GroupValue, totalChecked, totalRecords);

                GridEXRow[] children = row.GetChildRows();
                foreach (var child in children)
                {
                    UpdateGroupRecordText(child);
                }
            }
        }
Пример #37
0
 private void InitColumnMark( GridEXRow row )
 {
     object isChecked = ((DataRowView)row.DataRow).Row[ ChangeHistoryDataSet.Marked ];
     if( ! Convert.IsDBNull( isChecked ) )
     {
         row.IsChecked = Convert.ToBoolean( isChecked );
     }
 }
        private void RowDelete(GridEXRow row)
        {
            NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

            if (functionBreakpoint != null)
            {
                RemoveBreakpoint(functionBreakpoint);
            }

            NuGenHelperFunctions.TaggedObjects.Remove((String)row.Cells[1].Value + (String)row.Cells[2].Value);
        }
		public void AddBreakpoint(NuGenBreakpointInformation breakpoint)
		{
            breakpointsGrid.AddItem();
            GridEXRow row = breakpointsGrid.GetRow(breakpointsGrid.RowCount - 1);
            row.BeginEdit();
            test = row;

			row.Cells[0].Value = (breakpoint.State == BreakpointState.Active);
			row.Cells[1].Value = breakpoint.DisplayName;
			row.Cells[2].Value = breakpoint.OffsetValue;
            NuGenHelperFunctions.TaggedObjects.Add((String)row.Cells[1].Value + (String)row.Cells[2].Value, breakpoint);

            row.EndEdit();
		}
Пример #40
0
        private void AddNhomCLS(GridEXRow gridExRow)
        {
            DataRow newDr = m_dtAssignDetail.NewRow();
            newDr[TAssignDetail.Columns.AssignDetailId] = -1;

            newDr[TAssignDetail.Columns.AssignId] = v_AssignId;
            newDr[TAssignDetail.Columns.ServiceId] =
                Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.IdLoaiDvu].Value, -1);
            ServiceDetail_Id = Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.IdDvu].Value, -1);
            newDr[TAssignDetail.Columns.ServiceDetailId] = ServiceDetail_Id;
            //newDr[TAssignDetail.Columns.OriginPrice] = Utility.DecimaltoDbnull(gridExRow.Cells["Price"].Value, 0);
            newDr[TAssignDetail.Columns.DiscountType] = 1;
            newDr["ServiceDetail_Name"] = Utility.sDbnull(gridExRow.Cells["TEN_DVU"].Value, "");
            newDr["IsNew"] = 1;
            newDr["IsLocked"] = 0;
            newDr["ObjectType_ID"] = 1;
            newDr[TAssignDetail.Columns.DisplayOnReport] = 1;
            newDr["Quantity"] = Utility.Int32Dbnull(gridExRow.Cells[LNhomDvuCl.Columns.SoLuong].Value, 1);
            newDr[TAssignDetail.Columns.IsPayment] = 0;
            newDr["Service_Name"] = Utility.sDbnull(gridExRow.Cells["TEN_LOAI_DVU"].Value, "");
            newDr[TAssignDetail.Columns.DiagPerson] = globalVariables.gv_StaffID;
            IEnumerable<GridEXRow> query = from dichvu in grdServiceDetail.GetDataRows().AsEnumerable()
                where
                    Utility.Int32Dbnull(
                        dichvu.Cells[LServiceDetail.Columns.ServiceDetailId].Value) ==
                    ServiceDetail_Id
                select dichvu;
            if (query.Count() > 0)
            {
                GridEXRow exRow = query.FirstOrDefault();
                newDr[TAssignDetail.Columns.DiscountPrice] = Utility.DecimaltoDbnull(exRow.Cells["LastPrice"].Value, 0);
                newDr[TAssignDetail.Columns.SurchargePrice] = Utility.DecimaltoDbnull(exRow.Cells["Surcharge"].Value, 0);
                newDr[TAssignDetail.Columns.OriginPrice] = Utility.DecimaltoDbnull(exRow.Cells["Price"].Value, 0);

                newDr[TAssignDetail.Columns.IdGoiDvu] = Utility.Int32Dbnull(exRow.Cells["ID_GOI_DVU"].Value, -1);
                newDr[TAssignDetail.Columns.TrongGoi] = Utility.Int32Dbnull(exRow.Cells["TRONG_GOI"].Value, 0);
            }
            else
            {
                SqlQuery sqlQuery = new Select().From(LObjectTypeService.Schema)
                    .Where(LObjectTypeService.Columns.MaDtuong).IsEqualTo("DV")
                    .And(LNhomDvuCl.Columns.IdDvu).IsEqualTo(ServiceDetail_Id);
                var objectTypeService = sqlQuery.ExecuteSingle<LObjectTypeService>();
                if (objectTypeService != null)
                {
                    newDr[TAssignDetail.Columns.SurchargePrice] = Utility.DecimaltoDbnull(objectTypeService.Surcharge, 0);
                    newDr[TAssignDetail.Columns.DiscountPrice] = Utility.DecimaltoDbnull(objectTypeService.Surcharge, 0);
                    newDr[TAssignDetail.Columns.IdGoiDvu] = -1;
                    newDr[TAssignDetail.Columns.TrongGoi] = 0;
                }
            }

            //  newDr["TT"] = Utility.DecimaltoDbnull(drv["Surcharge"], 0) + Utility.DecimaltoDbnull(drv["Price"], 0);

            m_dtAssignDetail.Rows.Add(newDr);
        }
 private QheDoituongDichvucl CreateObjectTypeService(GridEXRow gridExRow)
 {
     QheDoituongDichvucl objectTypeService=new QheDoituongDichvucl();
     objectTypeService.DonGia = Utility.DecimaltoDbnull(
         gridExRow.Cells[QheDoituongDichvucl.Columns.DonGia].Value, 0);
     objectTypeService.PhuthuDungtuyen = Utility.DecimaltoDbnull(
         gridExRow.Cells[QheDoituongDichvucl.Columns.PhuthuDungtuyen].Value, 0);
     objectTypeService.IdChitietdichvu = Utility.Int16Dbnull(gridExRow.Cells[QheDoituongDichvucl.Columns.IdChitietdichvu].Value);
     objectTypeService.MotaThem = gridExRow.Cells[QheDoituongDichvucl.Columns.MotaThem].Value.ToString();
     objectTypeService.IdDoituongKcb =
         Utility.Int16Dbnull(gridExRow.Cells[QheDoituongDichvucl.Columns.IdDoituongKcb].Value, -1);
     objectTypeService.TyleGiam =
       Utility.Int16Dbnull(gridExRow.Cells[QheDoituongDichvucl.Columns.TyleGiam].Value, -1);
     objectTypeService.KieuGiamgia =
      Utility.ByteDbnull(gridExRow.Cells[QheDoituongDichvucl.Columns.KieuGiamgia].Value);
     return objectTypeService;
 }
Пример #42
0
		private void DisplayWatchExpression(GridEXRow watchRow)
		{
			NuGenIValueFormatter watchValueFormatter = null;
			NuGenExpressionValueRefresher expressionRefresher = null;

			try
			{
				NuGenParser parser = new NuGenParser();
				string watchExpression = (string)watchRow.Cells[0].Value;
				List<NuGenBaseExpression> expressions = parser.Parse(watchExpression);
				expressionRefresher = new NuGenExpressionValueRefresher(expressions, ActiveFrameRefresher, EvaluationContext.EvaluationHandler, watchExpression);

				watchValueFormatter = ValueDisplayer.CreateSimpleFormatter(expressionRefresher.GetRefreshedValue());
			}
			catch (NuGenParserException parserException)
			{
				watchValueFormatter = new NuGenErrorValueFormatter("Parser exception", parserException.Message);
			}
			catch (NuGenEvaluationException evaluationException)
			{
				watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", evaluationException.Message);
			}
			catch (NuGenEvaluationHandlerException evaluationHandlerException)
			{
				watchValueFormatter = new NuGenErrorValueFormatter("Evaluation running exception", evaluationHandlerException.Message);
			}
			catch (NugenMissingModuleException missingModuleException)
			{
				watchValueFormatter = new NuGenMissingModuleFormatter(missingModuleException.MissingModule);
			}
			catch (InvalidOperationException invalidOperationException)
			{
				watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", invalidOperationException.Message);
			}
			catch (Exception exception)
			{
				watchValueFormatter = new NuGenErrorValueFormatter("Unexpected exception", exception.Message);
			}

			if (watchValueFormatter != null)
			{
				watchValueFormatter.ValueRefresher = expressionRefresher;
				watchRow.Cells[1].Value = watchValueFormatter.GetFormattedString(NuGenSettings.Instance.DisplayHexaNumbers);
                NuGenHelperFunctions.TaggedObjects[(int)watchRow.Cells[2].Value] = watchValueFormatter;				
			}
		}
        private void RemoveDetails(GridEXRow gridExRow)
        {
            string manhacungcap = "";
                string NgayHethan = "";
                string solo = "";
                int id_thuoc = -1;
                decimal Dongia = 0m;
                decimal Gianhap = 0m;
                decimal Giaban = 0m;
                Int32 soluong = 0;
                decimal vat = 0m;
                int isHetHan = 0;
                long IdThuockho = 0;
                string ten_thuoc = "";
            try
            {
                DateTime NgayNhap = Convert.ToDateTime(gridExRow.Cells[TThuockho.Columns.NgayNhap].Value).Date;
                decimal GiaBhyt = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].Value, 0);
                ten_thuoc = Utility.sDbnull(gridExRow.Cells["TEN_THUOC"].Value);
                NgayHethan = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
                solo = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
                id_thuoc = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
                IdThuockho = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuockho].Value, -1);
                Dongia = Utility.DecimaltoDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.DonGia].Value, 0);
                Gianhap = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
                Giaban = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
                soluong = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG"].Value, 0);
                vat = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.Vat].Value, 0);
                isHetHan = Utility.Int32Dbnull(gridExRow.Cells["IsHetHan"].Value, 0);
                manhacungcap = Utility.sDbnull(gridExRow.Cells[TThuockho.Columns.MaNhacungcap].Value, 0);
                DataRow[] arrDr = m_dtDataThuocKho.Select(TPhieuNhapxuatthuocChitiet.Columns.IdThuockho + "=" + IdThuockho.ToString());
                if (arrDr.Length <= 0)
                {
                    DataRow drv = m_dtDataThuocKho.NewRow();

                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuoc] = id_thuoc;
                    drv["ten_donvitinh"] = Utility.sDbnull(gridExRow.Cells["ten_donvitinh"].Value);
                    drv["IsHetHan"] = isHetHan;
                    DmucThuoc objLDrug = DmucThuoc.FetchByID(id_thuoc);
                    if (objLDrug != null)
                    {
                        drv[DmucThuoc.Columns.TenThuoc] = Utility.sDbnull(objLDrug.TenThuoc);
                        drv[DmucThuoc.Columns.HamLuong] = Utility.sDbnull(objLDrug.HamLuong);
                        drv[DmucThuoc.Columns.HoatChat] = Utility.sDbnull(objLDrug.HoatChat);
                        drv[DmucThuoc.Columns.NuocSanxuat] = Utility.sDbnull(objLDrug.NuocSanxuat);
                        drv[DmucThuoc.Columns.HangSanxuat] = Utility.sDbnull(objLDrug.HangSanxuat);
                    }
                    drv[TPhieuNhapxuatthuocChitiet.Columns.Vat] = vat;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaNhap] = Gianhap;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.MaNhacungcap] = manhacungcap;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoLo] = solo;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuockho] = IdThuockho;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBan] = Giaban;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.DonGia] = Dongia;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap] = NgayNhap;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBhyt] = GiaBhyt;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong] = soluong;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = Gianhap * soluong;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau] = 0;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = NgayHethan;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu] = -1;
                    m_dtDataThuocKho.Rows.Add(drv);

                }
                else
                {
                    arrDr[0]["SO_LUONG"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluong;
                    arrDr[0]["SO_LUONG_THAT"] = arrDr[0]["SO_LUONG"];
                    m_dtDataThuocKho.AcceptChanges();
                }
                gridExRow.Delete();
                grdPhieuXuatChiTiet.UpdateData();
                grdPhieuXuatChiTiet.Refresh();
                m_dtDataPhieuChiTiet.AcceptChanges();
                m_dtDataThuocKho.AcceptChanges();

                ModifyCommand();
            }
            catch (Exception ex)
            {
                Utility.CatchException(string.Format("Lỗi khi thanh lý thanh lý thuốc {0}:\n", ten_thuoc) , ex);
            }
        }
Пример #44
0
 private void InitColumnMark( GridEXRow [] rows )
 {
     foreach( GridEXRow row in rows )
     {
         InitColumnMark( row );
     }
 }
Пример #45
0
 // This method exists because ActAsSelector columns cannot be bound
 // to columns in the data source. (http://www.janusys.com/JanusForums/ForumMessage.aspx?message=33397&preview=2)
 private void SyncColumnMark( GridEXRow row )
 {
     ((DataRowView)row.DataRow).Row[ ChangeHistoryDataSet.Marked ] = row.IsChecked;
 }
Пример #46
0
        /// <summary>
        /// Hàm lấy dữ liệu và bắt đầu Dowork Print
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="strPatientId"></param>
        private void PrintAction(GridEXRow[] arrCheckedRow)
        {
            try
            {
                string strPatientId = string.Join(",", (from grdEx in arrCheckedRow
                                                        select Utility.sDbnull(grdEx.Cells["Patient_ID"].Value)).ToArray
                                                           ());

                StrTestTypeId = GetIdString(DtTestType, grdTestType, "TestType_ID", "-3");

                ////Lấy danh sách các test
                //dtTestInfo =
                //    SPs.SpGetTestInfoByPatientForPrintingManyIDV3(strPatientId, StrTestTypeId, dtpFromDate.Value.Date,
                //                                                  dtpToDate.Value.Date.Date.AddDays(1).
                //                                                      AddMilliseconds(
                //                                                          -2)).GetDataSet().Tables[0];

                ////Lấy danh sách bệnh nhân và các kết quả
                //string vTestId = string.Join(",",
                //                             (from dr in dtTestInfo.AsEnumerable() select Utility.sDbnull(dr.Field<object>("Test_ID")))
                //                                 .ToArray());
                DataTable dtPatientInfo =
                    SPs.GtvtGetTestResultForPrintingManyV2FromDateToDate(strPatientId, StrTestTypeId,
                                                                         dtpFromDate.Value.Date.ToString("yyyy/MM/dd"),
                                                                         dtpToDate.Value.Date.ToString("yyyy/MM/dd")).
                        GetDataSet().Tables[0];

                foreach (GridEXRow row in arrCheckedRow)
                {
                    DataRow dataRow = dtPrintingStatus.NewRow();
                    dataRow["Barcode"] = Utility.sDbnull(row.Cells["Barcode"].Value);
                    dataRow["Patient_Name"] = Utility.sDbnull(row.Cells["Patient_Name"].Value);
                    dataRow["Patient_ID"] = Utility.sDbnull(row.Cells["Patient_ID"].Value);
                    List<DataRow> dt = (from dr in dtPatientInfo.AsEnumerable()
                                        where
                                            Utility.Int32Dbnull(dr.Field<object>("Patient_ID")) ==
                                            Utility.Int32Dbnull(row.Cells["Patient_ID"].Value)
                                        select dr).ToList();
                    dataRow["PrinterName"] = Utility.sDbnull(cboPrinter.SelectedValue);
                    dataRow["PrintData"] = dt;
                    dataRow["RowCount"] = dt.Count;
                    dtPrintingStatus.Rows.Add(dataRow);
                }
                grdPrintingStatus.DataSource = dtPrintingStatus;

                if (!WorkerPrint.IsBusy)
                {
                    WorkerPrint.RunWorkerAsync();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi: " + ex);
            }
        }
Пример #47
0
        private void XoaDinhduong(GridEXRow gridExRow)
        {
            try
            {
                string s = "";
                List<int> lstId = new List<int>();
                string stempt = "";
                int Id = Utility.Int32Dbnull(gridExRow.Cells[NoitruPhieudinhduong.Columns.Id].Value, 0m);
                s += "," + Id.ToString();
                lstId.Add(Id);
                grdChandoan.Delete();
                grdChandoan.UpdateData();

                _KCB_KEDONTHUOC.NoitruXoaDinhduong(s);
                XoaDinhduong(lstId);
                m_dtChedoDinhduong.AcceptChanges();
            }
            catch (Exception ex)
            {

                Utility.CatchException(ex);
            }
        }
Пример #48
0
 private VillageGridExRow GetVillageRow(GridEXRow row)
 {
     Debug.Assert(row.RowType == RowType.Record);
     return (VillageGridExRow) row.DataRow;
 }
Пример #49
0
		private void FillMessage(GridEXRow selectedRow)
		{
			try
			{
				// Have a delay before we actually retrieve the message
				System.Threading.Thread.Sleep(200);

				if (selectedRow.RowIndex == -1)
				{
					return;
				}

				// Check that the event id is still the same as the one selected
				uint thisIndex = (uint)selectedRow.Cells["Index"].Value;

				if (thisIndex == lastIndex)
				{
					string message = String.Empty;

					if (
						(selectedRow.Cells["Message"].Value == DBNull.Value) ||						
						(((string)selectedRow.Cells["Message"].Value) == String.Empty)
					   )
					{
						// This message has not been cached yet.  Retrieve it.
						try
						{
							/*
							int index = System.Convert.ToInt32(thisIndex - smallestRecordNumber);
							message = log.Entries[index].Message;
							*/

							if (!localMachine)
							{
								// Set the event detail text to Loading...
								if (this.InvokeRequired)
								{
									this.Invoke(new StringDelegate(SetEventDetailText), new object[] { "Loading..." });
								}
								else
								{
									SetEventDetailText("Loading...");
								}
							}

							message = GetEventLogItemMessage(thisIndex);
						}
						catch
						{
							message = "Message not found.";
						}
					}
					else
					{
						message = (string)selectedRow.Cells[6].Value;
					}

					if (this.InvokeRequired)
					{
                        selectedRow.BeginEdit();
						this.Invoke(new RowStringDelegate(UpdateEventDetailText), new object[] { selectedRow, message });
                        selectedRow.EndEdit();
					}
					else
					{
						UpdateEventDetailText(selectedRow, message);
					}
				}
			}
			catch (ObjectDisposedException) { }
		}
Пример #50
0
        void ChangeMenu(GridEXRow _row)
        {
            mnuTutuc.Text = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TuTuc) == "1" ? "Giá đối tượng" : "Tự túc";
            mnuTutuc.Tag = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TuTuc);
            mnuTronggoi.Text = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TrongGoi) == "1" ? "Ngoài gói" : "Trong gói";
            mnuTronggoi.Tag = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TrongGoi);

            mnuCancel.Text = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TrangthaiHuy) == "1" ? "Sử dụng dịch vụ" : "Hủy dịch vụ";
            mnuCancel.Tag = Utility.GetValueFromGridColumn(_row, KcbThanhtoanChitiet.Columns.TrangthaiHuy);
        }
Пример #51
0
		private void UpdateEventDetailText(GridEXRow row, string message)
		{
			row.Cells[6].Value = message;
			tbEventDetail.Text = message;
		}
        private void AddDetailNext(GridEXRow gridExRow)
        {
            try
            {
                string manhacungcap = "";
                string NgayHethan = "";
                string solo = "";
                int id_thuoc = -1;
                decimal GiaNhap = 0m;
                decimal Giaban = 0m;
                decimal Dongia = 0m;
                Int32 soluongchuyen = 0;
                decimal vat = 0m;
                int isHetHan = 0;
                long IdThuockho = 0;
                int soluongthat = 0;
                int tongsoluongchuyen = 0;
                DateTime NgayNhap = DateTime.Now;
                decimal GiaBhyt = 0m;
                tongsoluongchuyen = 0;
                soluongthat = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_THAT"].Value);
                soluongchuyen = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_CHUYEN"].Value, 0);
                if (soluongchuyen > 0)
                {
                    NgayHethan = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
                    solo = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
                    id_thuoc = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
                    Dongia = Utility.DecimaltoDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.DonGia].Value, 0);
                    GiaNhap = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
                    Giaban = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
                    GiaBhyt = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].Value, 0);
                    NgayNhap = Convert.ToDateTime(gridExRow.Cells[TThuockho.Columns.NgayNhap].Value).Date;
                    vat = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.Vat].Value, 0);
                    isHetHan = Utility.Int32Dbnull(gridExRow.Cells["IsHetHan"].Value, 0);
                    manhacungcap = Utility.sDbnull(gridExRow.Cells[TThuockho.Columns.MaNhacungcap].Value, 0);
                    IdThuockho = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuockho].Value, -1);
                    DataRow[] arrDr = m_dtDataPhieuChiTiet.Select(TPhieuNhapxuatthuocChitiet.Columns.IdThuockho + "=" + IdThuockho.ToString());
                    if (arrDr.Length <= 0)
                    {
                        DataRow drv = m_dtDataPhieuChiTiet.NewRow();
                        drv[TPhieuNhapxuatthuocChitiet.Columns.MotaThem] = String.Empty;

                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuoc] = id_thuoc;
                        drv["ten_donvitinh"] = Utility.sDbnull(gridExRow.Cells["ten_donvitinh"].Value);
                        drv["IsHetHan"] = isHetHan;
                        DmucThuoc objLDrug = DmucThuoc.FetchByID(id_thuoc);
                        if (objLDrug != null)
                        {
                            drv[DmucThuoc.Columns.TenThuoc] = Utility.sDbnull(objLDrug.TenThuoc);
                            drv[DmucThuoc.Columns.HamLuong] = Utility.sDbnull(objLDrug.HamLuong);
                            drv[DmucThuoc.Columns.HoatChat] = Utility.sDbnull(objLDrug.HoatChat);
                            drv[DmucThuoc.Columns.NuocSanxuat] = Utility.sDbnull(objLDrug.NuocSanxuat);
                            drv[DmucThuoc.Columns.HangSanxuat] = Utility.sDbnull(objLDrug.HangSanxuat);
                        }
                        drv[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap] = NgayNhap;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBhyt] = GiaBhyt;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaPhuthuDungtuyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuDungtuyen].Value, 0);
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaPhuthuTraituyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuTraituyen].Value, 0);

                        drv[TPhieuNhapxuatthuocChitiet.Columns.Vat] = vat;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.MotaThem] = txtLydohuy.Text;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaNhap] = GiaNhap;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.MaNhacungcap] = manhacungcap;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoLo] = solo;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuockho] = IdThuockho;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBan] = Giaban;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdChuyen] = IdThuockho;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong] = soluongchuyen;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.DonGia] = Dongia;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = Dongia * soluongchuyen;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau] = 0;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = NgayHethan;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu] = -1;
                        tongsoluongchuyen = soluongchuyen;
                        m_dtDataPhieuChiTiet.Rows.Add(drv);
                    }
                    else
                    {

                        arrDr[0]["SO_LUONG"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluongchuyen;
                        arrDr[0][TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = Dongia * Utility.Int32Dbnull(arrDr[0]["SO_LUONG"], 0);
                        tongsoluongchuyen = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]);
                        m_dtDataPhieuChiTiet.AcceptChanges();

                    }
                    //Update lại dữ liệu từ kho xuất
                    gridExRow.BeginEdit();
                    gridExRow.Cells["SO_LUONG"].Value = soluongthat - tongsoluongchuyen;
                    gridExRow.Cells["SO_LUONG_CHUYEN"].Value = 0;
                    gridExRow.IsChecked = false;
                    gridExRow.EndEdit();
                }
                grdKhoXuat.UpdateData();
                m_dtDataThuocKho.AcceptChanges();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi chuyển thuốc:\n" + ex.Message);
            }
        }
Пример #53
0
 private void SetRowStyle( GridEXRow row )
 {
     // so far, there's just one FormatStyles entry, so we just grab it
     // using a magic number.
     row.RowStyle = row.IsChecked ? versionGrid.FormatStyles[0] : null;
 }