コード例 #1
0
        private void TxtAsalSuratAutoComplete()
        {
            DataTable dt = TemplateQuery.GetTemplateAktif("asal_surat");

            if (txtPenerima.InvokeRequired)
            {
                this.txtPenerima.Invoke(new txtAsalSuratDelegate(this.txtAsalDelegate), true, "");
            }
            else
            {
                txtPenerima.AutoCompleteMode   = AutoCompleteMode.Suggest;
                txtPenerima.AutoCompleteSource = AutoCompleteSource.CustomSource;
            }

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (txtPenerima.InvokeRequired)
                {
                    this.txtPenerima.Invoke(new txtAsalSuratDelegate(this.txtAsalDelegate), false, dt.Rows[i][0].ToString());
                }
                else
                {
                    txtPenerima.AutoCompleteCustomSource.Add(dt.Rows[i][0].ToString());
                }

                Thread.Sleep(10);
            }
        }
コード例 #2
0
        public async Task <IResultList <Template> > QueryAsync(string appId, TemplateQuery query, CancellationToken ct)
        {
            var filters = new List <FilterDefinition <MongoDbTemplate> >
            {
                Filter.Eq(x => x.Doc.AppId, appId)
            };

            if (!string.IsNullOrWhiteSpace(query.Query))
            {
                var regex = new BsonRegularExpression(query.Query, "i");

                filters.Add(Filter.Regex(x => x.Doc.Code, regex));
            }

            var filter = Filter.And(filters);

            var resultItems = await Collection.Find(filter).ToListAsync(query, ct);

            var resultTotal = (long)resultItems.Count;

            if (query.ShouldQueryTotal(resultItems))
            {
                resultTotal = await Collection.Find(filter).CountDocumentsAsync(ct);
            }

            return(ResultList.Create(resultTotal, resultItems.Select(x => x.ToTemplate())));
        }
コード例 #3
0
        public async Task <IResultList <Template> > QueryAsync(string appId, TemplateQuery query, CancellationToken ct)
        {
            var filters = new List <FilterDefinition <MongoDbTemplate> >
            {
                Filter.Eq(x => x.Doc.AppId, appId)
            };

            if (!string.IsNullOrWhiteSpace(query.Query))
            {
                var regex = new BsonRegularExpression(query.Query, "i");

                filters.Add(Filter.Regex(x => x.Doc.Code, regex));
            }

            var filter = Filter.And(filters);

            var taskForItems = Collection.Find(filter).ToListAsync(query, ct);
            var taskForCount = Collection.Find(filter).CountDocumentsAsync(ct);

            await Task.WhenAll(
                taskForItems,
                taskForCount);

            return(ResultList.Create(taskForCount.Result, taskForItems.Result.Select(x => x.ToTemplate())));
        }
コード例 #4
0
ファイル: FrmInfoPengiriman.cs プロジェクト: adheegm/desktop
 private void DropDownJenisPengiriman()
 {
     dtJenisPengiriman = TemplateQuery.GetTemplateAktif("jenis_pengiriman");
     for (int i = 0; i < dtJenisPengiriman.Rows.Count; i++)
     {
         ddJenisPengiriman.Items.Add(dtJenisPengiriman.Rows[i][0].ToString());
     }
 }
コード例 #5
0
ファイル: FrmSuratMasuk.cs プロジェクト: adheegm/desktop
 private void DropDownLokasiFisikSurat()
 {
     dtLokasiFisik = TemplateQuery.GetTemplateAktif("lokasi_fisik");
     for (int i = 0; i < dtLokasiFisik.Rows.Count; i++)
     {
         ddLokasiFisikSurat.Items.Add(dtLokasiFisik.Rows[i][0].ToString());
     }
 }
