Ejemplo n.º 1
0
 public void AddRequest(int qid,string name,string title,string rTitle,string details,bool spVisible,bool sampVisible)
 {
     LeadInfoItem item = new LeadInfoItem(qid,name, title,rTitle, details, spVisible, sampVisible);
     AddRequest(item);
 }
Ejemplo n.º 2
0
        private void SaveTempLeads()
        {
            string tempGuid = Util.GetCookie(_COOKIE_NAME);
            if (tempGuid.Length != 32)
            {
                tempGuid = Util.NewGuid;
            }

            LeadInfo info = new LeadInfo(tempGuid);
            info.Category = Request.Form["currentCategory"].Trim();
            ArrayList questions = Question.List(info.Category);
            if (questions.Count == 0)
            {
                Response.Write("false:4");
                return;
            }

            foreach (Question question in questions)
            {
                bool spVisilble = (question.Decoration == QuestionDecoration.ForSupplier || question.Decoration == QuestionDecoration.ForSupplierAndSampleLeads);
                bool sampVisible = (question.Decoration == QuestionDecoration.ForSampleLeads || question.Decoration == QuestionDecoration.ForSupplierAndSampleLeads);
                string details = "";

                if (!String.IsNullOrEmpty(question.VariableName.Trim()))
                {
                    details = Request.Form[question.VariableName] == null ? "" : Request.Form[question.VariableName].Trim();
                    switch (question.VariableName.ToLower())
                    {
                        case "sparea":
                            info.Area = TrimSpAreas(details,5);
                            details = ConvertAreaCodeToName(info.Area);
                            break;

                        case "spindustry":
                            info.IndustryRequired = details == "1";
                            details = info.IndustryRequired ? "�ǵ�" : "����ν";
                            break;

                        case "spnature":
                            try
                            {
                                info.Nature = Convert.ToInt16(details);
                                if (info.Nature==0)
                                {
                                    details = "���ڹ�˾";
                                }
                                else if (info.Nature == 1)
                                {
                                    details = "���ʹ�˾";
                                }
                                else
                                {
                                    details = "��Ҫ��";
                                }
                            }
                            catch
                            {
                                //
                            }
                            break;

                        case "byarea":
                            info.BuyerArea = details;
                            details = ConvertAreaCodeToName(info.BuyerArea);
                            break;

                        case "byemail":
                            info.Email = details;
                            break;
                    }
                }
                else
                {
                    details = Request.Form["QUESTION_" + question.Id] == null ? "" : Request.Form["QUESTION_" + question.Id].Trim();
                }

                LeadInfoItem item = new LeadInfoItem(question.Id, question.VariableName, question.Title,question.RequestTitle, details, spVisilble, sampVisible);
                info.AddRequest(item);
            }

            if (info.SaveAs(GeneralConfig.AppDataPath + "\\Leads\\temp\\"))
            {
                Util.WriteCookie(_COOKIE_NAME, info.Guid, 30);
                Util.WriteCookie("KEBIBI_BUYER_EMAIL", info.Email, 360);//�洢Email��Cookie
                Response.Write("true");
                return;
            }
            Response.Write("false:5");
        }
Ejemplo n.º 3
0
 public void AddRequest(LeadInfoItem item)
 {
     if (!requests.Contains(item))
     {
         requests.Add(item);
     }
 }