Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RequireLogin();
        List<com.hooyes.crc.Model.CRCapply> Company = new List<CRCapply>();
        com.hooyes.crc.DAL.RegisterAdmin reg = new RegisterAdmin();
        Company = reg.ListModel();
        StringBuilder sb = new StringBuilder();
        foreach (CRCapply cr in Company)
        {
            string Vistors = cr.Vistors;
            string[] vSpace = { "|#|" };
            string[] vComma = { "," };
            string[] vS = Vistors.Split(vSpace, StringSplitOptions.None);
            string[] vName = vS[0].Split(vComma, StringSplitOptions.None);
            string[] vGender = vS[1].Split(vComma, StringSplitOptions.None);
            string[] vTitle = vS[2].Split(vComma, StringSplitOptions.None);
            string[] vPhone = vS[3].Split(vComma, StringSplitOptions.None);
            string[] vCellPhone = vS[4].Split(vComma, StringSplitOptions.None);
            for (int i = 0; i < vName.Length; i++)
            {
                if (!string.IsNullOrEmpty(vName[i]))
                {
                    string CSVLine = vName[i] + "," + Sex(vGender[i]) + "," + vTitle[i] + "," + vPhone[i] + "," + vCellPhone[i];
                    CSVLine += "," + NoComma(cr.CompanyName) + "," + NoComma(cr.CompanyNameEn) + "," + NoComma(cr.Contact) + "," + NoComma(cr.CompanyType) + "," + NoComma(cr.ProductType) + "," + NoComma(cr.Email) + "," + NoComma(cr.Phone) + "," + NoComma(cr.CellPhone) + "," + NoComma(cr.Fax) + "," + NoComma(cr.CompanyAddress) + "," + NoComma(cr.PostCode);
                    CSVLine += "," + NoComma(cr.WebSite) + "," + NoComma(cr.Suggestion);
                    CSVLine+= "," + Invoice(cr.Invoice)+","+Pay(cr.Pay)+","+ NoComma(cr.RegisterTime.ToString("yyyy-MM-dd"));
                    sb.AppendLine(CSVLine);
                }
            }

        }
           Export(sb.ToString());
    }
Ejemplo n.º 2
0
    protected void hooyesRegisterBtn_Click(object sender, EventArgs e)
    {
        StringBuilder sb = new StringBuilder();

        string vName = Request["vName"].ToString();
        string vGender = Request["vGender"].ToString();
        string vTitle = Request["vTitle"].ToString();
        string vPhone = Request["vPhone"].ToString();
        string vCellPhone = Request["vCellPhone"].ToString();

        string spacor = "|#|";

        sb.Append(vName);
        sb.Append(spacor);
        sb.Append(vGender);
        sb.Append(spacor);
        sb.Append(vTitle);
        sb.Append(spacor);
        sb.Append(vPhone);
        sb.Append(spacor);
        sb.Append(vCellPhone);

        string Vistors = sb.ToString();

        CRCapply model = new CRCapply();

        model.sn =Request["sn"].ToString();
        //Response.Write(model.sn);
        model.CompanyAddress = CompanyAddress.Text;
        model.CompanyName = CompanyName.Text;
        model.CompanyNameEn = CompanyNameEn.Text;
        model.WebSite = WebSite.Text;
        model.Phone = Phone.Text;
        model.CellPhone = CellPhone.Text;
        model.Fax = Fax.Text;
        model.PostCode = PostCode.Text;
        model.Suggestion = Suggestion.Text;
        model.Contact = Contact.Text;
        model.Email = Email.Text;
        model.CompanyType = RadioButtonCompanyType.SelectedValue;
        model.ProductType = RadioButtonProductType.SelectedValue;
        model.Vistors = Vistors;

        model.Pay = (RadioButtonListPay.SelectedValue == "1");
        model.Invoice = (RadioButtonListInvoic.SelectedValue == "1");

        RegisterAdmin reg = new RegisterAdmin();

        bool flag = reg.update(model);
        if (flag)
        {
            GoThankYouUrl("../", "修改成功!", Request.Url.PathAndQuery, "javascript:parent.tb_remove();", " 查  看 ", "关闭窗口");
        }
    }
Ejemplo n.º 3
0
 protected void delete()
 {
     string sn = Request.QueryString.Get("sn");
     if (com.hooyes.crc.helper.Validate.GuidString(sn))
     {
         RegisterAdmin reg = new RegisterAdmin();
         bool flag = reg.delete(sn);
         goBack();
     }
     else
     {
         Response.Write("sn error");
     }
 }
