Beispiel #1
0
        private void ApplyFilters()
        {
            GridEXFilterCondition condition = new GridEXFilterCondition();
            GridEXColumn          column    = new GridEXColumn();

            gridExAgreementsListGrouped.RemoveFilters();

            string ktm           = gridExDescriptorChanges.CurrentRow.Cells["KTM"].Value.ToString();
            string descriptorOld = gridExDescriptorChanges.CurrentRow.Cells["DESKRYPOTR_OLD"].Value.ToString();
            string findString    = string.Format("{0}|{1};", ktm, descriptorOld);

            column = gridExAgreementsListGrouped.RootTable.Columns["Find"];
            condition.AddCondition(new GridEXFilterCondition(column, ConditionOperator.Contains, findString));

            gridExAgreementsListGrouped.RootTable.ApplyFilter(condition);
        }
    protected override void OnTextBoxTextChanged(EventArgs e)
    {
        GridEXFilterCondition internalFilter = new GridEXFilterCondition();

        String str = TextBox.Text;

        foreach (GridEXColumn column in DropDownList.Columns)
        {
            if (!column.Visible)
            {
                continue;
            }

            GridEXFilterCondition filterCondition = new GridEXFilterCondition(column, ConditionOperator.Contains, str);

            internalFilter.AddCondition(LogicalOperator.Or, filterCondition);
        }

        DropDownList.ApplyFilter(internalFilter);
    }
