副本 my_list_d.aspx.cs
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:21k
源码类别:

OA系统

开发平台:

ASP/ASPX

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.SqlClient;
  12. //System.Web.HttpUtility.UrlPathEncode 
  13. using Microsoft.Office.Interop.Excel;
  14. using Microsoft.Office.Interop;
  15. using System.Reflection;
  16. using System.Runtime.InteropServices;
  17. using ExcelApplication = Microsoft.Office.Interop.Excel.Application;
  18. using Label = System.Web.UI.WebControls.Label;
  19. public partial class web_approvel_ch_my_list_d : System.Web.UI.Page
  20. {
  21.     protected void Page_Load(object sender, EventArgs e)
  22.     {
  23.         if (!IsPostBack)
  24.         {
  25.             LoginDAO.CheckLogin(Session, Response, "../../", 2);
  26.            
  27.           
  28.             if (Request.QueryString["a_id"] != null)
  29.             {
  30.                 PnlApprovel.Visible = true;
  31.                 PnlFlow.Visible = true;
  32.                 FlowList.DataKeyNames = new string[] { "id" };
  33.                 this.SetValue(Request.QueryString["a_id"]);
  34.                 this.SetAmtValue(Request.QueryString["a_id"]);
  35.             }
  36.             if (Session["user"] != null)
  37.             {
  38.                 User user = (User)Session["user"];
  39.                 DepartmentId.Value = user.Department.Id.ToString();
  40.                 PositionId.Value = user.PositionId.ToString();
  41.             }
  42.         }
  43.     }
  44.     protected void FlowList_RowCreated(object sender, GridViewRowEventArgs e)
  45.     {
  46.         if (e.Row.RowType == DataControlRowType.DataRow)
  47.         {
  48.             SqlConnection conn = dbConnection.getConnection();
  49.             conn.Open();
  50.             SqlCommand cmd = new SqlCommand("select apply_type, is_check, is_agree, comment from " +
  51.                 "OA_CH_APPROVEL_FORM_FLOW where id=" + FlowList.DataKeys[e.Row.RowIndex].Value.ToString(), conn);
  52.             SqlDataReader dr = cmd.ExecuteReader();
  53.             if (dr.Read())
  54.             {
  55.                 Label label = (Label)e.Row.FindControl("LblApplyType");
  56.                 if (dr["apply_type"].ToString().Equals("1"))
  57.                 {
  58.                     label.Text = "會簽";
  59.                 }
  60.                 else if (dr["apply_type"].ToString().Equals("3"))
  61.                 {
  62.                     label.Text = "代理";
  63.                 }
  64.                 else
  65.                 {
  66.                     label.Text = "審批";
  67.                 }
  68.                 label = (Label)e.Row.FindControl("LblIsCheck");
  69.                 if (dr["is_check"].ToString().Equals("N"))
  70.                 {
  71.                     label.Text = "未處理";
  72.                 }
  73.                 else
  74.                 {
  75.                     label.Text = "已處理";
  76.                     label = (Label)e.Row.FindControl("LblIsAgree");
  77.                     if (dr["is_agree"].ToString().Equals("Y"))
  78.                     {
  79.                         label.Text = "已同意";
  80.                     }
  81.                     else
  82.                     {
  83.                         label.Text = "不同意";
  84.                     }
  85.                 }
  86.                 label = (Label)e.Row.FindControl("LblComment");
  87.                 label.Text = dr["comment"].ToString();
  88.             }
  89.             dr.Close();
  90.             conn.Close();
  91.         }
  92.     }
  93.   
  94.     protected void BtnOk_Click(object sender, EventArgs e)
  95.     {
  96.         if (Request.QueryString["a_id"] != null)
  97.         {
  98.             string id = Request.QueryString["a_id"];
  99.             SqlConnection conn = dbConnection.getConnection();
  100.             conn.Open();
  101.             if (State.Value.Equals("2"))
  102.             {
  103.                 SqlTransaction tx = conn.BeginTransaction();
  104.                 try
  105.                 {
  106.                     SqlCommand cmd = new SqlCommand("update OA_CH_BUSINESS_FORM set state=1, total_result='跑流程中' where id=" + id, conn);
  107.                     cmd.Transaction = tx;
  108.                     cmd.ExecuteNonQuery();
  109.                     //mail
  110.                     ArrayList name1 = new ArrayList();
  111.                     ArrayList mail1 = new ArrayList();
  112.                     cmd = new SqlCommand("select top 1 a.email_work,a.emp_name from oa_employee as a inner join " +
  113.                        "oa_ch_approvel_form_flow as b on b.operator_id=a.id left join OA_ch_business_form as c " +
  114.                          "on b.form_id=c.id where b.step=c.step+1 and is_business='Y' and c.id=" + id + " order by position desc", conn);
  115.                     cmd.Transaction = tx;
  116.                     SqlDataReader dr3 = cmd.ExecuteReader();
  117.                     while (dr3.Read())
  118.                     {
  119.                         name1.Add(dr3["emp_name"].ToString());
  120.                         mail1.Add(dr3["email_work"].ToString());
  121.                         //mail.mail_q(mail1[0], name1[0], TxtEmpName.Text, "中幹出差申請單");
  122.                     }
  123.                     dr3.Close();
  124.                     tx.Commit();
  125.                 }
  126.                 catch (Exception ex)
  127.                 {
  128.                     Response.Write(ex.Message);
  129.                     tx.Rollback();
  130.                 }
  131.             }
  132.             else
  133.             {
  134.                 SqlCommand cmd = new SqlCommand("update OA_CH_BUSINESS_FORM set state=1, total_result='跑流程中' where id=" + id, conn);
  135.                 cmd.ExecuteNonQuery();
  136.             }
  137.             conn.Close();
  138.             Response.Redirect("my_list.aspx");
  139.         }
  140.     }
  141.  
  142.     protected void SetValue(string id)
  143.     {
  144.         SqlConnection conn = dbConnection.getConnection();
  145.         conn.Open();
  146.         SqlCommand cmd = new SqlCommand("select a.form_id, e.emp_name, e.emp_no, p.name position, a.apply_date," +
  147.             "d.name department, a.days, a.begin_time, a.end_time,  depart_place, arrive_place, " +
  148.             "a.depart_time, a.arrive_time, a.state from OA_CH_BUSINESS_FORM a inner join OA_EMPLOYEE e on a.emp_id=e.id " +
  149.             "inner join OA_DEPARTMENT d on a.department_id=d.id inner join OA_EMPLOYEE_POSITION p on " +
  150.             "e.position=p.id  where a.id=" + id, conn);
  151.         SqlDataReader dr = cmd.ExecuteReader();
  152.         int state = 0;
  153.         if (dr.Read())
  154.         {
  155.             TxtFormId.Text = dr["form_id"].ToString();
  156.             TxtEmpName.Text = dr["emp_name"].ToString();
  157.             TxtEmpNo.Text = dr["emp_no"].ToString();
  158.             TxtPosition.Text = dr["position"].ToString();
  159.             TxtApplyDate.Text = dr["apply_date"].ToString();
  160.             TxtDepartment.Text = dr["department"].ToString();
  161.             TxtDays.Text = dr["days"].ToString();
  162.             TxtBeginTime.Text = dr["begin_time"].ToString();
  163.             TxtEndTime.Text = dr["end_time"].ToString();
  164.             TxtDepartPlace.Text = dr["depart_place"].ToString();
  165.             TxtArrivePlace.Text = dr["arrive_place"].ToString();
  166.             TxtDepartTime.Text = dr["depart_time"].ToString();
  167.             TxtArriveTime.Text = dr["arrive_time"].ToString();
  168.             state = Convert.ToInt32(dr["state"].ToString());
  169.             State.Value = state.ToString();
  170.         }
  171.         dr.Close();
  172.         int flag = 0;
  173.         cmd = new SqlCommand("select * from OA_CH_BUSINESS_DETAIL where form_id=" + id +
  174.             " order by number", conn);
  175.         dr = cmd.ExecuteReader();
  176.         while (dr.Read())
  177.         {
  178.             flag = 1;
  179.             //動態創建表格行
  180.             TableRow tr1 = new TableRow();
  181.             TableCell td1 = new TableCell();
  182.             td1.BorderWidth = Unit.Pixel(1);
  183.             Label label = new Label();
  184.             label.BorderStyle = BorderStyle.None;
  185.             label.Text = dr["number"].ToString();
  186.             td1.Controls.Add(label);
  187.             tr1.Cells.Add(td1);
  188.             TableCell td2 = new TableCell();
  189.             td2.BorderWidth = Unit.Pixel(1);
  190.             label = new Label();
  191.             label.BorderStyle = BorderStyle.None;
  192.             label.Text = dr["date"].ToString();
  193.             td2.Controls.Add(label);
  194.             tr1.Cells.Add(td2);
  195.             TableCell td3 = new TableCell();
  196.             td3.BorderWidth = Unit.Pixel(1);
  197.             label = new Label();
  198.             label.BorderStyle = BorderStyle.None;
  199.             label.Text = dr["d_start"].ToString();
  200.             td3.Controls.Add(label);
  201.             tr1.Cells.Add(td3);
  202.             TableCell td4 = new TableCell();
  203.             td4.BorderWidth = Unit.Pixel(1);
  204.             label = new Label();
  205.             label.BorderStyle = BorderStyle.None;
  206.             label.Text = dr["d_end"].ToString();
  207.             td4.Controls.Add(label);
  208.             tr1.Cells.Add(td4);
  209.             TableCell td5 = new TableCell();
  210.             td5.BorderWidth = Unit.Pixel(1);
  211.             label = new Label();
  212.             label.BorderStyle = BorderStyle.None;
  213.             label.Text = dr["tool"].ToString();
  214.             td5.Controls.Add(label);
  215.             tr1.Cells.Add(td5);
  216.             TableCell td6 = new TableCell();
  217.             td6.BorderWidth = Unit.Pixel(1);
  218.             label = new Label();
  219.             label.BorderStyle = BorderStyle.None;
  220.             label.Text = dr["content"].ToString();
  221.             td6.Controls.Add(label);
  222.             tr1.Cells.Add(td6);
  223.             TableCell td7 = new TableCell();
  224.             td7.BorderWidth = Unit.Pixel(1);
  225.             label = new Label();
  226.             label.BorderStyle = BorderStyle.None;
  227.             label.Text = dr["remark"].ToString();
  228.             td7.Controls.Add(label);
  229.             tr1.Cells.Add(td7);
  230.             TblDetail.Rows.Add(tr1);
  231.         }
  232.         dr.Close();
  233.         conn.Close();
  234.         if (flag == 0)
  235.         {
  236.             TblDetail.Visible = false;
  237.         }
  238.         if (state != 1)
  239.         {
  240.             PnlFlow.Visible = false;
  241.             Panel1.Visible = true;
  242.         }
  243.     }
  244.     protected void SetAmtValue(string id)
  245.     {
  246.         SqlConnection conn = dbConnection.getConnection();
  247.         conn.Open();
  248.         SqlCommand cmd = new SqlCommand("select * from OA_CH_BUSINESS_DETAIL1 where form_id=" + id, conn);
  249.         SqlDataReader dr = cmd.ExecuteReader();
  250.         while (dr.Read())
  251.         {
  252.             TxtFAmt1.Text = dr["f_eat"].ToString();
  253.             TxtFRemark1.Text = dr["f_eat_remark"].ToString();
  254.             TxtFAmt2.Text = dr["f_house"].ToString();
  255.             TxtFRemark2.Text = dr["f_house_remark"].ToString();
  256.             TxtFAmt3.Text = dr["f_move"].ToString();
  257.             TxtFRemark3.Text = dr["f_move_remark"].ToString();
  258.             TxtFAmt4.Text = dr["f_other"].ToString();
  259.             TxtFRemark4.Text = dr["f_other_remark"].ToString();
  260.             TxtFAmt5.Text = dr["f_total"].ToString();
  261.             TxtFRemark5.Text = dr["f_total_remark"].ToString();
  262.         }
  263.         dr.Close();
  264.         conn.Close();
  265.     }
  266.     protected void Button1_Click(object sender, EventArgs e)
  267.     {
  268.       /*  Response.Clear();
  269.         Response.Buffer = true;
  270.         Response.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("yyyyMMdd") + ".doc");
  271.      //   Response.ContentEncoding = System.Text.Encoding.UTF8;
  272.       //  Response.ContentEncoding = Encoding.UTF7;
  273.         Response.HeaderEncoding = System.Text.Encoding.UTF8;
  274.         Response.ContentType = "vnd.ms-excel/msword";
  275.         this.EnableViewState = false;
  276.         Response.ContentEncoding = System.Text.Encoding.UTF8; 
  277. */
  278.         int r = 1;
  279.         int c = 1;
  280.         int v=0;
  281.         
  282.         ExcelApplication exc = new ExcelApplication();
  283.         exc.Visible = false;
  284.         exc.UserControl = false;
  285.         Workbooks workbooks = exc.Workbooks;
  286.         _Workbook workbook = workbooks.Add(true);
  287.         Sheets shs = workbook.Sheets;
  288.         _Worksheet sh = (_Worksheet)shs.get_Item(1);
  289.         Range rang = sh.get_Range(sh.Cells[1, 1], sh.Cells[1, 11]);
  290.         rang.Merge(true);
  291.         
  292.         rang.Value2 = "流通事業群中幹出差單 ";
  293.         rang.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  294.         string[] t1 = new string[] { "申請單號","'"+TxtFormId.Text.ToString(), "差假别", TxtOffType.Text.ToString(), "申請人工號","'"+TxtEmpNo.Text.ToString(),
  295.             "出差日期起",TxtBeginTime.Text.ToString(), "申請人姓名",TxtEmpName.Text.ToString(),"出差日期止",TxtEndTime.Text.ToString(),"申請日期",TxtApplyDate.Text.ToString(),
  296.             "去程出發地",TxtDepartPlace.Text.ToString(),"申請人部門",TxtDepartment.Text.ToString(),"回程終地點",TxtArrivePlace.Text.ToString(),"申請人職稱",TxtPosition.Text.ToString(),
  297.             "去程)起飛時間",TxtDepartTime.Text.ToString(),"出差天數",TxtDays.Text.ToString(),"(回程)起飛時間",TxtArriveTime.Text.ToString()};
  298.         
  299.         for (int r1 = 0; r1 < t1.Length; r1++)
  300.         {
  301.             if (c < 8)
  302.             {
  303.                 Range rang1 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  304.                 rang1.Merge(true);
  305.                 
  306.                 rang1.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  307.                 rang1.Borders.Weight = XlBorderWeight.xlMedium;
  308.                 rang1.Value2 = t1[r1];
  309.                 c = c + 2;
  310.             }
  311.             else
  312.             {
  313.                  c = 1;
  314.                  r++;
  315.                 Range rang1 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  316.                 rang1.Merge(true);
  317.                 rang1.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  318.                 rang1.Borders.Weight = XlBorderWeight.xlMedium;
  319.                 rang1.Value2 = t1[r1];
  320.                 c = c + 2;
  321.             }
  322.             
  323.                  
  324.               
  325.             
  326.         }
  327.         
  328.         string[] t2=new string[]{"序號","出差期間","起","迄","交通工具","業務內容","備注"};
  329.         r=r+2;
  330.         c = 0;
  331.         for (int r2 = 0; r2 < t2.Length; r2++)
  332.         {
  333.              Range rang2 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  334.             rang2.Merge(true);
  335.             rang2.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  336.             rang2.Borders.Weight = XlBorderWeight.xlMedium;
  337.             rang2.Value2 = t2[r2];
  338.             c = c + 2;
  339.         }
  340.         r = r + 1;
  341.         c = 0;
  342.         SqlConnection conn = dbConnection.getConnection();
  343.         conn.Open();
  344.         SqlCommand cmd = new SqlCommand("select * from OA_CH_BUSINESS_DETAIL where form_id=" + Request.QueryString["a_id"] +
  345.             " order by number", conn);
  346.         SqlDataReader dr = cmd.ExecuteReader();
  347.             
  348.         while (dr.Read())
  349.         {
  350.             Range rang3 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  351.             rang3.Merge(true);
  352.             rang3.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  353.             rang3.Borders.Weight = XlBorderWeight.xlMedium;
  354.             rang3.Value2 =dr["number"].ToString() ;
  355.             c = c + 2;
  356.             Range rang4 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  357.             rang4.Merge(true);
  358.             rang4.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  359.             rang4.Borders.Weight = XlBorderWeight.xlMedium;
  360.             rang4.Value2 = dr["date"].ToString();
  361.             c = c + 2;
  362.             Range rang5 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  363.             rang5.Merge(true);
  364.             rang5.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  365.             rang5.Borders.Weight = XlBorderWeight.xlMedium;
  366.             rang5.Value2 = dr["d_start"].ToString();
  367.             c = c + 2;
  368.             Range rang6 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  369.             rang6.Merge(true);
  370.             rang6.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  371.             rang6.Borders.Weight = XlBorderWeight.xlMedium;
  372.             rang6.Value2 = dr["d_end"].ToString();
  373.             c = c + 2;
  374.             Range rang7 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  375.             rang7.Merge(true);
  376.             rang7.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  377.             rang7.Borders.Weight = XlBorderWeight.xlMedium;
  378.             rang7.Value2 = dr["tool"].ToString();
  379.             c = c + 2;
  380.             Range rang8 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  381.             rang8.Merge(true);
  382.             rang8.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  383.             rang8.Borders.Weight = XlBorderWeight.xlMedium;
  384.             rang8.Value2 = dr["content"].ToString();
  385.             c = c + 2;
  386.             Range rang9 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  387.             rang9.Merge(true);
  388.             rang9.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  389.             rang9.Borders.Weight = XlBorderWeight.xlMedium;
  390.             rang9.Value2 = dr["remark"].ToString();
  391.             c = c + 2;
  392.             r++;
  393.             c = 0;
  394.         }
  395.         dr.Close();
  396.         r = r + 1;
  397.         c = 1;
  398.         string[] t3 = new string[] { "序號", "費用內容", "申請金額", "備注", "1", "膳食費用", TxtFAmt1.Text,TxtFRemark1.Text, "2",
  399.             "住宿費用",TxtFAmt2.Text, TxtFRemark2.Text, "3","交通費用", TxtFAmt3.Text, TxtFRemark3.Text,"4","其他費用", TxtFAmt4.Text,TxtFRemark4.Text,
  400.             "5", "合計",TxtFAmt5.Text,TxtFRemark5.Text };
  401.         for (int r3 = 0; r3 < t3.Length; r3++)
  402.         {
  403.             if (c < 8)
  404.             {
  405.                 Range rang10 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  406.                 rang10.Merge(true);
  407.                 rang10.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  408.                 rang10.Borders.Weight = XlBorderWeight.xlMedium;
  409.                 rang10.Value2 = t3[r3];
  410.                 c = c + 2;
  411.             }
  412.             else
  413.             {
  414.                 c = 1;
  415.                 r++;
  416.                 Range rang10 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  417.                 rang10.Merge(true);
  418.                 rang10.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  419.                 rang10.Borders.Weight = XlBorderWeight.xlMedium;
  420.                 rang10.Value2 = t3[r3];
  421.                 c = c + 2;
  422.             }
  423.         
  424.         }
  425.         r = r + 2;
  426.         c = 1;
  427.        string[] t4 = new string[] {"步驟","辦理人","是否同意","處理意見","辦理日期"};
  428.         for (int r4 = 0; r4 < t4.Length; r4++)
  429.         {
  430.             Range rang11 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  431.             rang11.Merge(true);
  432.             rang11.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  433.             rang11.Borders.Weight = XlBorderWeight.xlMedium;
  434.             rang11.Value2 = t4[r4];
  435.             c = c + 2;
  436.         }
  437.         r = r + 1;
  438.         c = 1;
  439.          cmd = new SqlCommand("SELECT e.emp_name,step,is_agree,comment,check_date from OA_CH_APPROVEL_FORM_FLOW"+
  440.           " as a left join oa_employee as e on a.operator_id=e.id where form_id=" + Request.QueryString["a_id"] +
  441.           " order by step", conn);
  442.          dr = cmd.ExecuteReader();
  443.         while (dr.Read())
  444.         {
  445.             Range rang3 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  446.             rang3.Merge(true);
  447.             rang3.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  448.             rang3.Borders.Weight = XlBorderWeight.xlMedium;
  449.             rang3.Value2 = dr["step"].ToString();
  450.             c = c + 2;
  451.             Range rang4 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  452.             rang4.Merge(true);
  453.             rang4.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  454.             rang4.Borders.Weight = XlBorderWeight.xlMedium;
  455.             rang4.Value2 = dr["emp_name"].ToString();
  456.             c = c + 2;
  457.             Range rang5 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  458.             rang5.Merge(true);
  459.             rang5.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  460.             rang5.Borders.Weight = XlBorderWeight.xlMedium;
  461.             if (dr["is_agree"].Equals("Y"))
  462.             { rang5.Value2 = "同意"; }
  463.             else { rang5.Value2 = "不同意"; }
  464.             c = c + 2;
  465.             Range rang6 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  466.             rang6.Merge(true);
  467.             rang6.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  468.             rang6.Borders.Weight = XlBorderWeight.xlMedium;
  469.             rang6.Value2 = dr["comment"].ToString();
  470.             c = c + 2;
  471.             Range rang7 = sh.get_Range(sh.Cells[r + 2, c + 1], sh.Cells[r + 2, c + 2]);
  472.             rang7.Merge(true);
  473.             rang7.HorizontalAlignment = XlHAlign.xlHAlignCenter;
  474.             rang7.Borders.Weight = XlBorderWeight.xlMedium;
  475.             rang7.Value2 = dr["check_date"].ToString();
  476.             c = c + 2;
  477.                       
  478.             r++;
  479.             c = 1;
  480.         }
  481.         dr.Close();
  482.         conn.Close();
  483.        
  484.             exc.Visible = true;
  485.         exc.UserControl = true;
  486.     }
  487.    
  488. }