Exemple #1
0
        public static void AddWorkLog(WorkLogType logType, int amount, object batchCode, int segment, object objectId, object userid)
        {
            if (string.IsNullOrEmpty(ToolHelper.GetValue(batchCode)))
            {
                return;
            }
            string date = ToolHelper.GetDateValue(DateTime.Now, "yyyy-MM-dd");
            int    type = (int)logType;

            string existQuery = $"SELECT wl_id FROM work_log WHERE wl_user_id='{userid}' AND wl_datetime='{date}' AND wl_batch_code='{batchCode}' AND wl_type='{type}' AND wl_segment={segment}";
            object result     = SqlHelper.ExecuteOnlyOneQuery(existQuery);

            if (result != null)
            {
                string updateSQL = $"UPDATE work_log SET wl_amount += {amount} WHERE wl_id='{result}'";
                SqlHelper.ExecuteNonQuery(updateSQL);
            }
            else
            {
                //新增记录
                string insertSQL = "INSERT INTO work_log(wl_id, wl_type, wl_batch_code, wl_amount, wl_datetime, wl_user_id, wl_segment, wl_object_id) VALUES" +
                                   $"('{Guid.NewGuid().ToString()}', '{type}', '{batchCode}', '{amount}', '{date}', '{userid}', {segment}, '{objectId}')";
                SqlHelper.ExecuteNonQuery(insertSQL);
            }
        }
Exemple #2
0
        private void LoadLoginLog(string key)
        {
            view.Rows.Clear();
            searchControl.Properties.Items.Clear();
            string querySQL = $"SELECT TOP(1000) sll.*, ul.real_name FROM sys_login_log sll " +
                              $"LEFT JOIN user_list ul ON sll_user_id = ul_id WHERE 1=1 ";

            if (key != null)
            {
                querySQL += $" AND ul.real_name LIKE '%{key}%' ";
            }
            querySQL += "ORDER BY CONVERT(DATETIME, sll_online_date) DESC";
            DataTable table = SqlHelper.ExecuteQuery(querySQL);

            foreach (DataRow row in table.Rows)
            {
                int i = view.Rows.Add();
                view.Rows[i].Cells["id"].Value        = i + 1;
                view.Rows[i].Cells["username"].Value  = row["real_name"];
                view.Rows[i].Cells["ipaddress"].Value = row["sll_ipaddress"];
                view.Rows[i].Cells["login"].Value     = ToolHelper.GetDateValue(row["sll_online_date"], "yyyy-MM-dd HH:mm:dd");
                view.Rows[i].Cells["logout"].Value    = ToolHelper.GetDateValue(row["sll_offline_date"], "yyyy-MM-dd HH:mm:dd");

                searchControl.Properties.Items.Add(row["real_name"]);
            }
        }
