Ejemplo n.º 1
0
        private void DeleteCase()
        {
            if (Request.Form["id"] != null)
            {
                int del=CompanyCase.Delete(Convert.ToInt32(Request.Form["id"]), SupplierId);
                if (del > 0)
                {
                    //ͬ������Minisite�İ���
                    MinisiteWriter mw = new MinisiteWriter(SupplierId);
                    mw.UpdateCases(true);

                    Response.Write("true");
                    return;
                }
                else
                {
                    Response.Write("setMessage('�ð����Ѿ������ۻ������ڵȴ����ۣ�����ɾ����',false);");
                    return;
                }
            }
            else
            {
                Response.Write("setMessage('ɾ��ʧ�ܣ�',false);");
            }
        }
Ejemplo n.º 2
0
        private void SaveMinisite()
        {
            Response.Write("<script language=\"javascript\" type=\"text/javascript\">");
            if (Request.Form["logoGuid"] != null &&
                Request.Form["comBrief"] != null &&
                Request.Form["comSvrBrief"] != null &&
                Request.Form["outLinks"] != null)
            {
                HttpPostedFile file = Request.Files["logoFile"];
                if (file.ContentLength > 0 && !CompanyMinisite.CheckLogoAttachment(file))
                {
                    Response.Write("parent.setMessage('��ҵLogo������ͼƬ�����Ҳ��ܳ���100K��',false);");
                }
                else
                {
                    CompanyMinisite site = new CompanyMinisite(SupplierId);
                    site.CompanyBrief = Request.Form["comBrief"].Trim();
                    site.ServiceBrief = Request.Form["comSvrBrief"].Trim();
                    site.OutLinks = Request.Form["outLinks"].Trim();
                    if (Request.Form["logoGuid"].Trim() != "")
                    {
                        site.LogoGuid = Request.Form["logoGuid"].Trim();
                    }

                    if (file.ContentLength > 0)
                    {
                        file.SaveAs(Server.MapPath("/Suppliers/logos/") + site.LogoGuid + ".logo");
                    }

                    if (site.Save())
                    {
                        MinisiteWriter mw = new MinisiteWriter(SupplierId);
                        mw.Update();
                        Response.Write("parent.setMessage('Minisite����ɹ���',true);");
                    }
                    else
                    {
                        Response.Write("parent.setMessage('Minisite����ʧ�ܣ�',false);");
                    }
                }
            }
            else
            {
                Response.Write("parent.setMessage('Minisiteδ�ܱ��棡',false);");
            }
            Response.Write("</script>");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ������ҵ����
        /// </summary>
        private void SaveComInfo()
        {
            if (Request.Form["comName"] != null &&
                //Request.Form["comIndustry"] != null &&
                Request.Form["comNature"] != null &&
                Request.Form["comFounded"] != null &&
                Request.Form["comZIP"] != null &&
                Request.Form["comAddr"] != null &&
                Request.Form["comPhone"] != null &&
                Request.Form["comFax"] != null &&
                Request.Form["comWebsite"] != null)
            {
                Supplier.UpdateBasic(SupplierId,
                                    Request.Form["comName"].Trim(),
                                    "000000",//Request.Form["comIndustry"].Trim(),
                                    Request.Form["comNature"].Trim(),
                                    Request.Form["comAddr"].Trim(),
                                    Request.Form["comPhone"].Trim(),
                                    Request.Form["comZIP"].Trim(),
                                    Request.Form["comWebsite"].Trim(),
                                    Request.Form["comFax"].Trim(),
                                    Convert.ToInt16(Request.Form["comFounded"]));

                MinisiteWriter mw = new MinisiteWriter(SupplierId);
                mw.UpdateCompanyInfo(true);

                Response.Write("setMessage('��ҵ��Ϣ�޸ijɹ���',true);");
            }
            else
            {
                Response.Write("setMessage('����ʧ�ܣ�',false);");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// ����֤��
        /// </summary>
        private void SaveCert()
        {
            Response.Write("<script language=\"javascript\" type=\"text/javascript\">");
            if (Request.Form["certId"] != null &&
                Request.Form["certType"] != null &&
                Request.Form["certName"] != null &&
                Request.Form["certDesc"] != null)
            {
                int certId = Convert.ToInt32(Request.Form["certId"]);
                HttpPostedFile file = Request.Files["certFile"];
                if (file.ContentLength > 0 && !CompanyCertificate.CheckAttachment(file))
                {
                    Response.Write("parent.setMessage('֤�鸽��������ͼƬ�����Ҳ��ܳ����涨��С��',false);");
                }
                else
                {
                    short t=9;
                    try
                    {
                        t=Convert.ToInt16(Request.Form["certType"]);
                    }
                    catch
                    {
                        //
                    }
                    CompanyCertificate cert = new CompanyCertificate(SupplierId, t, Request.Form["certName"].Trim(), Request.Form["certDesc"].Trim());

                    if (certId > 0)
                    {
                        cert.ImageGuid = CompanyCertificate.Get(certId).ImageGuid;
                    }

                    if (file.ContentLength > 0)
                    {
                        file.SaveAs(Server.MapPath("/Suppliers/certs/") + cert.ImageGuid + ".cert");
                    }

                    if (cert.Save(certId))
                    {
                        //ͬ������Minisite��֤��
                        MinisiteWriter mw = new MinisiteWriter(SupplierId);
                        mw.UpdateCerts(true);

                        Response.Write("parent.refreshCertList('֤���ϴ��ɹ����ȴ���ˣ�');");
                    }
                    else
                    {
                        Response.Write("parent.setMessage('֤���ϴ�ʧ�ܣ�',false);");
                    }
                }
            }
            else
            {
                Response.Write("parent.setMessage('����ʧ�ܣ�',false);");
            }
            Response.Write("</script>");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// ɾ��֤��
        /// </summary>
        private void DeleteCert()
        {
            if (Request.Form["certId"] != null)
            {
                try
                {
                    int certId = Convert.ToInt32(Request.Form["certId"]);
                    CompanyCertificate.Delete(certId, SupplierId);

                    //ͬ������Minisite��֤��
                    MinisiteWriter mw = new MinisiteWriter(SupplierId);
                    mw.UpdateCerts(true);

                    Response.Write("$(\"#CERT_" + certId.ToString() + "\").remove();");
                }
                catch
                {
                    Response.Write("setMessage('ɾ��֤��ʧ�ܣ�',false);");
                }
            }
        }
Ejemplo n.º 6
0
        private void SaveCase()
        {
            if (Request.Form["caseTitle"] != null &&
                Request.Form["caseCate"] != null &&
                Request.Form["cName"] != null &&
                Request.Form["cIndustry"] != null &&
                Request.Form["cUrl"] != null &&
                Request.Form["casePeriod"] != null &&
                Request.Form["caseBground"] != null &&
                Request.Form["caseDesc"] != null &&
                Request.Form["caseResult"] != null &&
                Request.Form["caseId"] != null)
            {
                int cid = Convert.ToInt32(Request.Form["caseId"]);
                CompanyCase ca = new CompanyCase(SupplierId);
                ca.Title = Request.Form["caseTitle"].Trim();
                ca.Category = Request.Form["caseCate"].Trim();
                ca.ClientName = Request.Form["cName"].Trim();
                ca.ClientIndustry = Request.Form["cIndustry"].Trim();
                ca.ClientWebsite = Request.Form["cUrl"].Trim();
                ca.Period = Request.Form["casePeriod"].Trim();
                ca.Background = Request.Form["caseBground"].Trim();
                ca.Description = Request.Form["caseDesc"].Trim();
                ca.Result = Request.Form["caseResult"].Trim();
                if (ca.Save(cid))
                {
                    //ͬ������Minisite�İ���
                    MinisiteWriter mw = new MinisiteWriter(SupplierId);
                    mw.UpdateCases(true);

                    Response.Write(ca.Id);
                    return;
                }

                Response.Write(0);
                return;
            }
            else
            {
                Response.Write(0);
            }
        }
Ejemplo n.º 7
0
 public static void SetCheckStatus(int spId,bool chk)
 {
     MinisiteWriter mw = new MinisiteWriter(spId);
     mw.SetCheckStatus(chk);
 }
Ejemplo n.º 8
0
 public static void AddHits(int spId)
 {
     MinisiteWriter mw = new MinisiteWriter(spId);
     mw.AddHits();
 }