예제 #1
0
        public Result SendCancelInterview(int ContactId)
        {
            var log = new TmpLogServiceInfo();

            log.Status   = 0;
            log.CallType = (int)CallType.SendCancelInterview;
            log.Time     = DateTime.Now;
            try
            {
                var model = new CancelInterview();
                model.hocVienID = ContactId;

                var ws     = new WsCRMSoapClient("WsCRMSoap");
                var input  = JsonConvert.SerializeObject(model);
                var output = ws.CancelInterview(input); // Sửa tên Hàm của CongNN viết

                var result = JsonConvert.DeserializeObject <Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status      = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code        = 1;
                result.Description = "Không gửi được hủy phỏng vấn cho chuyên môn";
                log.Description    = result.Description;
                log.Status         = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
        }
예제 #2
0
        public Result SendRequestSB100Topica(int ContactId, int feePackageType) // tuy chon, thoa thich
        {
            var log = new TmpLogServiceInfo();

            log.Status   = 0;
            log.CallType = (int)CallType.SendRequestSB100Topica;
            log.Time     = DateTime.Now;
            try
            {
                var TVTS        = UserRepository.GetCurrentUserInfo();
                var infoContact = ContactRepository.GetInfo(ContactId);
                var infoResult  = TestResultRepository.GetResultTopicaCurent(ContactId);
                var model       = new SB100Topica();
                model.hocVienId = ContactId;
                model.ngayTest  = infoResult.TestDate;
                model.S1        = infoResult.S1;
                model.S2        = infoResult.S2;
                model.S3        = infoResult.S3;
                model.S4        = infoResult.S4;
                var phones = PhoneRepository.GetByContact(ContactId);
                foreach (var phone in phones)
                {
                    if (phone.IsPrimary == 1)
                    {
                        model.mobile = phone.PhoneNumber;
                        break;
                    }
                }
                model.tenHocVien = infoContact.Fullname;
                model.TVTS       = TVTS.UserName;

                var infoLevel = ContactLevelInfoRepository.GetInfoByContactId(ContactId);
                model.kieuHocPhiId = feePackageType; // infoLevel.FeePackageType;
                var infoUser = UserRepository.GetInfo(infoContact.UserConsultantId);


                var ws     = new WsCRMSoapClient("WsCRMSoap");
                var input  = JsonConvert.SerializeObject(model);
                var output = ws.UpdateSB100_topica(input);

                var result = JsonConvert.DeserializeObject <Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status      = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code        = 1;
                result.Description = "Không gửi được thông tin tài khoản cấp cho Chuyên Môn";
                log.Description    = result.Description;
                log.Status         = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
        }
예제 #3
0
        public Result SendInterviewInfo(AppointmentInterviewInfo info, bool isVip)
        {
            var log = new TmpLogServiceInfo();

            log.Status   = 0;
            log.CallType = (int)CallType.SendInterviewInfo;
            log.Time     = DateTime.Now;
            try
            {
                //gọi link của CongNN truyền vào các tham số contactId, Account, Password trên
                var model = new InterviewInfo();
                model.hocVienID = info.ContactId;
                var infoContact = ContactRepository.GetInfo(info.ContactId);
                model.hoTenHocVien = infoContact.Fullname;

                model.ngayHenPV     = (DateTime)info.AppointmentDate;
                model.khungGioID    = info.TimeSlotId;
                model.ghiChuLichHen = info.Notes;
                var phones = PhoneRepository.GetByContact(info.ContactId);
                foreach (var phone in phones)
                {
                    if (phone.IsPrimary == 1)
                    {
                        model.dienThoaiHV = phone.PhoneNumber;
                        break;
                    }
                }
                //model.dienThoaiHV = infoContact.Mobile1;
                model.kieuGV      = info.TeacherTypeId;
                model.levelTester = info.LevelTesterId;
                //model.UserId = infoContact.UserConsultantId;
                var infoUser = UserRepository.GetInfo(info.UserId);
                model.AccountTVTS = infoUser.UserName;


                var ws    = new WsCRMSoapClient("WsCRMSoap");
                var input = JsonConvert.SerializeObject(model);

                var output = isVip == true?ws.UpdateTTPhongVanForVip(input) : ws.UpdateTTPhongVan(input);

                var result = JsonConvert.DeserializeObject <Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status      = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code        = 1;
                result.Description = "Có lỗi xảy ra trong quá trình đặt lịch phỏng vấn. Error: " + ex.Message;
                log.Description    = result.Description;
                log.Status         = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
        }
예제 #4
0
        public Result SendCasecAccount(CasecAccountInfo info)
        {
            var log = new TmpLogServiceInfo();

            log.Status   = 0;
            log.CallType = (int)CallType.SendCasecAccount;
            log.Time     = DateTime.Now;
            try
            {
                var model = new CasecAccount();
                model.contactId    = info.ContactId;
                model.casecAccount = info.Account;
                model.passWord     = info.Password;
                //
                var infoContact = ContactRepository.GetInfo(info.ContactId);
                model.tenHV = infoContact.Fullname;

                var ws     = new WsCRMSoapClient("WsCRMSoap");
                var input  = JsonConvert.SerializeObject(model);
                var output = ws.UpdateAcountCasec(input);

                var result = JsonConvert.DeserializeObject <Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status      = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code        = 1;
                result.Description = "Không gửi được thông tin tài khoản cấp cho Chuyên Môn";
                log.Description    = result.Description;
                log.Status         = result.Code;
                TmpLogServiceRepository.Create(log);
                return(result);
            }
        }
예제 #5
0
파일: HelpUtils.cs 프로젝트: haoas/CRMTPE
        // tuy chon, thoa thich
        public Result SendRequestSB100(int ContactId, int feePackageType)
        {
            var log = new TmpLogServiceInfo();
            log.Status = 0;
            log.CallType = (int)CallType.SendRequestSB100;
            log.Time = DateTime.Now;
            try
            {
                //
                var infoContact = ContactRepository.GetInfo(ContactId);
                var model = new SB100();
                model.hocVienId = ContactId;
                model.hoTenHocVien = infoContact.Fullname;
                var phones = PhoneRepository.GetByContact(ContactId);
                foreach (var phone in phones)
                {
                    if (phone.IsPrimary == 1)
                    {
                        model.dienThoai = phone.PhoneNumber;
                        break;
                    }
                }
                var infoLevel = ContactLevelInfoRepository.GetInfoByContactId(ContactId);
                model.kieuHocPhiId = feePackageType; // infoLevel.FeePackageType;
                var infoUser = UserRepository.GetInfo(infoContact.UserConsultantId);
                model.TVTS = infoUser.UserName;

                var ws = new WsCRMSoapClient("WsCRMSoap");
                var input = JsonConvert.SerializeObject(model);
                var output = ws.UpdateSB100(input);

                var result = JsonConvert.DeserializeObject<Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code = 1;
                result.Description = "Không gửi được thông tin tài khoản cấp cho Chuyên Môn";
                log.Description = result.Description;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
        }
예제 #6
0
파일: HelpUtils.cs 프로젝트: haoas/CRMTPE
        public Result SendInterviewInfo(AppointmentInterviewInfo info)
        {
            var log = new TmpLogServiceInfo();
            log.Status = 0;
            log.CallType = (int)CallType.SendInterviewInfo;
            log.Time = DateTime.Now;
            try
            {
                //gọi link của CongNN truyền vào các tham số contactId, Account, Password trên
                var model = new InterviewInfo();
                model.hocVienID = info.ContactId;
                var infoContact = ContactRepository.GetInfo(info.ContactId);
                model.hoTenHocVien = infoContact.Fullname;

                model.ngayHenPV = (DateTime)info.AppointmentDate;
                model.khungGioID = info.TimeSlotId;
                model.ghiChuLichHen = info.Notes;
                var phones = PhoneRepository.GetByContact(info.ContactId);
                foreach (var phone in phones)
                {
                    if (phone.IsPrimary == 1)
                    {
                        model.dienThoaiHV = phone.PhoneNumber;
                        break;
                    }
                }
                //model.dienThoaiHV = infoContact.Mobile1;
                model.kieuGV = info.TeacherTypeId;
                //model.UserId = infoContact.UserConsultantId;
                var infoUser = UserRepository.GetInfo(info.UserId);
                model.AccountTVTS = infoUser.UserName;

                var ws = new WsCRMSoapClient("WsCRMSoap");
                var input = JsonConvert.SerializeObject(model);
                var output = ws.UpdateTTPhongVan(input);

                var result = JsonConvert.DeserializeObject<Result>(output);

                log.Description = result.Description+"_"+input;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code = 1;
                result.Description = "Không gửi được thông tin đặt lịch phỏng vấn cho chuyên môn";
                log.Description = result.Description;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
        }
예제 #7
0
파일: HelpUtils.cs 프로젝트: haoas/CRMTPE
        public Result SendCasecAccount(CasecAccountInfo info)
        {
            var log = new TmpLogServiceInfo();
            log.Status = 0;
            log.CallType = (int)CallType.SendCasecAccount;
            log.Time = DateTime.Now;
            try
            {
                var model = new CasecAccount();
                model.contactId = info.ContactId;
                model.casecAccount = info.Account;
                model.passWord = info.Password;
                //
                var infoContact = ContactRepository.GetInfo(info.ContactId);
                model.tenHV = infoContact.Fullname;

                var ws = new WsCRMSoapClient("WsCRMSoap");
                var input = JsonConvert.SerializeObject(model);
                var output = ws.UpdateAcountCasec(input);

                var result = JsonConvert.DeserializeObject<Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code = 1;
                result.Description = "Không gửi được thông tin tài khoản cấp cho Chuyên Môn";
                log.Description = result.Description;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
        }
예제 #8
0
파일: HelpUtils.cs 프로젝트: haoas/CRMTPE
        public Result SendCancelInterview(int ContactId)
        {
            var log = new TmpLogServiceInfo();
            log.Status = 0;
            log.CallType = (int)CallType.SendCancelInterview;
            log.Time = DateTime.Now;
            try
            {
                var model = new CancelInterview();
                model.hocVienID = ContactId;

                var ws = new WsCRMSoapClient("WsCRMSoap");
                var input = JsonConvert.SerializeObject(model);
                var output = ws.CancelInterview(input); // Sửa tên Hàm của CongNN viết

                var result = JsonConvert.DeserializeObject<Result>(output);

                log.Description = result.Description + "_" + input;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
            catch (Exception ex)
            {
                var result = new Result();
                result.Code = 1;
                result.Description = "Không gửi được hủy phỏng vấn cho chuyên môn";
                log.Description = result.Description;
                log.Status = result.Code;
                TmpLogServiceRepository.Create(log);
                return result;
            }
        }