username@email.com
2024-12-18 21a248a0cf76b6f05fcaac6f90975ef15ab607a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.OA;
using CY.BLL.Sys;
 
namespace CY.WebForm.Pages.business
{
    //吴辉
    //商业信函打印格式选择
    public partial class SendAllLettersChange : BasePage
    {
        Sys_DictionaryBLL bll_Sys_DictionaryBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
 
        //初始化
        public SendAllLettersChange()
        {
            bll_Sys_DictionaryBLL = new Sys_DictionaryBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindType();
            }
        }
 
        //绑定快递单类型
        public void BindType()
        {
            string Keyid = Request["Keyid"].ToString2();
            string[] Keyids = Keyid.Trim(',').Split(',');
 
            this.spanCustormsCount.InnerText = Keyids.Length.ToString2();
            this.spanAllChangeCount.InnerText = Keyids.Length.ToString2();
            this.txtStartNum.Value = "1";
            this.txtStartNum.Attributes.Add("max", Keyids.Length.ToString2());
            this.txtEndNum.Value = Keyids.Length.ToString2();
            this.txtEndNum.Attributes.Add("max", Keyids.Length.ToString2());
 
            this.selEMSType.DataSource = bll_Sys_DictionaryBLL.GetDataByType("快递单模版");
            this.selEMSType.DataValueField = "Name";
            this.selEMSType.DataTextField = "Name";
            this.selEMSType.DataBind();
 
            this.Sender.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, true);
            this.Sender.DataTextField = "Name";
            this.Sender.DataValueField = "Name";
            this.Sender.DataBind();
 
            if (CurrentUser.StaffId > 0)
            {
                this.Sender.SelectedValue = CurrentUser.TrueName;
            }
        }
 
        //提交打印
        protected void btn_submit_print(object sender, EventArgs e)
        {
            try
            {
                string Keyid = Request["Keyid"].ToString2().Trim(',');
                string[] Keyids = Keyid.Split(',');
                int StartNum = this.txtStartNum.Value.ToInt32() ?? 0;
                int EndNum = this.txtEndNum.Value.ToInt32() ?? Keyids.Length;
                int ChangeLength = EndNum - StartNum+1;
                if (ChangeLength <= 0)
                {
                    JavaScript.MessageBox("请选择正确的打印范围", this);
                }
                else
                {
                    string[] newKeyids = new string[EndNum - StartNum + 1];
                    for (int i = 0; i <= EndNum - StartNum; i++)
                        newKeyids[i] = Keyids[i +StartNum-1];
 
                    string newKeyid = string.Join(",", newKeyids);
                    string PrintType = this.selEMSType.SelectedValue.ToString2();
 
                    string OutScript = "OpenByFramDialog('/Pages/business/SendAllLetters.aspx?i=" + newKeyid + "&p=" + PrintType + "&d=" + this.Sender.SelectedValue + "&s=" + Request["sendfrom"].ToString2() + "&h=" + this.txtInfoName.Value+ "','商业信函', 930, 580);";
                    //Response.Write("<SCRIPT language='JavaScript'> " + OutScript + "</SCRIPT>");
                    this.ClientScript.RegisterStartupScript(this.GetType(), "key", string.Format("<script>{0}</script>", OutScript));
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("请选择正确的打印范围", this);
            }
        }
    }
}