Beispiel #3
0
        /// <summary>
        /// Lọc dữ liệu khi bắt đầu load data
        /// </summary>
        private void SetDefaultFilter()
        {
            try
            {
                if (FilterParameter != null && FilterParameter.Count > 0 && grdData != null)
                {
                    GridEXFilterCondition conditionsub;
                    GridEXFilterCondition condition = new GridEXFilterCondition();
                    int dem = 0;
                    foreach (KeyValuePair <object, object> arrCondition in FilterParameter)
                    {
                        conditionsub        = new GridEXFilterCondition();
                        conditionsub.Column = GrdData.RootTable.Columns[arrCondition.Key.ToString().Trim()];
                        conditionsub.Value1 = arrCondition.Value.ToString().Trim();

                        if (dem > 0)
                        {
                            condition.AddCondition(LogicalOperator.And, conditionsub);
                        }
                        else
                        {
                            condition = conditionsub;
                        }
                        dem = dem + 1;
                    }
                    condition.ConditionOperator   = ConditionOperator.Contains;
                    filterEditor1.FilterCondition = condition;
                    if (filterEditor1.FilterCondition != null)
                    {
                        filterEditor1.FilterCondition.ConditionOperator = Janus.Data.ConditionOperator.Contains;
                    }
                    filterEditor1.AutomaticHeightResize = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Lỗi Exception (GxFilter, SetDefaultFilter)", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void SetSumTotalProperties()
        {
            try
            {
                if (objLuotkham == null)
                {
                    objLuotkham = Utility.getKcbLuotkham(Utility.Int64Dbnull(txtPatient_ID.Text), Utility.DoTrim(txtPatient_Code.Text));
                }
                string ErrMsg = "";
                decimal newBHYT = Utility.DecimaltoDbnull(txtPtramBHChiTra.Text, 0);
                _THANHTOAN.TinhlaitienBHYTtruocThanhtoan(m_dtChiPhiThanhtoan, TaophieuThanhtoan(), objLuotkham, Taodulieuthanhtoanchitiet(ref ErrMsg), ref newBHYT);
                txtPtramBHChiTra.Text = newBHYT.ToString();
                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_thanhtoan");
                GridEXColumn gridExColumn = getGridExColumn(grdThongTinChuaThanhToan, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT = getGridExColumn(grdThongTinChuaThanhToan, "TT");
                GridEXColumn gridExColumnTT_chietkhau = getGridExColumn(grdThongTinChuaThanhToan, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT = getGridExColumn(grdThongTinChuaThanhToan, "TT_BHYT");
                GridEXColumn gridExColumnTTBN = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN");
                GridEXColumn gridExColumntutuc = getGridExColumn(grdThongTinChuaThanhToan, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu = getGridExColumn(grdThongTinChuaThanhToan,
                    "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                  new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                   new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                   new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdThongTinChuaThanhToan,"bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdThongTinChuaThanhToan, "bnhan_chitra");

                //decimal BN_KHONGTUTUC =
                //  Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum,
                //      gridExFilterCondition_khong_Tutuc));
                //decimal TT =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT, AggregateFunction.Sum,gridExFilterConditiontrangthai_huy));
                //decimal TT_Chietkhau =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));

                //decimal TT_KHONG_PHUTHU =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));
                //decimal TT_BHYT =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                //        gridExFilterConditiontrangthai_huy));
                //decimal TT_BN =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //        gridExFilterConditiontrangthai_huy));
                //decimal TT_BN_DaTT =
                //   Utility.DecimaltoDbnull(grdThongTinDaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));
                //Chuathanhtoan =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //       gridExFilterChuathanhtoan));

                ////Tạm bỏ
                ////decimal PtramBHYT = 0;
                ////_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                //decimal PhuThu =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                //decimal TuTuc =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                //        gridExFilterConditionTutuc));

                decimal BN_KHONGTUTUC = 0m;
                decimal TT = 0m;
                decimal TT_Chietkhau = 0m;

                decimal TT_KHONG_PHUTHU = 0m;
                decimal TT_BHYT = 0m;
                decimal TT_BN = 0m;
                decimal TT_BN_DaTT = 0m;
                Chuathanhtoan = 0m;

                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu = 0m;
                decimal TuTuc = 0m;
                foreach (DataRowView drv in m_dtChiPhiThanhtoan.DefaultView)
                {
                    if (Utility.Int32Dbnull(drv["tinh_chiphi"], 0) == 1)
                    {
                        if (Utility.Int32Dbnull(drv["tu_tuc"], 0) == 0)
                            BN_KHONGTUTUC += Utility.DecimaltoDbnull(drv["TT_BN_KHONG_TUTUC"], 0);
                        if (Utility.Int32Dbnull(drv["trangthai_huy"], 0) == 0)
                        {
                            TT += Utility.DecimaltoDbnull(drv["TT"], 0);
                            TT_Chietkhau += Utility.DecimaltoDbnull(drv[KcbThanhtoanChitiet.Columns.TienChietkhau], 0);
                            TT_KHONG_PHUTHU += Utility.DecimaltoDbnull(drv["TT_KHONG_PHUTHU"], 0);

                            TT_BHYT += Utility.DecimaltoDbnull(drv["TT_BHYT"], 0);
                            TT_BN += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                            TT_BN_DaTT += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                        }
                        if (Utility.Int32Dbnull(drv["trangthai_thanhtoan"], 0) == 0)
                            Chuathanhtoan += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                        PhuThu += Utility.DecimaltoDbnull(drv["TT_PHUTHU"], 0);
                        if (Utility.Int32Dbnull(drv["tu_tuc"], 0) == 1)
                            TuTuc += Utility.DecimaltoDbnull(drv["TT_TUTUC"], 0);
                    }
                }
                txtTongChiPhi.Text = Utility.sDbnull(TT);
                TT_KHONG_PHUTHU -= TuTuc;
                txtTongtienDCT.Text = objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull( TT_BHYT  +BN_KHONGTUTUC);// objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull(TT_KHONG_PHUTHU);
                txtPhuThu.Text = Utility.sDbnull(PhuThu);
                txtTuTuc.Text = Utility.sDbnull(TuTuc);
                //decimal BHCT = TongChiphiBHYT*PtramBHYT/100;
                txtBHCT.Text = Utility.sDbnull(TT_BHYT, "0");
                decimal BNCT = BN_KHONGTUTUC;
                txtBNCT.Text = Utility.sDbnull(BNCT);
                decimal BNPhaiTra = BNCT + Utility.DecimaltoDbnull(txtTuTuc.Text, 0) +
                                    Utility.DecimaltoDbnull(txtPhuThu.Text);
                txtBNPhaiTra.Text = Utility.sDbnull(TT_BN);
                TinhToanSoTienPhaithu();
                decimal Tong_Tamung = 0;
                if (ucTamung1.m_dtTamung != null)
                {
                    Tong_Tamung = Utility.DecimaltoDbnull(ucTamung1.m_dtTamung.Compute("SUM(so_tien)", "1=1"), 0);
                    if (Math.Abs(Tong_Tamung) != 0)
                    {
                        decimal chenhlech = Chuathanhtoan - Tong_Tamung;
                        if (cmdHoanung.Tag.ToString() == "1")//Đã hoàn ứng
                            chenhlech = 0;
                        if (chenhlech > 0)
                        {
                            lblThuathieu.Text = "BN Nộp tiền";
                            txtThuathieu.Text = chenhlech.ToString();
                        }
                        else
                        {
                            lblThuathieu.Text = "Trả lại BN";
                            txtThuathieu.Text = Math.Abs(chenhlech).ToString();
                        }
                    }
                }

                if (Tong_Tamung == 0)
                {
                    lblThuathieu.Text = "BN Nộp tiền";
                    txtThuathieu.Text = txtSoTienCanNop.Text;
                }
                ModifyCommand();
            }
            catch
            { }
        }
Beispiel #5
0
        private void ApplyTribunalMemberFilter()
        {
            // code to apply filter criteria to memmebrs list
            if (CurrentRow() != null)
            {
                grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].ApplyFilter(null); // clear filter

                GridEXFilterCondition filtTribunalMember = new GridEXFilterCondition();

                if (this.chkLanguage.Checked) // add language filter
                {
                    if (CurrentRow().FileLanguageCode == "F")
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearFre"],
                                                                                  ConditionOperator.Equal, true));
                    }
                    else if (CurrentRow().FileLanguageCode == "E")
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearEng"],
                                                                                  ConditionOperator.Equal, true));
                    }
                    else
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearFre"],
                                                                                  ConditionOperator.Equal, true));
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["CanHearEng"],
                                                                                  ConditionOperator.Equal, true));
                    }
                }

                if (this.chkTraining.Checked) // add training filter
                {
                    // charter condition
                    if (CurrentRow().IsCharter)
                    {
                        filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["TrainedCharter"],
                                                                                  ConditionOperator.Equal, true));
                    }

                    // program & benefit condition
                    if (!CurrentRow().IsAccountIdNull())
                    {
                        atLogic.ObjectBE obe = myAtMng.GetCodeTableBE("AccountType");
                        if (obe.myDT.Rows.Count == 0)
                        {
                            obe.Load();
                        }
                        CodesDB.AccountTypeDataTable atdt = (CodesDB.AccountTypeDataTable)obe.myDT;
                        CodesDB.AccountTypeRow       atr  = atdt.FindByAccountTypeId(CurrentRow().AccountId);

                        string trainedByProgramColumn = "";

                        switch (atr.ProgramID)
                        {
                        case 3:     // EI
                            trainedByProgramColumn = "TrainedEI";
                            break;

                        case 8:     // CPP
                            trainedByProgramColumn = "TrainedCPP";
                            break;

                        case 9:     // OAS
                            trainedByProgramColumn = "TrainedOAS";
                            break;
                        }

                        if (trainedByProgramColumn != "")
                        {
                            filtTribunalMember.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns[trainedByProgramColumn],
                                                                                      ConditionOperator.Equal, true));
                        }
                    }
                }

                if (this.chkLocation.Checked) // add location filter
                {
                    var memberId = new List <int>();

                    if (!CurrentRow().IsOfficeIdNull())
                    {
                        int selectedSCOfficeId = CurrentRow().OfficeId;

                        // get service centre latitude and longitude
                        lmDatasets.MemberManagement.OfficeSCListRow scr = myMemMng.DB.OfficeSCList.FindByOfficeId(selectedSCOfficeId);// myAtMng.OfficeMng.GetServiceCentre().Load(selectedSCOfficeId);

                        if (!scr.IsLatitudeNull() && !scr.IsLongitudeNull())
                        {
                            // get member postal code
                            double distance;

                            maxDistance = (int)maxDistanceEditBox.Value;

                            foreach (MemberManagement.MemberListAssignmentFilterRow mlafr in mListAssignmentFilter)
                            {
                                if (!mlafr.IsLatitudeNull())
                                {
                                    distance = myAtMng.GetPostalCodeLocation().CalculateDistance((double)mlafr.Latitude, (double)mlafr.Longitude, (double)scr.Latitude, (double)scr.Longitude);
                                    if (distance >= 0 && distance <= maxDistance)
                                    {
                                        memberId.Add(mlafr.OfficerId);
                                    }
                                }
                            }
                        }
                    }

                    if (memberId.Count == 0)
                    {
                        memberId.Add(-1);
                    }

                    GridEXFilterCondition filtLocation = new GridEXFilterCondition();
                    foreach (int memID in memberId)
                    {
                        if (filtLocation.Conditions.Count == 0)
                        {
                            filtLocation.AddCondition(new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["OfficerId"], ConditionOperator.Equal, memID));
                        }
                        else
                        {
                            filtLocation.AddCondition(LogicalOperator.Or, new GridEXFilterCondition(grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].Columns["OfficerId"], ConditionOperator.Equal, memID));
                        }
                    }
                    filtTribunalMember.AddCondition(filtLocation);
                }

                // apply filter only if conditions exist
                if (filtTribunalMember.Conditions.Count > 0)
                {
                    grexAppealsReadyForAssignment.DropDowns["ddMemberListAssignmentFilter"].ApplyFilter(filtTribunalMember);
                }
            }
        }
        private void SetSumTotalProperties()
        {
            try
            {
                if (objLuotkham == null)
                {
                    objLuotkham = CreatePatientExam();
                }
                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_thanhtoan");
                GridEXColumn gridExColumn = getGridExColumn(grdThongTinChuaThanhToan, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT = getGridExColumn(grdThongTinChuaThanhToan, "TT");
                GridEXColumn gridExColumnTT_chietkhau = getGridExColumn(grdThongTinChuaThanhToan, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT = getGridExColumn(grdThongTinChuaThanhToan, "TT_BHYT");
                GridEXColumn gridExColumnTTBN = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN");
                GridEXColumn gridExColumntutuc = getGridExColumn(grdThongTinChuaThanhToan, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu = getGridExColumn(grdThongTinChuaThanhToan,
                    "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                  new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                   new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                   new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdThongTinChuaThanhToan,
                    "bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdThongTinChuaThanhToan, "bnhan_chitra");
                decimal BN_KHONGTUTUC =
                  Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum),
                      gridExFilterCondition_khong_Tutuc);
                decimal TT =
                    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT, AggregateFunction.Sum),
                        gridExFilterConditiontrangthai_huy);
                decimal TT_Chietkhau =
                   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);

                decimal TT_KHONG_PHUTHU =
                   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);
                decimal TT_BHYT =
                    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));
                decimal TT_BN =
                    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));
                decimal TT_BN_DaTT =
                   Utility.DecimaltoDbnull(grdThongTinDaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                       gridExFilterConditiontrangthai_huy));
                Chuathanhtoan =
                   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                       gridExFilterChuathanhtoan));
                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu =
                    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                decimal TuTuc =
                    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                        gridExFilterConditionTutuc));
                //txtPtramBHChiTra.Text = Utility.sDbnull(PtramBHYT);
                txtTongChiPhi.Text = Utility.sDbnull(TT);
                TT_KHONG_PHUTHU -= TuTuc;
                txtTongtienDCT.Text = objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull( TT_BHYT  +BN_KHONGTUTUC);// objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull(TT_KHONG_PHUTHU);
                txtPhuThu.Text = Utility.sDbnull(PhuThu);
                txtTuTuc.Text = Utility.sDbnull(TuTuc);
                //decimal BHCT = TongChiphiBHYT*PtramBHYT/100;
                txtBHCT.Text = Utility.sDbnull(TT_BHYT, "0");
                decimal BNCT = BN_KHONGTUTUC;
                txtBNCT.Text = Utility.sDbnull(BNCT);
                decimal BNPhaiTra = BNCT + Utility.DecimaltoDbnull(txtTuTuc.Text, 0) +
                                    Utility.DecimaltoDbnull(txtPhuThu.Text);
                txtBNPhaiTra.Text = Utility.sDbnull(TT_BN);
                txtSoTienCanNop.Text = Utility.sDbnull(Chuathanhtoan);
                //Tạm bỏ
                TinhToanSoTienPhaithu();
                ModifyCommand();
            }
            catch
            { }
        }
        private void SetSumTotalProperties()
        {
            try
            {

                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdChitiet, "trangthai_thanhtoan");
                GridEXColumn gridExColumn = getGridExColumn(grdChitiet, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc = getGridExColumn(grdChitiet, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT = getGridExColumn(grdChitiet, "TT");
                GridEXColumn gridExColumnTT_chietkhau = getGridExColumn(grdChitiet, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT = getGridExColumn(grdChitiet, "TT_BHYT");
                GridEXColumn gridExColumnTTBN = getGridExColumn(grdChitiet, "TT_BN");
                GridEXColumn gridExColumntutuc = getGridExColumn(grdChitiet, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdChitiet, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu = getGridExColumn(grdChitiet,
                    "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                  new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                   new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                   new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdChitiet,
                    "bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdChitiet, "bnhan_chitra");
                decimal BN_KHONGTUTUC =
                  Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum),
                      gridExFilterCondition_khong_Tutuc);
                decimal TT =
                    Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnTT, AggregateFunction.Sum),
                        gridExFilterConditiontrangthai_huy);
                decimal TT_Chietkhau =
                   Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);

                decimal TT_KHONG_PHUTHU =
                   Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumn, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);
                decimal TT_BHYT =
                    Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));
                decimal TT_BN =
                    Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));

                Chuathanhtoan =
                   Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                       gridExFilterChuathanhtoan));
                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu =
                    Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                decimal TuTuc =
                    Utility.DecimaltoDbnull(grdChitiet.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                        gridExFilterConditionTutuc));
                //txtPtramBHChiTra.Text = Utility.sDbnull(PtramBHYT);

                TT_KHONG_PHUTHU -= TuTuc;

                decimal BNCT = BN_KHONGTUTUC;

                decimal BNPhaiTra = BNCT ;

                txtSoTienCanNop.Text = Utility.sDbnull(Chuathanhtoan);
                //Tạm bỏ
                TinhToanSoTienPhaithu();
                ModifyCommand();
            }
            catch
            { }
        }