コード例 #6
0
 private void btnHapus_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(this, "Anda yakin akan menghapus data template ini?", "Konfirmasi", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No)
     {
         return;
     }
     TemplateQuery.DeleteTemplateData(txtNama.Text);
     MessageBox.Show(this, "Data template sudah dihapus.", "Data dihapus", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
コード例 #7
0
 private void GenerateLVTKKeamanan()
 {
     TKKeamanan = TemplateQuery.GetTemplateAktif("tingkat_keamanan");
     for (int i = 0; i < TKKeamanan.Rows.Count; i++)
     {
         lvTkKeamanan.Items.Add(0, TKKeamanan.Rows[i][0].ToString());
     }
     lvTkKeamanan.SelectedIndex = 0;
 }
コード例 #8
0
 private void GenerateLVKategori()
 {
     dtKategori = TemplateQuery.GetTemplateAktif("kategori_surat");
     for (int i = 0; i < dtKategori.Rows.Count; i++)
     {
         lvKategori.Items.Add(0, dtKategori.Rows[i][0].ToString());
     }
     lvKategori.SelectedIndex = 0;
 }
コード例 #9
0
ファイル: FrmSuratMasuk.cs プロジェクト: adheegm/desktop
 private void TxtAsalSuratAutoComplete()
 {
     dtAsalSurat = TemplateQuery.GetTemplateAktif("asal_surat");
     txtAsalSurat.AutoCompleteMode   = AutoCompleteMode.Suggest;
     txtAsalSurat.AutoCompleteSource = AutoCompleteSource.CustomSource;
     for (int i = 0; i < dtAsalSurat.Rows.Count; i++)
     {
         txtAsalSurat.AutoCompleteCustomSource.Add(dtAsalSurat.Rows[i][0].ToString());
     }
 }
コード例 #10
0
ファイル: FrmSuratMasuk.cs プロジェクト: adheegm/desktop
 private void TxtDiteruskanKepadaAutoComplete()
 {
     dtPosisiSurat = TemplateQuery.GetTemplateAktif("posisi_surat");
     txtTujuanDisposisi.AutoCompleteMode   = AutoCompleteMode.Suggest;
     txtTujuanDisposisi.AutoCompleteSource = AutoCompleteSource.CustomSource;
     for (int i = 0; i < dtPosisiSurat.Rows.Count; i++)
     {
         txtTujuanDisposisi.AutoCompleteCustomSource.Add(dtPosisiSurat.Rows[i][0].ToString());
     }
 }
コード例 #11
0
ファイル: FrmPenyelesaian.cs プロジェクト: adheegm/desktop
 private void TxtPenyelesaianOlehAutoComplete()
 {
     System.Data.DataTable dt = TemplateQuery.GetTemplateAktif("posisi_surat");
     txtPenyelesaianOleh.AutoCompleteMode   = AutoCompleteMode.Suggest;
     txtPenyelesaianOleh.AutoCompleteSource = AutoCompleteSource.CustomSource;
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         txtPenyelesaianOleh.AutoCompleteCustomSource.Add(dt.Rows[i][0].ToString());
     }
 }
コード例 #12
0
        public static async Task <TemplateQueryResult> SelectPushTemplatesAsync(TemplateQuery query)
        {
            using (var client = new Tuhu.Service.Push.TemplatePushClient())
            {
                var result = await client.QueryTemplatesAsync(query);

                result.ThrowIfException(true);
                var datas = result.Result;
                return(datas);
            }
        }
コード例 #13
0
ファイル: FrmEditSuratKeluar.cs プロジェクト: adheegm/desktop
 private void DropDownTingkatKeamananItems()
 {
     if (T8UserLoginInfo.HakAkses.ToLower().Contains(("Administrator").ToLower()))
     {
         dtTKKeamanan = TemplateQuery.GetTemplateAktif("tingkat_keamanan");
     }
     else
     {
         dtTKKeamanan = TemplateQuery.GetTemplateAktifTKKeamanan(T8UserLoginInfo.Username, "tingkat_keamanan");
     }
     for (int i = 0; i < dtTKKeamanan.Rows.Count; i++)
     {
         dropDownTingkatKeamanan.Items.Add(dtTKKeamanan.Rows[i][0].ToString());
     }
 }