Exemple #3
0
        private void Btn_Sure_Click(object sender, EventArgs e)
        {
            if (CheckDatas())
            {
                object primaryKey = Guid.NewGuid().ToString();
                if (lbl_FIleName.Tag == null)
                {
                    string code      = lbl_Code.Text;
                    string unit      = txt_Unit.Text;
                    string user      = txt_User.Text;
                    string phone     = txt_Phone.Text;
                    int    ftype     = cbo_FileType.SelectedIndex;
                    string bdate     = ToolHelper.GetDateValue(txt_Borrow_Date.EditValue, "yyyy-MM-dd HH:mm");
                    string bterm     = txt_Borrow_Term.Text;
                    string sbdate    = ToolHelper.GetDateValue(txt_Should_Return_Date.EditValue, "yyyy-MM-dd");
                    string loguser   = lbl_LogUser.Text;
                    string remark    = txt_Remark.Text;
                    string insertSQL = "INSERT INTO borrow_log(bl_id, bl_code, bl_file_id, bl_borrow_state, bl_return_state, bl_form, bl_user, bl_user_unit, bl_user_phone, bl_date, bl_term, bl_should_return_term, bl_log_user, bl_remark) " +
                                       $"VALUES ('{primaryKey}', '{code}', '{FILE_ID}', '{1}', '{0}', '{ftype}', '{user}', '{unit}', '{phone}', '{bdate}', '{bterm}', '{sbdate}', '{loguser}', '{remark}')";

                    SqlHelper.ExecuteNonQuery(insertSQL);
                }
                else
                {
                    primaryKey = lbl_FIleName.Tag;
                    string rbdate    = ToolHelper.GetDateValue(txt_Real_Return_Date.EditValue, "yyyy-MM-dd HH:mm:dd");
                    string updateSQL = $"UPDATE borrow_log SET bl_real_return_term='{rbdate}', bl_borrow_state=0, bl_return_state=1 WHERE bl_id='{primaryKey}'";
                    SqlHelper.ExecuteNonQuery(updateSQL);
                }
                DevExpress.XtraEditors.XtraMessageBox.Show("操作成功。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                DialogResult = DialogResult.OK;
                Tag          = primaryKey;
                Close();
            }
        }
        /// <param name="boxId">盒主键</param>
        public Frm_BorrowEditBox(object boxId, object borrowId, bool isLog)
        {
            string queryCon = string.Empty;

            if (isLog)
            {
                queryCon = $"AND bl.bl_id='{borrowId}'";
            }
            BOX_ID = boxId;
            InitializeComponent();
            cbo_FileType.Items.AddRange(new object[] { "原件", "复印件", "电子" });
            DataRow row = SqlHelper.ExecuteSingleRowQuery("SELECT * FROM processing_box " +
                                                          "LEFT JOIN(" +
                                                          "  SELECT pi_id, pi_code, pi_name FROM project_info UNION ALL " +
                                                          "  SELECT ti_id, ti_code, ti_name FROM topic_info UNION ALL " +
                                                          "  SELECT imp_id, imp_code, imp_name FROM imp_info UNION ALL " +
                                                          "  SELECT imp_id, imp_code, imp_name FROM imp_dev_info UNION ALL " +
                                                          "  SELECT si_id, si_code, si_name FROM subject_info)A ON A.pi_id = pb_obj_id " +
                                                          $"LEFT JOIN borrow_log bl ON bl.bl_file_id = pb_id {queryCon} WHERE pb_id = '{boxId}'");

            if (row != null)
            {
                lbl_Code.Tag    = string.IsNullOrEmpty(ToolHelper.GetValue(row["bl_id"])) ? null : row["bl_id"];
                lbl_pCode.Text  = ToolHelper.GetValue(row["pi_code"]);
                lbl_pName.Text  = ToolHelper.GetValue(row["pi_name"]);
                lbl_pGC.Text    = ToolHelper.GetValue(row["pb_gc_id"]);
                lbl_pBoxId.Text = ToolHelper.GetValue(row["pb_box_number"]);
                if (isLog)
                {
                    txt_Unit.Text               = ToolHelper.GetValue(row["bl_user_unit"]);
                    txt_User.Text               = ToolHelper.GetValue(row["bl_user"]);
                    txt_Phone.Text              = ToolHelper.GetValue(row["bl_user_phone"]);
                    txt_Borrow_Date.Text        = ToolHelper.GetDateValue(row["bl_date"], "yyyy-MM-dd HH:mm");
                    txt_Borrow_Term.Text        = ToolHelper.GetValue(row["bl_term"]);
                    cbo_FileType.SelectedIndex  = ToolHelper.GetIntValue(row["bl_form"], -1);
                    txt_Should_Return_Date.Text = ToolHelper.GetValue(row["bl_should_return_term"]);
                    txt_Real_Return_Date.Text   = ToolHelper.GetValue(row["bl_real_return_term"]);
                    lbl_Code.Text               = ToolHelper.GetValue(row["bl_code"]);
                    lbl_LogUser.Text            = ToolHelper.GetValue(row["bl_log_user"]);
                    txt_Remark.Text             = ToolHelper.GetValue(row["bl_remark"]);
                    string value = ToolHelper.GetValue(row["bl_id"]);
                    if (!string.IsNullOrEmpty(value))
                    {
                        lbl_Code.Tag = value;
                        int bstate = ToolHelper.GetIntValue(row["bl_return_state"], 0);
                        if (bstate != 0)
                        {
                            btn_Sure.Enabled = false;
                        }
                        else
                        {
                            btn_Sure.Text = "确认归还";
                        }
                    }
                }
            }
        }
Exemple #5
0
        private void Frm_DomRec_Load(object sender, EventArgs e)
        {
            //来源单位
            DataRow row = SqlHelper.ExecuteSingleRowQuery("SELECT dd_name, trp_log_data FROM transfer_registration_pc " +
                                                          $"LEFT JOIN data_dictionary ON dd_id = com_id WHERE trp_id = '{trpId}';");

            if (row != null)
            {
                lbl_Body.Text  = $"  {row["dd_name"]}:\n";
                lbl_Body.Text += $"  今中国科学技术信息研究所于{ToolHelper.GetDateValue(row["trp_log_data"], "yyyy年MM月")}收到贵单位提交的    捆纸质档案, 电子档案    件," +
                                 $"并于{ToolHelper.GetDateValue(DateTime.Now, "yyyy年MM月")}完成确认," +
                                 $"共计纸质档案    卷,电子档案    件,并附案卷列表(附件一)。 此据。";
            }
            txt_Head.Focus();
        }
Exemple #6
0
        private void BatchRecInfo_Load(object sender, EventArgs e)
        {
            string querySQL = "SELECT C.trp_code, B.real_name, A.wr_source_id, A.wr_date FROM work_registration A " +
                              "LEFT JOIN user_list B ON B.ul_id = A.wr_source_id " +
                              "LEFT JOIN transfer_registration_pc C on A.trp_id = C.trp_id " +
                              $"WHERE A.trp_id = '{TRP_ID}' ORDER BY A.wr_date ";
            DataTable table = SqlHelper.ExecuteQuery(querySQL);

            foreach (DataRow row in table.Rows)
            {
                int i = view.Rows.Add();
                view.Rows[i].Cells[0].Value = row["trp_code"];
                view.Rows[i].Cells[1].Value = ToolHelper.GetDateValue(row["wr_date"], "yyyy-MM-dd HH:mm");
                view.Rows[i].Cells[2].Value = row["real_name"];
                view.Rows[i].Cells[3].Value = GetWorkAmount(TRP_ID, row["wr_source_id"]);
            }
        }
Exemple #7
0
        /// <summary>
        /// 卷内目录
        /// </summary>
        private string GetFileList(object boxId, object docCode, object GCNumber)
        {
            string jnmlString = Resources.jnml;

            jnmlString = jnmlString.Replace("id=\"ajbh\">", $"id=\"ajbh\">{docCode}");
            jnmlString = jnmlString.Replace("id=\"gch\">", $"id=\"gch\">{GCNumber}");

            DataTable dataTable = new DataTable();

            dataTable.Columns.AddRange(new DataColumn[]
            {
                new DataColumn("pfl_code"),
                new DataColumn("pfl_user"),
                new DataColumn("pfl_name"),
                new DataColumn("pfl_pages"),
                new DataColumn("pfl_date"),
                new DataColumn("pfl_remark"),
            });
            DataTable table = SqlHelper.ExecuteQuery($"SELECT pfl_code, pfl_user, pfl_name, pfl_pages, pfl_date, pfl_remark FROM processing_file_list WHERE pfl_box_id='{boxId}' ORDER BY pfl_box_sort");

            foreach (DataRow row in table.Rows)
            {
                dataTable.ImportRow(row);
            }
            int fileCount = dataTable.Rows.Count, pageCount = 0;
            int i = 0;

            foreach (DataRow dataRow in dataTable.Rows)
            {
                int    _page = ToolHelper.GetIntValue(dataRow["pfl_pages"], 0);
                string newRr = "<tr>" +
                               $"<td>{++i}</td>" +
                               $"<td>{dataRow["pfl_code"]}&nbsp;</td>" +
                               $"<td style=\"\">{dataRow["pfl_user"]}&nbsp;</td>" +
                               $"<td style='text-align: left;'>{dataRow["pfl_name"]}&nbsp;</td>" +
                               $"<td>{ToolHelper.GetDateValue(dataRow["pfl_date"], "yyyy-MM-dd")}&nbsp;</td>" +
                               $"<td>{(_page == 0 ? string.Empty : _page.ToString())}&nbsp;</td>" +
                               $"<td>&nbsp;</td>" +
                               $"</tr>";
                jnmlString = jnmlString.Replace("</tbody>", $"{newRr}</tbody>");
                pageCount += ToolHelper.GetIntValue(dataRow["pfl_pages"]);
            }
            jnmlString = jnmlString.Replace("id=\"fileCount\">", $"id=\"fileCount\">{fileCount}");
            jnmlString = jnmlString.Replace("id=\"pageCount\">", $"id=\"pageCount\">{pageCount}");
            return(jnmlString);
        }
Exemple #8
0
 /// <summary>
 /// 获取完整的封面HTML模板页
 /// </summary>
 /// <param name="bj">边距mm数</param>
 private string GetCoverHtmlString(object docName, string fmString, object bj, object GCNumber)
 {
     fmString = fmString.Replace("20mm", $"{bj}");
     if (string.IsNullOrEmpty(ToolHelper.GetValue(parentObjectName)))
     {
         fmString = fmString.Replace("id=\"ajmc\">", $"id=\"ajmc\">{docName}");
     }
     else
     {
         fmString = fmString.Replace("id=\"ajmc\">", $"id=\"ajmc\">{parentObjectName}");
         fmString = fmString.Replace("id=\"ktmc\">", $"id=\"ktmc\">{docName}");
     }
     fmString = fmString.Replace("id=\"bzdw\">", $"id=\"bzdw\">{unitName}");
     fmString = fmString.Replace("id=\"bzrq\">", $"id=\"bzrq\">{ToolHelper.GetDateValue(ljDate, "yyyy-MM-dd")}");
     fmString = fmString.Replace("id=\"bgqx\">", $"id=\"bgqx\">永久");
     fmString = fmString.Replace("id=\"gch\">", $"id=\"gch\">{GCNumber}");
     return(fmString);
 }
Exemple #9
0
        private void LoadFileInfo(object fileId)
        {
            DataRow row = SqlHelper.ExecuteSingleRowQuery($"SELECT * FROM processing_file_list WHERE pfl_id='{fileId}'");

            if (row != null)
            {
                cbo_stage.SelectedValue   = row["pfl_stage"];
                cbo_categor.SelectedValue = row["pfl_categor"];
                txt_fileCode.Text         = GetValue(row["pfl_code"]);
                txt_User.Text             = GetValue(row["pfl_user"]);
                txt_fileName.Text         = GetValue(row["pfl_name"]);
                txt_date.Text             = ToolHelper.GetDateValue(row["pfl_date"], "yyyy-MM-dd");
                num_Pages.Value           = ToolHelper.GetIntValue(row["pfl_pages"], 0);
                num_Count.Value           = ToolHelper.GetIntValue(row["pfl_count"], 0);
                num_Amount.Value          = ToolHelper.GetIntValue(row["pfl_amount"], 0);
                SetRadioValue(row["pfl_type"], pal_type);
                txt_Unit.Text = GetValue(row["pfl_unit"]);
                LoadFileLinkList(GetValue(row["pfl_file_id"]));
                txt_Remark.Text = GetValue(row["pfl_remark"]);
                LoadFileLinkList(fileId);
            }
        }
Exemple #10
0
        /// <summary>
        /// 备考表
        /// </summary>
        private string GetBackupTable(object boxId, object docCode, int boxNumber)
        {
            string bkbString = Resources.bkb;
            string fa        = MicrosoftWordHelper.GetZN(GetFilePageCount(boxId, 1));
            int    _fp       = GetFilePageCount(boxId, 2);
            string fp        = _fp == 0 ? string.Empty : MicrosoftWordHelper.GetZN(_fp);
            string hh        = MicrosoftWordHelper.GetZN(boxNumber);

            bkbString = bkbString.Replace("name=\"count\"", $"name=\"count\" value=\"{fa}\"");
            bkbString = bkbString.Replace("name=\"pages\"", $"name=\"pages\" value=\"{fp}\"");
            bkbString = bkbString.Replace("name=\"number\"", $"name=\"number\" value=\"{hh}\"");
            string newTr = string.Empty;

            if (otherDoc.Rows.Count > 0)
            {
                foreach (DataRow row in otherDoc.Rows)
                {
                    newTr += $"<tr><td>{row["od_name"]}</td>" +
                             $"<td>{row["od_code"]}</td>" +
                             $"<td>{row["od_carrier"]}</td>" +
                             $"<td>{row["od_intro"]}</td></tr>";
                }
            }
            else
            {
                newTr = "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>" +
                        "<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
            }
            bkbString = bkbString.Replace("</tbody>", $"{newTr}</tbody>");

            bkbString = bkbString.Replace("id=\"dh\">", $"id=\"dh\">{docCode}");
            bkbString = bkbString.Replace("id=\"ljr\">", $"id=\"dh\">{ljPeople}");
            bkbString = bkbString.Replace("id=\"ljrq\">", $"id=\"dh\">{ToolHelper.GetDateValue(ljDate, "yyyy-MM-dd")}");
            bkbString = bkbString.Replace("id=\"jcr\">", $"id=\"jcr\">{jcPeople}");
            bkbString = bkbString.Replace("id=\"jcrq\">", $"id=\"jcrq\">{ToolHelper.GetDateValue(jcDate, "yyyy-MM-dd")}");
            return(bkbString);
        }