Beispiel #8
0
        private void SetSumTotalProperties()
        {
            try
            {
                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdPaymentDetail, "trangthai_thanhtoan");
                GridEXColumn gridExColumn              = getGridExColumn(grdPaymentDetail, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc        = getGridExColumn(grdPaymentDetail, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT            = getGridExColumn(grdPaymentDetail, "TT");
                GridEXColumn gridExColumnTT_chietkhau  = getGridExColumn(grdPaymentDetail, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT          = getGridExColumn(grdPaymentDetail, "TT_BHYT");
                GridEXColumn gridExColumnTTBN          = getGridExColumn(grdPaymentDetail, "TT_BN");
                GridEXColumn gridExColumntutuc         = getGridExColumn(grdPaymentDetail, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdPaymentDetail, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu        = getGridExColumn(grdPaymentDetail,
                                                                         "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdPaymentDetail,
                                                                "bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdPaymentDetail, "bnhan_chitra");
                decimal BN_KHONGTUTUC =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum),
                                            gridExFilterCondition_khong_Tutuc);
                decimal TT =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTT, AggregateFunction.Sum),
                                            gridExFilterConditiontrangthai_huy);
                decimal TT_Chietkhau =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum),
                                            gridExFilterConditiontrangthai_huy);

                decimal TT_KHONG_PHUTHU =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumn, AggregateFunction.Sum),
                                            gridExFilterConditiontrangthai_huy);
                decimal TT_BHYT =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                                                                      gridExFilterConditiontrangthai_huy));
                decimal TT_BN =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                                                                      gridExFilterConditiontrangthai_huy));

                Chuathanhtoan =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                                                                      gridExFilterChuathanhtoan));
                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                decimal TuTuc =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                                                                      gridExFilterConditionTutuc));
                //txtPtramBHChiTra.Text = Utility.sDbnull(PtramBHYT);
                txtTongChiPhi.Text  = Utility.sDbnull(TT);
                TT_KHONG_PHUTHU    -= TuTuc;
                txtTongtienDCT.Text = objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull(TT_BHYT + BN_KHONGTUTUC);// objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull(TT_KHONG_PHUTHU);
                txtPhuThu.Text      = Utility.sDbnull(PhuThu);
                txtTuTuc.Text       = Utility.sDbnull(TuTuc);
                //decimal BHCT = TongChiphiBHYT*PtramBHYT/100;
                txtBHCT.Text = Utility.sDbnull(TT_BHYT, "0");
                decimal BNCT = BN_KHONGTUTUC;
                txtBNCT.Text = Utility.sDbnull(BNCT);
                decimal BNPhaiTra = BNCT + Utility.DecimaltoDbnull(txtTuTuc.Text, 0) +
                                    Utility.DecimaltoDbnull(txtPhuThu.Text);
                txtBNPhaiTra.Text = Utility.sDbnull(TT_BN);

                KcbThanhtoanCollection _item = new KcbThanhtoanController().FetchByID(v_Payment_Id);
                if (!_item.Any())
                {
                    txtsotiendathu.Text = "0";
                    txtDachietkhau.Text = "0";
                }
                else
                {
                    txtDachietkhau.Text = _item.FirstOrDefault().TongtienChietkhau.ToString();
                    txtsotiendathu.Text = (Utility.DecimaltoDbnull(_item.FirstOrDefault().BnhanChitra, 0)
                                           + Utility.DecimaltoDbnull(_item.FirstOrDefault().PhuThu, 0)
                                           + Utility.DecimaltoDbnull(_item.FirstOrDefault().TuTuc, 0)
                                           - Utility.DecimaltoDbnull(txtDachietkhau.Text, 0)).ToString();
                }
                ModifyCommand();
            }
            catch
            { }
        }
        private void SetSumTotalProperties()
        {
            try
            {
                if (objLuotkham == null)
                {
                    objLuotkham = Utility.getKcbLuotkham(Utility.Int64Dbnull(txtPatient_ID.Text), Utility.DoTrim(txtPatient_Code.Text));
                }
                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_thanhtoan");
                GridEXColumn gridExColumn = getGridExColumn(grdThongTinChuaThanhToan, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT = getGridExColumn(grdThongTinChuaThanhToan, "TT");
                GridEXColumn gridExColumnTT_chietkhau = getGridExColumn(grdThongTinChuaThanhToan, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT = getGridExColumn(grdThongTinChuaThanhToan, "TT_BHYT");
                GridEXColumn gridExColumnTTBN = getGridExColumn(grdThongTinChuaThanhToan, "TT_BN");
                GridEXColumn gridExColumntutuc = getGridExColumn(grdThongTinChuaThanhToan, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdThongTinChuaThanhToan, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu = getGridExColumn(grdThongTinChuaThanhToan,
                    "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                  new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                   new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                   new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdThongTinChuaThanhToan,"bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdThongTinChuaThanhToan, "bnhan_chitra");

                //decimal BN_KHONGTUTUC =
                //  Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum,
                //      gridExFilterCondition_khong_Tutuc));
                //decimal TT =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT, AggregateFunction.Sum,gridExFilterConditiontrangthai_huy));
                //decimal TT_Chietkhau =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));

                //decimal TT_KHONG_PHUTHU =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumn, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));
                //decimal TT_BHYT =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                //        gridExFilterConditiontrangthai_huy));
                //decimal TT_BN =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //        gridExFilterConditiontrangthai_huy));
                //decimal TT_BN_DaTT =
                //   Utility.DecimaltoDbnull(grdThongTinDaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //       gridExFilterConditiontrangthai_huy));
                //Chuathanhtoan =
                //   Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                //       gridExFilterChuathanhtoan));

                ////Tạm bỏ
                ////decimal PtramBHYT = 0;
                ////_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                //decimal PhuThu =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                //decimal TuTuc =
                //    Utility.DecimaltoDbnull(grdThongTinChuaThanhToan.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                //        gridExFilterConditionTutuc));

                decimal BN_KHONGTUTUC = 0m;
                decimal TT = 0m;
                decimal TT_Chietkhau = 0m;

                decimal TT_KHONG_PHUTHU = 0m;
                decimal TT_BHYT = 0m;
                decimal TT_BN = 0m;
                decimal TT_BN_DaTT = 0m;
                Chuathanhtoan = 0m;

                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu = 0m;
                decimal TuTuc = 0m;
                foreach (DataRowView drv in m_dtChiPhiThanhtoan.DefaultView)
                {
                    if (Utility.Int32Dbnull(drv["tinh_chiphi"], 0) == 1)
                    {
                        if (Utility.Int32Dbnull(drv["tu_tuc"], 0) == 0)
                            BN_KHONGTUTUC += Utility.DecimaltoDbnull(drv["TT_BN_KHONG_TUTUC"], 0);
                        if (Utility.Int32Dbnull(drv["trangthai_huy"], 0) == 0)
                        {
                            TT += Utility.DecimaltoDbnull(drv["TT"], 0);
                            TT_Chietkhau += Utility.DecimaltoDbnull(drv[KcbThanhtoanChitiet.Columns.TienChietkhau], 0);
                            TT_KHONG_PHUTHU += Utility.DecimaltoDbnull(drv["TT_KHONG_PHUTHU"], 0);

                            TT_BHYT += Utility.DecimaltoDbnull(drv["TT_BHYT"], 0);
                            TT_BN += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                            TT_BN_DaTT += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                        }
                        if (Utility.Int32Dbnull(drv["trangthai_thanhtoan"], 0) == 0)
                            Chuathanhtoan += Utility.DecimaltoDbnull(drv["TT_BN"], 0);
                        PhuThu += Utility.DecimaltoDbnull(drv["TT_PHUTHU"], 0);
                        if (Utility.Int32Dbnull(drv["tu_tuc"], 0) == 1)
                            TuTuc += Utility.DecimaltoDbnull(drv["TT_TUTUC"], 0);
                    }
                }
                //txtPtramBHChiTra.Text = Utility.sDbnull(PtramBHYT);
                txtTongChiPhi.Text = Utility.sDbnull(TT);
                TT_KHONG_PHUTHU -= TuTuc;
                txtTongtienDCT.Text = objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull( TT_BHYT  +BN_KHONGTUTUC);// objLuotkham.MaDoituongKcb == "DV" ? "0" : Utility.sDbnull(TT_KHONG_PHUTHU);
                txtPhuThu.Text = Utility.sDbnull(PhuThu);
                txtTuTuc.Text = Utility.sDbnull(TuTuc);
                //decimal BHCT = TongChiphiBHYT*PtramBHYT/100;
                txtBHCT.Text = Utility.sDbnull(TT_BHYT, "0");
                decimal BNCT = BN_KHONGTUTUC;
                txtBNCT.Text = Utility.sDbnull(BNCT);
                decimal BNPhaiTra = BNCT + Utility.DecimaltoDbnull(txtTuTuc.Text, 0) +
                                    Utility.DecimaltoDbnull(txtPhuThu.Text);
                txtBNPhaiTra.Text = Utility.sDbnull(TT_BN);
                txtSoTienCanNop.Text = Utility.sDbnull(Chuathanhtoan);
                //Tạm bỏ
                TinhToanSoTienPhaithu();
                ModifyCommand();
            }
            catch
            { }
        }
        private void SetSumTotalProperties()
        {
            try
            {
                GridEXColumn gridExColumntrangthaithanhtoan = getGridExColumn(grdPaymentDetail, "trangthai_thanhtoan");
                GridEXColumn gridExColumn = getGridExColumn(grdPaymentDetail, "TT_KHONG_PHUTHU");
                GridEXColumn gridExColumn_tutuc = getGridExColumn(grdPaymentDetail, "TT_BN_KHONG_TUTUC");
                GridEXColumn gridExColumnTT = getGridExColumn(grdPaymentDetail, "TT");
                GridEXColumn gridExColumnTT_chietkhau = getGridExColumn(grdPaymentDetail, KcbThanhtoanChitiet.Columns.TienChietkhau);
                GridEXColumn gridExColumnBHYT = getGridExColumn(grdPaymentDetail, "TT_BHYT");
                GridEXColumn gridExColumnTTBN = getGridExColumn(grdPaymentDetail, "TT_BN");
                GridEXColumn gridExColumntutuc = getGridExColumn(grdPaymentDetail, "tu_tuc");
                GridEXColumn gridExColumntrangthai_huy = getGridExColumn(grdPaymentDetail, "trangthai_huy");
                GridEXColumn gridExColumnPhuThu = getGridExColumn(grdPaymentDetail,
                    "TT_PHUTHU");
                var gridExFilterCondition_khong_Tutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditionTutuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);
                var gridExFilterChuathanhtoan =
                    new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 0);
                var gridExFilterDathanhtoan =
                  new GridEXFilterCondition(gridExColumntrangthaithanhtoan, ConditionOperator.Equal, 1);
                var gridExFilterCondition_TuTuc =
                   new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 1);

                var gridExFilterConditionKhongTuTuc =
                    new GridEXFilterCondition(gridExColumntutuc, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy =
                    new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                var gridExFilterConditiontrangthai_huy_va_khongtutuc =
                   new GridEXFilterCondition(gridExColumntrangthai_huy, ConditionOperator.Equal, 0);
                gridExFilterConditiontrangthai_huy_va_khongtutuc.AddCondition(gridExFilterConditionKhongTuTuc);
                GridEXColumn gridExColumnBNCT = getGridExColumn(grdPaymentDetail,
                    "bnhan_chitra");
                // Janus.Windows.GridEX.GridEXColumn gridExColumnTuTuc = getGridExColumn(grdPaymentDetail, "bnhan_chitra");
                decimal BN_KHONGTUTUC =
                  Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumn_tutuc, AggregateFunction.Sum),
                      gridExFilterCondition_khong_Tutuc);
                decimal TT =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTT, AggregateFunction.Sum),
                        gridExFilterConditiontrangthai_huy);
                decimal TT_Chietkhau =
                   Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTT_chietkhau, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);

                decimal TT_KHONG_PHUTHU =
                   Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumn, AggregateFunction.Sum),
                       gridExFilterConditiontrangthai_huy);
                decimal TT_BHYT =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnBHYT, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));
                decimal TT_BN =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                        gridExFilterConditiontrangthai_huy));

                Chuathanhtoan =
                   Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnTTBN, AggregateFunction.Sum,
                       gridExFilterChuathanhtoan));
                //Tạm bỏ
                //decimal PtramBHYT = 0;
                //_THANHTOAN.LayThongPtramBHYT(TongChiphiBHYT, objLuotkham, ref PtramBHYT);
                decimal PhuThu =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
                decimal TuTuc =
                    Utility.DecimaltoDbnull(grdPaymentDetail.GetTotal(gridExColumnBNCT, AggregateFunction.Sum,
                        gridExFilterConditionTutuc));
                //txtPtramBHChiTra.Text = Utility.sDbnull(PtramBHYT);
                txtTongChiPhi.Text = Utility.sDbnull(TT);
                TT_KHONG_PHUTHU -= TuTuc;
                txtTongtienDCT.Text = "0";
                txtPhuThu.Text = Utility.sDbnull(PhuThu);
                txtTuTuc.Text = Utility.sDbnull(TuTuc);
                //decimal BHCT = TongChiphiBHYT*PtramBHYT/100;
                txtBHCT.Text = Utility.sDbnull(TT_BHYT, "0");
                decimal BNCT = BN_KHONGTUTUC;
                txtBNCT.Text = Utility.sDbnull(BNCT);
                decimal BNPhaiTra = BNCT + Utility.DecimaltoDbnull(txtTuTuc.Text, 0) +
                                    Utility.DecimaltoDbnull(txtPhuThu.Text);
                txtBNPhaiTra.Text = Utility.sDbnull(TT_BN);

                KcbThanhtoanCollection _item = new KcbThanhtoanController().FetchByID(v_Payment_Id);
                if (!_item.Any())
                {
                    txtsotiendathu.Text = "0";
                    txtDachietkhau.Text = "0";
                }
                else
                {
                    txtDachietkhau.Text = _item.FirstOrDefault().TongtienChietkhau.ToString();
                    txtsotiendathu.Text = (Utility.DecimaltoDbnull(_item.FirstOrDefault().BnhanChitra, 0)
                        + Utility.DecimaltoDbnull(_item.FirstOrDefault().PhuThu, 0)
                        + Utility.DecimaltoDbnull(_item.FirstOrDefault().TuTuc, 0)
                        - Utility.DecimaltoDbnull(txtDachietkhau.Text, 0)).ToString();
                }
                ModifyCommand();
            }
            catch
            { }
        }
