示例#1
0
 string LaygiatriTieudeBaocao(string Matieude, bool fromDB)
 {
     try
     {
         string reval = "";
         if (fromDB)
         {
             SqlQuery sqlQuery =
                 new Select().From(SysReport.Schema).Where(SysReport.Columns.MaBaocao).IsEqualTo(
                     Matieude);
             SysReport objSystemParameter = sqlQuery.ExecuteSingle <SysReport>();
             if (objSystemParameter != null)
             {
                 reval = objSystemParameter.TieuDe;
             }
         }
         else
         {
             DataRow[] arrDR = globalVariables.gv_dtSysTieude.Select(SysTieude.MaTieudeColumn.ColumnName + " ='" + Matieude + "'");
             if (arrDR.Length > 0)
             {
                 reval = Utility.sDbnull(arrDR[0][SysTieude.NoiDungColumn.ColumnName]);
             }
         }
         return(reval);
     }
     catch
     {
         return("");
     }
 }
示例#2
0
        private bool CheckValidData()
        {
            SysReport obj = null;

            if (string.IsNullOrEmpty(txtMa.Text))
            {
                Utility.ShowMsg("Chưa nhập mã báo cáo", "Thông báo", MessageBoxIcon.Information);
                txtMa.Focus();
                txtMa.SelectAll();
                return(false);
            }
            if (string.IsNullOrEmpty(txtTieude.Text))
            {
                Utility.ShowMsg("Chưa nhập tiêu đề báo cáo", "Thông báo", MessageBoxIcon.Information);
                txtTieude.Focus();
                txtTieude.SelectAll();
                return(false);
            }
            if (cboNhom.Items.Count <= 0)
            {
                Utility.ShowMsg("Chưa khởi tạo danh mục nhóm báo cáo", "Thông báo", MessageBoxIcon.Information);
                cboNhom.Focus();
                return(false);
            }
            if (txtTenFileMacDinh.Text.Trim() == "")
            {
                Utility.ShowMsg("Chưa nhập tên file chuẩn", "Thông báo", MessageBoxIcon.Information);
                txtTenFileMacDinh.Focus();
                txtMa.SelectAll();
                return(false);
            }
            if (objReport.IsNew)
            {
                obj = new SysReportController().FetchByID(txtMa.Text).FirstOrDefault();
                if (obj != null)
                {
                    Utility.ShowMsg("Mã báo cáo đã tồn tại. Chọn mã khác", "Thông báo", MessageBoxIcon.Information);
                    txtMa.Focus();
                    txtMa.SelectAll();
                    return(false);
                }
            }
            else
            {
                obj = new Select().From(SysReport.Schema).Where(SysReport.Columns.MaBaocao).IsEqualTo(Utility.DoTrim(txtMa.Text))
                      .And(SysReport.Columns.MaBaocao).IsNotEqualTo(objReport.MaBaocao).ExecuteSingle <SysReport>();
                if (obj != null)
                {
                    Utility.ShowMsg("Mã báo cáo đã tồn tại. Chọn mã khác", "Thông báo", MessageBoxIcon.Information);
                    txtMa.Focus();
                    txtMa.SelectAll();
                    return(false);
                }
            }
            return(true);
        }
示例#3
0
 private void ResetControls()
 {
     foreach (Control ctr in grpControl.Controls)
     {
         if (ctr is Janus.Windows.GridEX.EditControls.EditBox)
         {
             ctr.Text = "";
         }
     }
     m_enAct       = action.Insert;
     objReport     = new SysReport();
     txtMa.Enabled = true;
     txtMa.Focus();
 }