コード例 #14
0
ファイル: FrmSuratMasuk.cs プロジェクト: adheegm/desktop
 private void DropDownKategori()
 {
     if (T8UserLoginInfo.HakAkses.ToLower().Contains(("Administrator").ToLower()))
     {
         dtKategori = TemplateQuery.GetTemplateAktif("kategori_surat");
     }
     else
     {
         dtKategori = TemplateQuery.GetTemplateAktifKategori(T8UserLoginInfo.Username, "kategori_surat");
     }
     for (int i = 0; i < dtKategori.Rows.Count; i++)
     {
         dropDownTipe.Items.Add(dtKategori.Rows[i][0].ToString());
     }
 }
コード例 #15
0
        private static FilterDefinition <MongoDbTemplate> BuildFilter(string appId, TemplateQuery query)
        {
            var filters = new List <FilterDefinition <MongoDbTemplate> >
            {
                Filter.Eq(x => x.Doc.AppId, appId)
            };

            if (!string.IsNullOrWhiteSpace(query.Query))
            {
                var regex = new BsonRegularExpression(Regex.Escape(query.Query), "i");

                filters.Add(Filter.Regex(x => x.Doc.Code, regex));
            }

            return(Filter.And(filters));
        }
コード例 #16
0
        public async Task <IResultList <Template> > QueryAsync(string appId, TemplateQuery query,
                                                               CancellationToken ct = default)
        {
            using (var activity = Telemetry.Activities.StartActivity("MongoDbTemplateRepository/QueryAsync"))
            {
                var filter = BuildFilter(appId, query);

                var resultItems = await Collection.Find(filter).ToListAsync(query, ct);

                var resultTotal = (long)resultItems.Count;

                if (query.ShouldQueryTotal(resultItems))
                {
                    resultTotal = await Collection.Find(filter).CountDocumentsAsync(ct);
                }

                activity?.SetTag("numResults", resultItems.Count);
                activity?.SetTag("numTotal", resultTotal);

                return(ResultList.Create(resultTotal, resultItems.Select(x => x.ToTemplate())));
            }
        }
コード例 #17
0
        private void UpdateTemplateData(string _template)
        {
            try
            {
                string status;

                if (rdoAktif.IsChecked)
                {
                    status = "Aktif";
                }
                else
                {
                    status = "Non Aktif";
                }

                TemplateQuery.UpdatetTemplateData(GlobalFunction.SqlCharChecker(txtNama.Text), GlobalFunction.SqlCharChecker(txtSimbol.Text),
                                                  GlobalFunction.SqlCharChecker(txtKeterangan.Text), _template, status);

                UpdateSingleData(gvTemplateKategori.SelectedRows[0].Index, _template, status);


                if (act == Action.Tambah || act == Action.Edit)
                {
                    MessageBox.Show(this, "Data template sudah disimpan.", "Template disimpan", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnTambah.Enabled          = true;
                    btnUbah.Enabled            = true;
                    btnHapus.Enabled           = true;
                    gvTemplateKategori.Enabled = true;
                    ClearInput();
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("PRIMARY"))
                {
                    MessageBox.Show(this, "Data sudah ada, mohon periksa kembali", "Duplicate Data", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
        }
コード例 #18
0
        public ActionResult GetApprovalList()
        {
            try
            {
                var queryParams = new NameValueCollection();
                if (!ParamHelper.CheckParaQ(ref queryParams))
                {
                    return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet));
                }

                var query = new TemplateQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1 and status=0");//Status审批状态为0(草稿),1同意,2拒绝

                int    userType  = CurrenUserInfo.UserType;
                string loginName = CurrenUserInfo.LoginName;

                if (userType != GDS.Entity.Constant.ConstantDefine.Admin)  //验证审批权限
                {
                    var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName);

                    if (departmentList != null && departmentList.Count > 0)
                    {
                        sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                    }
                    else
                    {
                        return(Json(new ResponseEntity <dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet));
                    }
                }

                if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0")
                {
                    sqlCondition.Append($" and DepartId = {query.DepartId}");
                }

                if (!string.IsNullOrEmpty(query.ProjectType))
                {
                    sqlCondition.Append($" and ProjectType = {query.ProjectType}");
                }

                if (!string.IsNullOrEmpty(query.Name))
                {
                    sqlCondition.Append($" and Name like '%{query.Name}%'");
                }

                if (!string.IsNullOrEmpty(query.CreateBy))
                {
                    sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'");
                }

                PageRequest preq = new PageRequest
                {
                    TableName      = " [View_Template] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new TemplateBLL().GetView_TemplateByPage(preq);
                result.ForEach(template => {
                    template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                });

                var response = new ResponseEntity <object>(true, string.Empty,
                                                           new DataGridResultEntity <View_Template>
                {
                    TotalRecords   = preq.Out_AllRecordCount,
                    DisplayRecords = preq.Out_PageCount,
                    ResultData     = result
                });

                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new ResponseEntity <object>(-999, string.Empty, ""), JsonRequestBehavior.AllowGet));
            }
        }