Ejemplo n.º 4
0
 protected void Start()
 {
     string sn = Request["sn"];
     string invoiceStatus = Request["invoice"];
     bool invoice = false;
     if (invoiceStatus.ToLower() == "true")
     {
         invoice = true;
     }
     if (com.hooyes.crc.helper.Validate.GuidString(sn))
     {
         RegisterAdmin reg = new RegisterAdmin();
         bool flag = reg.SetInvoicStatus(sn, invoice);
         ResponseIt();
     }
     else
     {
         Response.Write("{flag:false,msg:'sn error'}");
     }
 }
Ejemplo n.º 5
0
 protected void Start()
 {
     string sn = Request["sn"];
     string payStatus=Request["pay"];
     bool pay = false;
     if (payStatus.ToLower() == "true")
     {
         pay = true;
     }
     if (com.hooyes.crc.helper.Validate.GuidString(sn))
     {
         RegisterAdmin reg = new RegisterAdmin();
         bool flag = reg.SetPayStatus(sn, pay);
         ResponseIt();
     }
     else
     {
         Response.Write("{flag:false,msg:'sn error'}");
     }
 }
Ejemplo n.º 6
0
    /// <summary>
    /// 初始化
    /// </summary>
    /// <param name="xKeyWord"></param>
    protected void InitPage(string xKeyWord)
    {
        int page = Convert.ToInt32(Request.QueryString.Get("page"));
        page = (page <= 0) ? 1 : page;
        string keyWord = Request.QueryString.Get("keyWord");
        keyWord = (string.IsNullOrEmpty(xKeyWord)) ? keyWord : xKeyWord;
        RegisterAdmin reg = new RegisterAdmin();
        int CurrentPage = page;
        int PageSize =20;
        int RecordsCount = reg.count(keyWord);
        PageSize = (PageSize > 0) ? PageSize : 1;
        int PagesCount = RecordsCount / PageSize;
        PagesCount = ((RecordsCount % PageSize) == 0) ? PagesCount : PagesCount + 1;
        CurrentPage = (CurrentPage > PagesCount) ? PagesCount : CurrentPage;
        List<CRCapply> xList = new List<CRCapply>();
        xList = reg.ListModel(PageSize, CurrentPage, keyWord);
        string HTMLTemplate = @"
         <tr>
         <td class='ListTableTdA'><input name='sn' id=""Checkbox{0}"" value='{2}' type=""checkbox"" /></td>
         <td class='ListTableTdB'><a href='ModifyInfo.aspx?sn={2}' target='_blank'>{1}</a></td>
         <td class='ListTableTdDate'>{9}</td>
         <td class='ListTableTdE'><span rel='{2}' pay='{6}' class='{5}'>{3}</span></td>
         <td class='ListTableTdF'><span rel='{2}' invoice='{7}' class='{8}'>{4}</span></td>
         <td class='ListTableTdC'><a href='Delete.aspx?sn={2}' onclick='return confirm(""确定要删除{1}吗?"")' >删除</a></td>
         <td class='ListTableTdD'><a href='ModifyInfo.aspx?sn={2}' target='_blank'>编缉</a></td>
         </tr>";
        StringBuilder sb = new StringBuilder();
        sb.Append("<table class='ListTable'>");
        sb.Append(@"<tr class='ListHead'><td><input id=""CheckboxAllC"" onclick='JSCheckAll(this)' type=""checkbox"" />全选</td><td class='AdminTdA'>公司名称</td>
        <td>报名时间</td>
        <td>交费状态</td><td>开发票</td>
        <td>删除</td><td>编辑</td></tr>");
        object[] param = new object[10];
        for (int i = 0; i < xList.Count; i++)
        {
            param[0] = i;
            param[1] = xList[i].CompanyName;
            param[2] = xList[i].sn;
            param[3] = xList[i].Pay ? "已付" : "未付";
            param[4] = xList[i].Invoice ? "是" : "否";
            param[5] = xList[i].Pay ? "pay" : "unpay";
            param[6] = xList[i].Pay;
            param[7] = xList[i].Invoice;
            param[8] = xList[i].Invoice ? "invoice" : "uninvoice";
            param[9] = xList[i].RegisterTime.ToString("yyyy-MM-dd");
            sb.AppendFormat(HTMLTemplate, param);
        }
        sb.Append("</table>");
        xLiteral1.Text = sb.ToString();
        //分页导航
        string PageIndexUrl = null;
        StringBuilder PageIndexUrlSb = new StringBuilder();
        PageIndexUrlSb.Append("default.aspx?");
        PageIndexUrlSb.AppendFormat("keyWord={0}&", HttpUtility.UrlEncode(keyWord));
        PageIndexUrlSb.Append("page");
        PageIndexUrl = PageIndexUrlSb.ToString();
        pageLiteral1.Text = com.hooyes.crc.helper.Page.ShowPage(PageIndexUrl, "", RecordsCount, PageSize, CurrentPage, true, "个");

        //显示关键字导航
        ShowTip(keyWord);

        //test
        //reg.SetPayStatus("893a0934-7f8e-480e-9095-7d02383437f2", false);
        // reg.SetInvoicStatus("893a0934-7f8e-480e-9095-7d02383437f2", true);
    }
Ejemplo n.º 7
0
    protected void InitPage()
    {
        string sn = Request.QueryString.Get("sn");

        if (com.hooyes.crc.helper.Validate.GuidString(sn))
        {

            CRCapply model = new CRCapply();
            RegisterAdmin reg = new RegisterAdmin();
            model = reg.model(sn);
            CompanyAddress.Text = model.CompanyAddress;
            CompanyName.Text = model.CompanyName;
            CompanyNameEn.Text = model.CompanyNameEn;
            WebSite.Text = model.WebSite;
            Phone.Text = model.Phone;
            CellPhone.Text = model.CellPhone;
            Fax.Text = model.Fax;
            PostCode.Text = model.PostCode;
            Suggestion.Text = model.Suggestion;
            Contact.Text = model.Contact;
            Email.Text = model.Email;
            //单选框初始化
            RadioButtonListPay.SelectedIndex = (model.Pay) ? 0 : 1;
            RadioButtonListInvoic.SelectedIndex = (model.Invoice) ? 0 : 1;
            string TypeScript = "<script type=\"text/javascript\">SelectAapter('{0}','{1}');</script>";

            this.Page.ClientScript.RegisterStartupScript(typeof(Page), "script1", string.Format(TypeScript,"RadioButtonCompanyType", model.CompanyType));
            this.Page.ClientScript.RegisterStartupScript(typeof(Page), "script2", string.Format(TypeScript, "RadioButtonProductType", model.ProductType));

            //Vistors

            string Vistors = model.Vistors;
            string[] vSpace ={ "|#|" };
            string[] vComma ={ "," };
            string[] vS = Vistors.Split(vSpace, StringSplitOptions.None);
            string[] vName = vS[0].Split(vComma, StringSplitOptions.None);
            string[] vGender = vS[1].Split(vComma, StringSplitOptions.None);
            string[] vTitle = vS[2].Split(vComma, StringSplitOptions.None);
            string[] vPhone = vS[3].Split(vComma, StringSplitOptions.None);
            string[] vCellPhone = vS[4].Split(vComma, StringSplitOptions.None);

            // HTML
            StringBuilder sb = new StringBuilder();

            string HTMLTemplate = @"<div id=""HOOYESDIVCCC{7}""><table width='100%'>
        <tr><td><input name=""vName""  class=""RegisterInputShort"" type=""text"" value='{0}' /></td><td>
        <select  name=""vGender""><option  value="""">请选择</option><option {5} value=""female"">女</option>
        <option {6} value=""male"">男</option>
        </select>
        </td>
        <td><input name=""vTitle"" class=""RegisterInputShort"" type=""text"" value='{2}' /></td><td>
        <input name=""vPhone""  class=""RegisterInputShort"" type=""text"" value='{3}' /></td><td>
        <input name=""vCellPhone""  class=""RegisterInputShort"" type=""text"" value='{4}' /></td><td width='5%'><a href='javascript:void(0)' onclick=""Remove('HOOYESDIVCCC{7}')"">删除</a></td></tr></table></div>";
            object[] param = new object[8];
            for (int i = 0; i < vName.Length; i++)
            {

                param[0] = vName[i];
                param[1] = vGender[i];
                param[2] = vTitle[i];
                param[3] = vPhone[i];
                param[4] = vCellPhone[i];
                param[5] = "";
                param[6] = "";
                param[7] = i;
                // Response.Write(param[1]);
                if (vGender[i] == "female")
                {
                    param[5] = "selected=\"selected\"";
                }
                if (vGender[i] == "male")
                {

                    param[6] = "selected=\"selected\"";
                }
                sb.AppendFormat(HTMLTemplate, param);

            }

            vLiteral1.Text = sb.ToString();

        }
        else
        {
            Response.Write("sn 参数不正确");
            Response.End();
        }
    }