示例#4
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            try
            {
                var _ReportModel = this.ccReportModel.SelectedValue.ToInt();
                if (_ReportModel != (int)ReportModelEnum.Page_Statistics)
                {
                    this.AjaxAlertAndEnableButton("暂时只支持页面统计模式!");
                    return;
                }

                SysReport model;
                if (__Id > 0)
                {
                    model = this.DataHelper.FindById <SysReport>(__Id);
                    ////如果编辑重选的实体,要删除所有配置信息哦(不删除了,直接不让修改查询实体)
                    //if (model.EntityName != this.ccEntityName.SelectedValue)
                    //{
                    //    var _reportHelper = new ReportHelper(this.DataHelper, __Id);
                    //    _reportHelper.DeleteAllSet();
                    //}
                }
                else
                {
                    model          = new SysReport();
                    model.ReportId = this.DataHelper.GetNextIdentity_Int();
                    model.State    = (int)ReportStateEnum.NotPublish;
                }
                model.ReportName        = this.tcReportName.Text;
                model.ReportModel       = _ReportModel;
                model.EntityName        = this.ccEntityName.SelectedValue;
                model.EntityDisPlayText = this.ccEntityName.SelectedText;
                if (__Id > 0)
                {
                    this.DataHelper.Update(model);
                }
                else
                {
                    this.DataHelper.Insert(model);
                }
                Response.Redirect(string.Format("ReportQueryFieldSet.aspx?id={0}", model.ReportId));
            }
            catch (Exception ex)
            {
                this.AjaxAlertAndEnableButton(ex);
            }
        }
示例#5
0
 private void Edit()
 {
     try
     {
         if (!Utility.isValidGrid(grdList))
         {
             return;
         }
         string             mabaocao = grdList.CurrentRow.Cells[SysReport.Columns.MaBaocao].Value.ToString();
         SysReport          obj      = new SysReport(mabaocao);
         frm_themmoi_baocao frm      = new frm_themmoi_baocao();
         frm.grdList   = grdList;
         frm.objReport = obj;
         frm.dt_data   = dtReport;
         frm.m_enAct   = action.Update;
         frm.ShowDialog();
     }
     catch (Exception ex) { }
 }