コード例 #19
0
 public static DataTable SelectTemplate(string _filter)
 {
     return(TemplateQuery.GetTemplateAll(_filter));
 }
コード例 #20
0
        public ActionResult GetTemplateList()
        {
            try
            {
                var queryParams = new NameValueCollection();
                if (!ParamHelper.CheckParaQ(ref queryParams))
                {
                    return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet));
                }

                var query = new TemplateQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1 and Status=1");

                if (!string.IsNullOrEmpty(query.DepartId))
                {
                    sqlCondition.Append($" and DepartId = {query.DepartId}");
                }

                if (!string.IsNullOrEmpty(query.ProjectType))
                {
                    sqlCondition.Append($" and ProjectType = {query.ProjectType}");
                }

                if (!string.IsNullOrEmpty(query.Name))
                {
                    sqlCondition.Append($" and Name like '%{query.Name}%'");
                }

                if (!string.IsNullOrEmpty(query.CreateBy))
                {
                    sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'");
                }

                PageRequest preq = new PageRequest
                {
                    TableName      = " [View_Template] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new TemplateBLL().GetView_TemplateByPage(preq);
                result.ForEach(template => {
                    template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                });

                var response = new ResponseEntity <object>(true, string.Empty,
                                                           new DataGridResultEntity <View_Template>
                {
                    TotalRecords   = preq.Out_AllRecordCount,
                    DisplayRecords = preq.Out_PageCount,
                    ResultData     = result
                });

                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new ResponseEntity <object>(-999, string.Empty, ""), JsonRequestBehavior.AllowGet));
            }
        }
コード例 #21
0
 public static string GetSimbol(string _nama, string _template)
 {
     return(TemplateQuery.GetSimbol(_nama, _template));
 }
コード例 #22
0
ファイル: FrmPenyelesaian.cs プロジェクト: adheegm/desktop
        private void PrintAgenda()
        {
            object nullobject = Type.Missing;
            object missing    = Type.Missing;

            object fileName  = AppDefaultSetting.surat_masuk_penyelesaian_template_path;
            object TfileName = System.Windows.Forms.Application.StartupPath + @"\lembar_penyelesaian.docx";

            Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application {
                Visible = true
            };
            if (!System.IO.File.Exists((string)fileName))
            {
                MessageBox.Show(this, "Template tidak ditemukan, mohon periksa kembali atau hubungi administrator.",
                                "Template Tidak Ditemukan", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1);
                return;
            }

            Microsoft.Office.Interop.Word.Document aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing,
                                                                                 ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

            aDoc.Activate();



            //FindAndReplace(wordApp, "[nomor_agenda]", nomor_agenda, false);
            //FindAndReplace(wordApp, "[kategori]", dropDownTipe.Text, false);
            //FindAndReplace(wordApp, "[tanggal_terima]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", dtTanggalMasuk.Value), false);
            //FindAndReplace(wordApp, "[nomor_surat]", txtNomorSurat.Text, false);
            //FindAndReplace(wordApp, "[tanggal_surat]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", dtTanggalSurat.Value), false);
            //FindAndReplace(wordApp, "[asal_surat]", txtAsalSurat.Text, false);
            //FindAndReplace(wordApp, "[perihal]", txtPerihalSurat.Text, false);
            //FindAndReplace(wordApp, "[tingkat_keamanan]", dropDownTingkatKeamanan.Text, false);
            //FindAndReplace(wordApp, "[ringkasan_isi]", txtRingkasanIsi.Text, false);
            //FindAndReplace(wordApp, "[lampiran]", txtLampiran.Text, false);


            //FindAndReplace(wordApp, "[tanggal_disposisi]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", dtTanggalDisposisi.Value), false);
            //FindAndReplace(wordApp, "[tujuan_disposisi]", txtTujuanDisposisi.Text, false);
            //FindAndReplace(wordApp, "[isi_disposisi]", txtIsisDisposisi.Text, false);

            //FindAndReplace(wordApp, "[referensi_surat]", txtReferensiSurat.Text, false);
            //FindAndReplace(wordApp, "[lokasi_fisik]", ddLokasiFisikSurat.Text, false);
            //FindAndReplace(wordApp, "[info_lokasi]", txtKeteranganLokasi.Text, false);
            //FindAndReplace(wordApp, "[jenis_pengiriman]", ddJenisPengiriman.Text, false);
            //FindAndReplace(wordApp, "[info_pengiriman]", txtInfoPengiriman.Text, false);

            //FindAndReplace(wordApp, "[datetime_print]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", DateTime.Now), false);
            //FindAndReplace(wordApp, "[user]", T8UserLoginInfo.Username, false);



            FindAndReplace(wordApp, "[nomor_agenda]", nomor_agenda, false);
            FindAndReplace(wordApp, "[tanggal_terima]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", this.dr[2]), false);
            FindAndReplace(wordApp, "[nomor_surat]", this.dr[3], false);
            FindAndReplace(wordApp, "[kategori]", this.dr[4], false);
            FindAndReplace(wordApp, "[tanggal_surat]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", this.dr[5]), false);
            FindAndReplace(wordApp, "[asal_surat]", this.dr[6], false);
            FindAndReplace(wordApp, "[perihal]", this.dr[7], false);
            FindAndReplace(wordApp, "[tingkat_keamanan]", this.dr[8], false);
            FindAndReplace(wordApp, "[ringkasan_isi]", this.dr[9], false);
            FindAndReplace(wordApp, "[lampiran]", this.dr[10], false);
            FindAndReplace(wordApp, "[datetime_print]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", DateTime.Now), false);
            FindAndReplace(wordApp, "[user]", T8UserLoginInfo.Username, false);

            FindAndReplace(wordApp, "[tanggal_penyelesaian]", string.Format("{0:" + AppDefaultSetting.surat_masuk_date_format + "}", dtTanggalPenyelesaian.Value), false);
            FindAndReplace(wordApp, "[penyelesaian_oleh]", txtPenyelesaianOleh.Text, false);
            FindAndReplace(wordApp, "[penyelesaian]", txtPenyelesaian.Text, false);

            System.Data.DataTable dtKategori = TemplateQuery.GetTemplateAktif("kategori_surat");
            for (int i = 0; i < dtKategori.Rows.Count; i++)
            {
                if (this.dr[4].ToString().ToLower() == dtKategori.Rows[i][0].ToString().ToLower())
                {
                    FindAndReplace(wordApp, "[o:" + dtKategori.Rows[i][1].ToString() + "]", "<b>" + dtKategori.Rows[i][1].ToString() + "</b>", false);
                    FindAndReplace(wordApp, "<b>" + dtKategori.Rows[i][1].ToString() + "</b>", dtKategori.Rows[i][1].ToString(), true);
                }
                else
                {
                    FindAndReplace(wordApp, "[o:" + dtKategori.Rows[i][1].ToString() + "]", dtKategori.Rows[i][1].ToString(), false);
                }
            }

            System.Data.DataTable dtTKKeamanan = TemplateQuery.GetTemplateAktif("tingkat_keamanan");
            for (int j = 0; j < dtTKKeamanan.Rows.Count; j++)
            {
                if (this.dr[8].ToString().ToLower() == dtTKKeamanan.Rows[j][0].ToString().ToLower())
                {
                    FindAndReplace(wordApp, "[o:" + dtTKKeamanan.Rows[j][1].ToString() + "]", "<b>" + dtTKKeamanan.Rows[j][1].ToString() + "</b>", false);
                    FindAndReplace(wordApp, "<b>" + dtTKKeamanan.Rows[j][1].ToString() + "</b>", dtTKKeamanan.Rows[j][1].ToString(), true);
                }
                else
                {
                    FindAndReplace(wordApp, "[o:" + dtTKKeamanan.Rows[j][1].ToString() + "]", dtTKKeamanan.Rows[j][1].ToString(), false);
                }
            }

            System.Data.DataTable dtAsalSurat = TemplateQuery.GetTemplateAktif("asal_surat");
            for (int k = 0; k < dtAsalSurat.Rows.Count; k++)
            {
                if (this.dr[6].ToString().ToLower() == dtAsalSurat.Rows[k][0].ToString().ToLower())
                {
                    FindAndReplace(wordApp, "[o:" + dtAsalSurat.Rows[k][1].ToString() + "]", "<b>" + dtAsalSurat.Rows[k][1].ToString() + "</b>", false);
                    FindAndReplace(wordApp, "<b>" + dtAsalSurat.Rows[k][1].ToString() + "</b>", dtAsalSurat.Rows[k][1].ToString(), true);
                }
                else
                {
                    FindAndReplace(wordApp, "[o:" + dtAsalSurat.Rows[k][1].ToString() + "]", dtAsalSurat.Rows[k][1].ToString(), false);
                }
            }

            System.Data.DataTable dtPosisiSurat = TemplateQuery.GetTemplateAktif("posisi_surat");
            for (int l = 0; l < dtPosisiSurat.Rows.Count; l++)
            {
                if (lblPosisiSaatIni.Text.ToLower() == dtPosisiSurat.Rows[l][0].ToString().ToLower())
                {
                    FindAndReplace(wordApp, "[o:" + dtPosisiSurat.Rows[l][1].ToString() + "]", "<b>" + dtPosisiSurat.Rows[l][1].ToString() + "</b>", false);
                    FindAndReplace(wordApp, "<b>" + dtPosisiSurat.Rows[l][1].ToString() + "</b>", dtPosisiSurat.Rows[l][1].ToString(), true);
                }
                else
                {
                    FindAndReplace(wordApp, "[o:" + dtPosisiSurat.Rows[l][1].ToString() + "]", dtPosisiSurat.Rows[l][1].ToString(), false);
                }
            }

            wordApp.ActiveDocument.SaveAs(ref TfileName,
                                          ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject,
                                          ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject,
                                          ref nullobject, ref nullobject, ref nullobject, ref nullobject, ref nullobject);

            object copies   = GUI.GeneralSettings.OtomatisCetakAgendaValuePenyelesaian.ToString();
            object pages    = "1";
            object range    = Microsoft.Office.Interop.Word.WdPrintOutRange.wdPrintCurrentPage;
            object items    = Microsoft.Office.Interop.Word.WdPrintOutItem.wdPrintDocumentContent;
            object pageType = Microsoft.Office.Interop.Word.WdPrintOutPages.wdPrintAllPages;
            object oTrue    = true;
            object oFalse   = false;

            Microsoft.Office.Interop.Word.Document TaDoc = wordApp.Documents.Open(ref TfileName, ReadOnly: false, Visible: true);

            TaDoc.PrintOut(
                ref oTrue, ref oFalse, ref range, ref nullobject, ref nullobject, ref nullobject,
                ref items, ref copies, ref pages, ref pageType, ref oFalse, ref oTrue,
                ref nullobject, ref oFalse, ref nullobject, ref nullobject, ref nullobject, ref nullobject);

            object doNotSaved = Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges;

            ((Microsoft.Office.Interop.Word._Application)wordApp).Quit(ref nullobject, ref nullobject, ref nullobject);
        }
