Exemplo n.º 1
0
        public static string UpdateLeadData(LeadData leadData, string username, bool actStatus, bool actDelegate, bool actOwner)
        {
            try
            {
                DateTime updateDate = DateTime.Now;
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    KKSlmTrLeadModel lead = new KKSlmTrLeadModel();
                    lead.UpdateData(leadData, username, actDelegate, actOwner, updateDate);

                    KKSlmTrCusInfoModel customerInfo = new KKSlmTrCusInfoModel();
                    customerInfo.UpdateData(leadData, username, updateDate);

                    KKSlmTrProductInfoModel productInfo = new KKSlmTrProductInfoModel();
                    productInfo.UpdateData(leadData, username);

                    KKSlmTrChannelInfoModel channelInfo = new KKSlmTrChannelInfoModel();
                    channelInfo.UpdateData(leadData, username);

                    if (actStatus == true || actDelegate == true)
                    {
                        KKSlmTrActivityModel Activity = new KKSlmTrActivityModel();
                        Activity.InsertData(leadData, username, updateDate);

                        KKSlmTrHistoryModel historydel = new KKSlmTrHistoryModel();
                        historydel.InsertData(leadData.TicketId, SLMConstant.HistoryTypeCode.UpdateDelegate, leadData.OldDelegate, leadData.NewDelegate, username, updateDate);
                    }

                    if (actOwner == true)
                    {
                        KKSlmTrActivityModel Activity = new KKSlmTrActivityModel();
                        Activity.InsertDataChangeOwner(leadData, username, updateDate);

                        KKSlmTrHistoryModel historydel = new KKSlmTrHistoryModel();
                        historydel.InsertData(leadData.TicketId, SLMConstant.HistoryTypeCode.UpdateOwner, leadData.OldOwner2, leadData.NewOwner2, username, updateDate);
                    }

                    KKSlmTrHistoryModel history = new KKSlmTrHistoryModel();
                    history.InsertData(leadData.TicketId, SLMConstant.HistoryTypeCode.UpdateLead, "", "", username, updateDate);

                    ts.Complete();
                }
                return(leadData.TicketId);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public static void UpdateTransferOwnerLead(List <string> ticketList, string newowner, int staffid, string username, string branchcode, string Oldowner)
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                    IsolationLevel = IsolationLevel.ReadCommitted
                }))
                {
                    KKSlmTrLeadModel lead = new KKSlmTrLeadModel();
                    lead.UpdateTransferLeadOwner(ticketList, newowner, staffid, username, branchcode);

                    KKSlmTrActivityModel act = new KKSlmTrActivityModel();
                    act.InsertDataForTransfer(ticketList, Oldowner, newowner, username, "", "");

                    ts.Complete();
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }