コード例 #1
0
 private void InsertData()
 {
     try
     {
         objReport.MaBaocao    = Utility.DoTrim(txtMa.Text);
         objReport.MaNhom      = cboNhom.SelectedValue.ToString();
         objReport.TieuDe      = Utility.DoTrim(txtTieude.Text);
         objReport.FileRieng   = Utility.DoTrim(txtTenFileRieng.Text);
         objReport.FileChuan   = Utility.DoTrim(txtTenFileMacDinh.Text);
         objReport.MoTa        = Utility.DoTrim(txtMoTa.Text);
         objReport.NgayTao     = globalVariables.SysDate;
         objReport.PrintNumber = 1;
         objReport.NguoiTao    = globalVariables.UserName;
         objReport.IsNew       = true;
         objReport.Save();
         m_enAct       = action.Update;
         txtMa.Enabled = false;
         DataRow newitem = dt_data.NewRow();
         Utility.FromObjectToDatarow(objReport, ref newitem);
         newitem["ten_nhombaocao"] = cboNhom.Text;
         dt_data.Rows.Add(newitem);
         dt_data.AcceptChanges();
         Utility.GonewRowJanus(grdList, SysReport.Columns.MaBaocao, objReport.MaBaocao);
         if (chkThemlientuc.Checked)
         {
             ResetControls();
         }
         else
         {
             this.Text = "Cập nhật";
         }
     }
     catch (Exception ex) { }
 }
コード例 #2
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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: ReportTitle.cs プロジェクト: khaha2210/CodeNewHis
        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);
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: frm_MainForm_new.cs プロジェクト: vmshis2015/LabUI
 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
     {
     }
 }