コード例 #23
0
        private void FrmHistoryEditSuratMasuk_Load(object sender, EventArgs e)
        {
            if (!T8UserLoginInfo.HakAkses.ToLower().Contains(("Administrator").ToLower()))
            {
                DataTable dt = new DataTable();
                dt = TemplateQuery.GetTemplateAktifKategori(T8UserLoginInfo.Username, "kategori_surat");
                string tmp = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (tmp == "")
                    {
                        tmp = tmp + "'" + dt.Rows[i][0].ToString() + "'";
                    }
                    else
                    {
                        tmp = tmp + ",'" + dt.Rows[i][0].ToString() + "'";
                    }
                }

                if (dt.Rows.Count != 0)
                {
                    this.patent_filter = " where nomor_agenda in( select nomor_agenda from surat_masuk where kategori in(" + tmp + ")) ";
                }

                dt  = new DataTable();
                dt  = TemplateQuery.GetTemplateAktifTKKeamanan(T8UserLoginInfo.Username, "tingkat_keamanan");
                tmp = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (tmp == "")
                    {
                        tmp = tmp + "'" + dt.Rows[i][0].ToString() + "'";
                    }
                    else
                    {
                        tmp = tmp + ",'" + dt.Rows[i][0].ToString() + "'";
                    }
                }
                if (dt.Rows.Count != 0)
                {
                    if (this.temp_filter != "")
                    {
                        this.patent_filter = this.patent_filter + " and nomor_agenda in( select nomor_agenda from surat_masuk where tk_keamanan in(" + tmp + ")) ";
                    }
                    else
                    {
                        this.patent_filter = " where nomor_agenda in( select nomor_agenda from surat_masuk where tk_keamanan in(" + tmp + ")) ";
                    }
                }
            }
            else
            {
                this.patent_filter = "";
            }
            this.filter      = this.patent_filter;
            this.temp_filter = this.patent_filter;
            lblUsername.Text = T8UserLoginInfo.Username;
            GridHeaderGenerate();
            if (GeneralSettings.OtomatisSimpanHistoriLocal)
            {
                radCheckBox1.Checked = LocalSettings.AutoSizeHistoryEditSuratMasuk;
                radCheckBox2.Checked = LocalSettings.AdministratorTableHistoryEditSuratMasuk;
            }
            this.page                   = 0;
            this.count_no_limit         = 0;
            dropDownLimit.SelectedIndex = 0;
        }