Beispiel #11
0
        private void btnAddCondition_Click(object sender, EventArgs e)
        {
            if ((cmbColumn.SelectedItem == null) || (cmbFilterOperator.SelectedItem == null))
            {
                return;
            }

            if (filterCondition == null)
            {
                filterCondition = new GridEXFilterCondition();
            }
            LogicalOperator logicalOperator;

            if (this.rbtAnd.Checked)
            {
                logicalOperator = LogicalOperator.And;
            }
            else
            {
                logicalOperator = LogicalOperator.Or;
            }

            GridEXFilterCondition cond = null;

            if (tbcCondition.SelectedTab == tbpCondition)
            {
                cond = new GridEXFilterCondition((GridEXColumn)this.cmbColumn.SelectedItem, ((FilterOperatorListItem)this.cmbFilterOperator.SelectedItem).Operator, this.GetFilterValue());
            }
            else if (tbcCondition.SelectedTab == tbpMultiSelectList)
            {
                IList list = multiSelectList.SelectedItems;

                cond = new GridEXFilterCondition();
                GridEXFilterCondition childCondition;

                cond.AddCondition(new GridEXFilterCondition((GridEXColumn)this.cmbColumn.SelectedItem, ConditionOperator.Equal, list[0]));
                for (int i = 1; i < list.Count; i++)
                {
                    childCondition = new GridEXFilterCondition((GridEXColumn)this.cmbColumn.SelectedItem, ConditionOperator.Equal, list[i]);
                    cond.AddCondition(LogicalOperator.Or, childCondition);
                }
            }
            else
            {
                return;
            }

            if ((this.trvFilterCondition.Nodes.Count > 0) && (this.trvFilterCondition.SelectedNode != null) && (this.trvFilterCondition.SelectedNode.Parent != null))
            {
                GridEXFilterCondition parentCondition, siblingCondition, compositeCondition;
                siblingCondition = (GridEXFilterCondition)this.trvFilterCondition.SelectedNode.Tag;
                parentCondition  = (GridEXFilterCondition)this.trvFilterCondition.SelectedNode.Parent.Tag;
                if ((parentCondition.Conditions.Count == 1) || (parentCondition.Conditions[1].LogicalOperator == logicalOperator))
                {
                    parentCondition.AddCondition(logicalOperator, cond);
                }
                else
                {
                    LogicalOperator auxLogicalOperator = parentCondition.Conditions[1].LogicalOperator;
                    parentCondition.RemoveCondition(siblingCondition);
                    compositeCondition = new GridEXFilterCondition();
                    compositeCondition.AddCondition(siblingCondition);
                    compositeCondition.AddCondition(logicalOperator, cond);
                    parentCondition.AddCondition(auxLogicalOperator, compositeCondition);
                }
            }
            else
            {
                filterCondition.AddCondition(logicalOperator, cond);
            }
            this.LoadConditionTreeView();
        }