示例#6
0
        void CapnhatgiatriTieudebaocao(string Matieude, string _value)
        {
            try
            {
                if (Utility.DoTrim(Matieude) == "")
                {
                    return;
                }
                DataRow[] arrDR = globalVariables.gv_dtSysTieude.Select(SysTieude.MaTieudeColumn.ColumnName + " ='" + Matieude + "'");
                SysReport _Item = new Select().From(SysReport.Schema).Where(SysReport.Columns.MaBaocao).IsEqualTo(
                    Matieude).ExecuteSingle <SysReport>();
                if (_Item != null)
                {
                    //arrDR[0][SysTieude.NoiDungColumn.ColumnName] = _value;
                    //globalVariables.gv_dtSysTieude.AcceptChanges();
                    new Update(SysReport.Schema).Set(SysReport.TieuDeColumn).EqualTo(_value).Where(SysReport.MaBaocaoColumn).IsEqualTo(Matieude).Execute();
                }
                else
                {
                    SysReport newItem = new SysReport();
                    newItem.MaBaocao = Matieude;
                    newItem.TieuDe   = _value;

                    newItem.Save();
                    //DataRow newrow = globalVariables.gv_dtSysTieude.NewRow();
                    //newrow[SysTieude.MaTieudeColumn.ColumnName] = Matieude;
                    //newrow[SysTieude.NoiDungColumn.ColumnName] = _value;

                    //globalVariables.gv_dtSysTieude.Rows.Add(newrow);
                    //globalVariables.gv_dtSysTieude.AcceptChanges();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi cập nhật giá trị tiêu đề báo cáo:\n" + ex.Message);
            }
        }
        public void Insert(string MaBaocao,string MaNhom,string TieuDe,string FileRieng,string FileChuan,string MoTa,short? PrintNumber,string NguoiTao,DateTime? NgayTao,string NguoiSua,DateTime? NgaySua)
        {
            SysReport item = new SysReport();

            item.MaBaocao = MaBaocao;

            item.MaNhom = MaNhom;

            item.TieuDe = TieuDe;

            item.FileRieng = FileRieng;

            item.FileChuan = FileChuan;

            item.MoTa = MoTa;

            item.PrintNumber = PrintNumber;

            item.NguoiTao = NguoiTao;

            item.NgayTao = NgayTao;

            item.NguoiSua = NguoiSua;

            item.NgaySua = NgaySua;

            item.Save(UserName);
        }
示例#8
0
        void CapnhatgiatriTieudebaocao(string Matieude, string _value)
        {
            try
            {
                if (Utility.DoTrim(Matieude) == "") return;
                DataRow[] arrDR = globalVariables.gv_dtSysTieude.Select(SysTieude.MaTieudeColumn.ColumnName + " ='" + Matieude + "'");
                SysReport _Item = new Select().From(SysReport.Schema).Where(SysReport.Columns.MaBaocao).IsEqualTo(
                            Matieude).ExecuteSingle<SysReport>();
                if (_Item != null)
                {
                    //arrDR[0][SysTieude.NoiDungColumn.ColumnName] = _value;
                    //globalVariables.gv_dtSysTieude.AcceptChanges();
                    new Update(SysReport.Schema).Set(SysReport.TieuDeColumn).EqualTo(_value).Where(SysReport.MaBaocaoColumn).IsEqualTo(Matieude).Execute();
                }
                else
                {
                    SysReport newItem = new SysReport();
                    newItem.MaBaocao = Matieude;
                    newItem.TieuDe = _value;

                    newItem.Save();
                    //DataRow newrow = globalVariables.gv_dtSysTieude.NewRow();
                    //newrow[SysTieude.MaTieudeColumn.ColumnName] = Matieude;
                    //newrow[SysTieude.NoiDungColumn.ColumnName] = _value;

                    //globalVariables.gv_dtSysTieude.Rows.Add(newrow);
                    //globalVariables.gv_dtSysTieude.AcceptChanges();
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi cập nhật giá trị tiêu đề báo cáo:\n" + ex.Message);
            }
        }
 private void ResetControls()
 {
     foreach(Control ctr in grpControl.Controls)
     {
         if (ctr is Janus.Windows.GridEX.EditControls.EditBox)
         {
             ctr.Text = "";
         }
     }
     m_enAct = action.Insert;
     objReport = new SysReport();
     txtMa.Enabled = true;
     txtMa.Focus();
 }
示例#10
0
 private void Edit()
 {
     try
     {
         if (!Utility.isValidGrid(grdList)) return;
         string mabaocao = grdList.CurrentRow.Cells[SysReport.Columns.MaBaocao].Value.ToString();
         SysReport obj = new SysReport(mabaocao);
         frm_themmoi_baocao frm = new frm_themmoi_baocao();
         frm.grdList = grdList;
         frm.objReport = obj;
         frm.dt_data = dtReport;
         frm.m_enAct = action.Update;
         frm.ShowDialog();
     }
     catch (Exception ex) { }
 }
        public void Update(string MaBaocao,string MaNhom,string TieuDe,string FileRieng,string FileChuan,string MoTa,string NguoiTao,DateTime? NgayTao,string NguoiSua,DateTime? NgaySua)
        {
            SysReport item = new SysReport();
            item.MarkOld();
            item.IsLoaded = true;

            item.MaBaocao = MaBaocao;

            item.MaNhom = MaNhom;

            item.TieuDe = TieuDe;

            item.FileRieng = FileRieng;

            item.FileChuan = FileChuan;

            item.MoTa = MoTa;

            item.NguoiTao = NguoiTao;

            item.NgayTao = NgayTao;

            item.NguoiSua = NguoiSua;

            item.NgaySua = NgaySua;

            item.Save(UserName);
        }
示例#12
0
 public void CreateData()
 {
     try
     {
         string path = Application.StartupPath + @"\Reports";
         string[] files = System.IO.Directory.GetFiles(path, "*.rpt", System.IO.SearchOption.AllDirectories);
         foreach (string _report in files)
         {
             SysReport objReport = new SysReport();
          //   objReport.MaBaocao = Path.GetFileName(_report);
             objReport.MaNhom = "";
             objReport.TieuDe = "";
             objReport.FileRieng = "";
             objReport.FileChuan = Path.GetFileName(_report);
             objReport.MoTa = "";
             objReport.NgayTao = globalVariables.SysDate;
             objReport.NguoiTao = globalVariables.UserName;
             objReport.IsNew = true;
             objReport.Save();
         }
     }
     catch
     {
     }
 }