コード例 #24
0
ファイル: FlowController.cs プロジェクト: xuerui131/GDS
        private List <View_Template> getTemplateApprovalList(NameValueCollection queryParams, List <Department> departmentList)
        {
            try
            {
                var query = new TemplateQuery(queryParams);

                var sqlCondition = new StringBuilder();
                sqlCondition.Append("ISNULL(IsDelete,0)!=1 and status=0");//Status审批状态为0(草稿),1同意,2拒绝

                if (departmentList != null && departmentList.Count > 0)
                {
                    sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                }

                //if (userType != GDS.Entity.Constant.ConstantDefine.Admin)  //验证审批权限
                //{
                //    var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName);

                //    if (departmentList != null && departmentList.Count > 0)
                //    {
                //        sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) ");
                //    }
                //    else
                //    {
                //        return Json(new ResponseEntity<dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet);
                //    }
                //}

                if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0")
                {
                    sqlCondition.Append($" and DepartId = {query.DepartId}");
                }

                if (!string.IsNullOrEmpty(query.ProjectType))
                {
                    sqlCondition.Append($" and ProjectType = {query.ProjectType}");
                }

                if (!string.IsNullOrEmpty(query.Name))
                {
                    sqlCondition.Append($" and Name like '%{query.Name}%'");
                }

                if (!string.IsNullOrEmpty(query.CreateBy))
                {
                    sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'");
                }

                PageRequest preq = new PageRequest
                {
                    TableName      = " [View_Template] ",
                    Where          = sqlCondition.ToString(),
                    Order          = " Id DESC ",
                    IsSelect       = true,
                    IsReturnRecord = true,
                    PageSize       = query.PageSize,
                    PageIndex      = query.PageIndex,
                    FieldStr       = "*"
                };

                var result = new TemplateBLL().GetView_TemplateByPage(preq);
                result.ForEach(template => {
                    template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty;
                });

                //var response = new ResponseEntity<object>(true, string.Empty,
                //    new DataGridResultEntity<View_Template>
                //    {
                //        TotalRecords = preq.Out_AllRecordCount,
                //        DisplayRecords = preq.Out_PageCount,
                //        ResultData = result
                //    });

                return(result); //Json(response, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return(new List <View_Template>());
            }
        }