Ejemplo n.º 1
0
        //public bool InsertLeadData(LeadData leadData, List<CampaignWSData> camDataList, string createbyUsername)
        //{
        //    string ticketId = "";
        //    try
        //    {
        //        StoreProcedure store = new StoreProcedure();
        //        ticketId = store.GenerateTicketId();
        //        leadData.TicketId = ticketId;

        //        foreach (CampaignWSData cpdata in camDataList)
        //        {
        //            cpdata.TicketId = ticketId;
        //        }

        //        using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))
        //        {
        //            KKSlmTrLeadModel lead = new KKSlmTrLeadModel();
        //            lead.InsertData(leadData, createbyUsername);

        //            KKSlmTrCusInfoModel customerInfo = new KKSlmTrCusInfoModel();
        //            customerInfo.InsertData(leadData, createbyUsername);

        //            KKSlmTrProductInfoModel productInfo = new KKSlmTrProductInfoModel();
        //            productInfo.InsertData(leadData, createbyUsername);

        //            KKSlmTrChannelInfoModel channelInfo = new KKSlmTrChannelInfoModel();
        //            channelInfo.InsertData(leadData, createbyUsername);

        //            KKSLMTrCampaignFinalModel camFinal = new KKSLMTrCampaignFinalModel();
        //            camFinal.InsertCampaignList(camDataList, createbyUsername);

        //            ts.Complete();
        //        }
        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        _Error = ex.Message.ToString();
        //        return false;
        //    }
        //}

        public string InsertLeadSuggestCampaign(LeadData leadData, CampaignWSData cpdata, string createByUsername)
        {
            string ticketId = "";

            try
            {
                DateTime createDate = DateTime.Now;
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    StoreProcedure store = new StoreProcedure();
                    ticketId          = store.GenerateTicketId();
                    leadData.TicketId = ticketId;
                    cpdata.TicketId   = ticketId;

                    List <ProductData> prodList = SlmScr016Biz.GetProductCampaignDataForSuggestCampaign(cpdata.CampaignId);
                    if (prodList.Count > 0)
                    {
                        leadData.ProductGroupId = prodList[0].ProductGroupId;
                        leadData.ProductId      = prodList[0].ProductId;
                        leadData.ProductName    = prodList[0].ProductName;
                    }

                    KKSlmTrLeadModel lead = new KKSlmTrLeadModel();
                    lead.InsertData(leadData, createByUsername, createDate);

                    KKSlmTrCusInfoModel customerInfo = new KKSlmTrCusInfoModel();
                    customerInfo.InsertData(leadData, createByUsername, createDate);

                    KKSlmTrProductInfoModel productInfo = new KKSlmTrProductInfoModel();
                    productInfo.InsertData(leadData, createByUsername);

                    KKSlmTrChannelInfoModel channelInfo = new KKSlmTrChannelInfoModel();
                    channelInfo.InsertData(leadData, createByUsername, createDate);

                    KKSLMTrCampaignFinalModel camFinal = new KKSLMTrCampaignFinalModel();
                    camFinal.InsertData(cpdata, createByUsername, createDate);

                    KKSlmTrHistoryModel history = new KKSlmTrHistoryModel();
                    history.InsertData(ticketId, SLMConstant.HistoryTypeCode.CreateLead, "", "", createByUsername, createDate);

                    ts.Complete();
                }
                return(ticketId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public static string InsertLeadData(LeadData leadData, CampaignWSData camData, string createbyUsername)
        {
            string ticketId = "";

            try
            {
                StoreProcedure store = new StoreProcedure();
                ticketId          = store.GenerateTicketId();
                leadData.TicketId = ticketId;
                camData.TicketId  = ticketId;

                DateTime createDate = DateTime.Now;

                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    KKSlmTrLeadModel lead = new KKSlmTrLeadModel();
                    lead.InsertData(leadData, createbyUsername, createDate);

                    KKSlmTrCusInfoModel customerInfo = new KKSlmTrCusInfoModel();
                    customerInfo.InsertData(leadData, createbyUsername, createDate);

                    KKSlmTrProductInfoModel productInfo = new KKSlmTrProductInfoModel();
                    productInfo.InsertData(leadData, createbyUsername);

                    KKSlmTrChannelInfoModel channelInfo = new KKSlmTrChannelInfoModel();
                    channelInfo.InsertData(leadData, createbyUsername, createDate);

                    KKSLMTrCampaignFinalModel camFinal = new KKSLMTrCampaignFinalModel();
                    camFinal.InsertData(camData, createbyUsername, createDate);

                    KKSlmTrHistoryModel history = new KKSlmTrHistoryModel();
                    history.InsertData(ticketId, SLMConstant.HistoryTypeCode.CreateLead, "", "", createbyUsername, createDate);

                    ts.Complete();
                }
                return(ticketId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             if (Request["campaignid"] != null)
             {
                 CampaignWSData campaign = SlmMasterBiz.GetCampaign(Request["campaignid"]);
                 if (campaign != null)
                 {
                     lblCampaignName.Text = campaign.CampaignName;
                     ltCampaignDesc.Text  = campaign.CampaignDetail;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         AppUtil.ClientAlert(Page, ex.Message);
     }
 }
Ejemplo n.º 4
0
 public void InsertData(CampaignWSData CamData, string createByUsername, DateTime createDate)
 {
     try
     {
         kkslm_tr_campaignfinal camfinal = new kkslm_tr_campaignfinal();
         camfinal.slm_TicketId           = CamData.TicketId;
         camfinal.slm_CampaignId         = CamData.CampaignId;
         camfinal.slm_CampaignName       = CamData.CampaignName;
         camfinal.slm_Description        = CamData.CampaignDetail;
         camfinal.slm_CreatedBy          = createByUsername;
         camfinal.slm_CreatedBy_Position = GetPositionId(createByUsername, slmdb);
         camfinal.slm_CreatedDate        = createDate;
         camfinal.slm_UpdatedBy          = createByUsername;
         camfinal.slm_UpdatedDate        = createDate;
         slmdb.kkslm_tr_campaignfinal.AddObject(camfinal);
         slmdb.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }