Ejemplo n.º 1
0
    protected GetCustomerDetail_Result getCustomerDetail(string client_number)
    {
        GetCustomerDetail_Result obj = new GetCustomerDetail_Result();

        WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService wsobj = new WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService();
        obj.fld_result = wsobj.GetCustomerDetail(admin_username, admin_password, client_number, out obj.fld_sessionID, out obj.fld_customer_name, out obj.fld_customer_surname, out obj.fld_customer_dob, out obj.fld_customer_age, out obj.fld_customer_idcard, out obj.fld_smile_point, out obj.fld_card_type, out obj.fld_email, out obj.fld_address_line1, out obj.fld_address_line2, out obj.fld_address_line3, out obj.fld_mobile_phone_number, out obj.fld_home_phone_number, out obj.fld_office_phone_number, out obj.fld_client_isAgent, out obj.fld_client_isSmileClubMember);
        return(obj);
    }
 protected GetCustomerDetail_Result GetCustomerDetail(string client_number)
 {
     GetCustomerDetail_Result obj = new GetCustomerDetail_Result();
     WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService wsobj = new WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService();
     obj.fld_result = wsobj.GetCustomerDetail(admin_username, admin_password, client_number, out obj.fld_sessionID, out obj.fld_customer_name, out obj.fld_customer_surname, out obj.fld_customer_dob, out obj.fld_customer_age, out obj.fld_customer_idcard, out obj.fld_smile_point, out obj.fld_card_type, out obj.fld_email, out obj.fld_address_line1, out obj.fld_address_line2, out obj.fld_address_line3, out obj.fld_mobile_phone_number, out obj.fld_home_phone_number, out obj.fld_office_phone_number, out obj.fld_client_isAgent, out obj.fld_client_isSmileClubMember);
     return obj;
 }
    public GetCustomerDetail_Result PartnerGetCustomerDetail(string fld_partner_username, string fld_partner_password, string fld_client_number, string fld_mobile_number)
    {
        GetCustomerDetail_Result obj = new GetCustomerDetail_Result();
        RefRunningTBBLL runningobj = new RefRunningTBBLL();
        refnum = runningobj.AddRefRunningTBAndReturn();
        WSLogBLL logobj = new WSLogBLL();

        try
        {
            //ตรวจสอบค่าที่จำเป็นต้องส่งมาให้ครบถ้วนก่อน
            if (fld_partner_username == "" || fld_partner_password == "" || fld_client_number == "")
            {
                //LogRequest: Insert Log Request
                logobj.AddWSLog(fld_partner_username, ipaddress, "Request", "NETWS_ForPartner", "PartnerGetCustomerDetail", fld_partner_username + "|" + fld_partner_password + "|" + fld_client_number + "|" + fld_mobile_number, refnum);

                obj.fld_result = "notcomplete_กรุณาระบุ Partner Username หรือ Partner Password หรือ Client Number ให้ถูกต้อง";

                //LogResponse: Insert Log Response
                logobj.AddWSLog(fld_partner_username, ipaddress, "Response", "NETWS_ForPartner", "PartnerGetCustomerDetail", obj.fld_result + "|" + fld_partner_username + "|" + fld_client_number + "|" + obj.fld_sessionID, refnum);

                return obj;
            }
            else
            {
                //พิสูจน์ตัวตนของพันธมิตรก่อนที่จะให้ใช้งานจริง
                NETWS_ForPartnerAuthenticationChecking.CheckPartnerAuthentication_Result pacobj = CheckPartnerAuthenticationReturnDetail(fld_partner_username, fld_partner_password, ipaddress);
                if (pacobj.Result.Trim().ToLower() == "passed")
                {
                    try
                    {
                        //LogRequest: Insert Log Request
                        logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Request", "NETWS_ForPartner", "PartnerGetCustomerDetail", fld_partner_username + "|" + fld_partner_password + "|" + fld_client_number + "|" + fld_mobile_number, refnum);

                        GetCustomerDetail_Result mtlwsobj = MTLGetCustomerDetail(fld_client_number);
                        obj.fld_result = mtlwsobj.fld_result;
                        obj.fld_sessionID = mtlwsobj.fld_sessionID;

                        //ใช้เพื่อกำหนดค่าสำหรับ Output ที่เฉพาะเจาะจงให้กับแต่ละพันธมิตร
                        switch (pacobj.PartnerName.Trim())
                        {
                            case "i-wiz":
                                //ตรวจสอบเงื่อนไขต่างๆ ตามความต้องการ
                                #region i-wiz เงื่อนไขการตรวจสอบจาก CRM สำหรับโมเดล 2
                                /**************************************
                                Step1 ลูกค้าพิมพ์ SMS ข้อความ Client Number เช่น 1201404626 แล้วส่งมาที่เบอร์ 4839009
                                Step2 ระบบ i-wiz & MTL ตรวจสอบตามเงื่อนไข
                                Step3 แจ้งตอบกลับลูกค้าผ่าน SMS
                                **************************************/
                                //กรณีส่ง message ผิดเบอร์ [ควบคุมไม่ได้]
                                //ไม่แสดงข้อความ
                                /*
                                 * ไม่ต้องทำอะไร
                                 */

                                //กรณีเบอร์มือถือไม่ตรงกับฐานข้อมูลเบอร์ใน SMC
                                //ขออภัยค่ะ เบอร์โทรศัพท์ของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด 4 ค่ะ (70)
                                /*
                                 * .NET ต้องเช็คกับข้อมูลที่ได้จาก MTLGetCustomerDetail() ให้ (ข้อมูลเบอร์โทรมือถือ SMC ที่ต๋องเพิ่มใหม่)
                                 */

                                //กรณี Client Number ไม่มีในระบบ
                                //ขออภัยค่ะ เลขที่ประจำตัวไม่ถูกต้อง กรุณาตรวจสอบและส่งใหม่อีกครั้งค่ะ (68)
                                /*
                                 * .NET ต้องเช็คกับ fld_result จาก MTLGetCustomerDetail() ให้ (notfound)
                                 */

                                //กรณีเบอร์มือถือและ Client Number ไม่ match กันกับฐานข้อมูลใน SMC
                                //เบอร์มือถือและเลขประจำตัวของท่านไม่ตรงกับในระบบ กรุณาติดต่อ 1766 กด 4 ค่ะ (69)
                                /*
                                 * ??? เช็คยังไง ??? .NET ต้องเช็คกับข้อมูลที่ได้จาก MTLGetCustomerDetail() ให้
                                 */

                                //กรณีระบบขัดข้อง เช่น ส่งถูกเบอร์แล้วไม่ได้รับข้อความตอบกลับ
                                //ขออภัยค่ะ ระบบขัดข้องชั่วคราว กรุณาติดต่อ 1766 กด 4 ค่ะ (55)
                                /*
                                 * i-wiz ต้องเช็คให้
                                 */

                                //กรณีตรวจสอบคะแนนสะสมได้
                                //คะแนนสะสม Smile Point คงเหลือของคุณคือ xxxx.xx คะแนน โดยมีคะแนนที่จะหมดอายุในวันที่ 30/06/xx จำนวน xxxx.xx คะแนน และ 31/12/xx xxxx.xx คะแนนค่ะ (140)
                                /*
                                 * .NET ต้องเช็คกับ fld_result จาก MTLGetCustomerDetail() ให้ (found)
                                 */
                                #endregion

                                if (mtlwsobj.fld_result.Trim() == "notfound")
                                {
                                    //obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เลขที่ประจำตัวของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                    obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เลขที่ประจำตัวของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด4ค่ะ";
                                }
                                else if (mtlwsobj.fld_result.Trim() == "notfound_ข้อมูลยังรันไม่เสร็จ")
                                {
                                    //obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ ระบบยังไม่สามารถให้บริการได้ในขณะนี้ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                    //20130908: นิวแจ้งแก้ไข 26/08/2013
                                    obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ ระบบไม่สามารถให้บริการได้ในขณะนี้ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                }
                                else if (mtlwsobj.fld_client_isSmileClubMember.Trim() != "Y" && mtlwsobj.fld_client_isSmileClubMember != "S")
                                {
                                    obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เลขที่ประจำตัวของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด4ค่ะ";
                                }
                                else if (mtlwsobj.fld_result.Trim() == "found" && (mtlwsobj.fld_mobile_phone_number_SMC.Trim() != fld_mobile_number.Trim()))
                                {
                                    //obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เบอร์โทรศัพท์ของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                    obj.fld_result = "notcomplete_MSG_เบอร์มือถือไม่ตรงกับเลขที่ประจำตัวของท่านในระบบ กรุณาติดต่อ1766กด4ค่ะ";
                                }
                                else
                                {
                                    switch (obj.fld_result.Trim())
                                    {
                                        case "notfound_ข้อมูลยังรันไม่เสร็จ":
                                            //obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ ระบบยังไม่สามารถให้บริการได้ในขณะนี้ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                            //20130908: นิวแจ้งแก้ไข 26/08/2013
                                            obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ ระบบไม่สามารถให้บริการได้ในขณะนี้ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                            break;
                                        case "notfound":
                                            //obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เลขที่ประจำตัวของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด 4 ค่ะ";
                                            obj.fld_result = "notcomplete_MSG_ขออภัยค่ะ เลขที่ประจำตัวของท่านไม่ได้รับสิทธิ์ กรุณาติดต่อ 1766 กด4ค่ะ";
                                            break;
                                        case "found":
                                            obj.fld_customer_name = mtlwsobj.fld_customer_name;
                                            obj.fld_customer_surname = mtlwsobj.fld_customer_surname;
                                            obj.fld_customer_dob = mtlwsobj.fld_customer_dob;
                                            obj.fld_customer_age = mtlwsobj.fld_customer_age;
                                            obj.fld_customer_idcard = mtlwsobj.fld_customer_idcard;
                                            obj.fld_smile_point = mtlwsobj.fld_smile_point;
                                            obj.fld_card_type = mtlwsobj.fld_card_type;
                                            obj.fld_email = mtlwsobj.fld_email;
                                            obj.fld_address_line1 = mtlwsobj.fld_address_line1;
                                            obj.fld_address_line2 = mtlwsobj.fld_address_line2;
                                            obj.fld_address_line3 = mtlwsobj.fld_address_line3;
                                            obj.fld_mobile_phone_number = mtlwsobj.fld_mobile_phone_number;
                                            obj.fld_home_phone_number = mtlwsobj.fld_home_phone_number;
                                            obj.fld_office_phone_number = mtlwsobj.fld_office_phone_number;
                                            obj.fld_client_isAgent = mtlwsobj.fld_client_isAgent;
                                            obj.fld_client_isSmileClubMember = mtlwsobj.fld_client_isSmileClubMember;
                                            obj.fld_expiry_point_round1 = mtlwsobj.fld_expiry_point_round1;
                                            obj.fld_expiry_date_round1 = mtlwsobj.fld_expiry_date_round1;
                                            obj.fld_expiry_point_round2 = mtlwsobj.fld_expiry_point_round2;
                                            obj.fld_expiry_date_round2 = mtlwsobj.fld_expiry_date_round2;
                                            obj.fld_mobile_phone_number_SMC = mtlwsobj.fld_mobile_phone_number_SMC;

                                            //obj.fld_result = "completed_MSG_คะแนนสะสม Smile Point คงเหลือของคุณคือ " + obj.fld_smile_point.Trim() + " คะแนน โดยมีคะแนนที่จะหมดอายุในวันที่ " + obj.fld_expiry_date_round1.Trim() + " จำนวน " + obj.fld_expiry_point_round1.Trim() + " คะแนน และ " + obj.fld_expiry_date_round2.Trim() + " " + obj.fld_expiry_point_round2.Trim() + " คะแนนค่ะ";
                                            obj.fld_result = "completed_MSG_คะแนนสะสมคงเหลือของคุณคือ " + obj.fld_smile_point.Trim() + " คะแนนค่ะ แจ้งเวลา " + GetCurrentDateTime();
                                            break;
                                        default:
                                            obj.fld_result = "notcomplete";
                                            break;
                                    }
                                }
                                break;
                            default:
                                obj.fld_customer_name = mtlwsobj.fld_customer_name;
                                obj.fld_customer_surname = mtlwsobj.fld_customer_surname;
                                obj.fld_customer_dob = mtlwsobj.fld_customer_dob;
                                obj.fld_customer_age = mtlwsobj.fld_customer_age;
                                obj.fld_customer_idcard = mtlwsobj.fld_customer_idcard;
                                obj.fld_smile_point = mtlwsobj.fld_smile_point;
                                obj.fld_card_type = mtlwsobj.fld_card_type;
                                obj.fld_email = mtlwsobj.fld_email;
                                obj.fld_address_line1 = mtlwsobj.fld_address_line1;
                                obj.fld_address_line2 = mtlwsobj.fld_address_line2;
                                obj.fld_address_line3 = mtlwsobj.fld_address_line3;
                                obj.fld_mobile_phone_number = mtlwsobj.fld_mobile_phone_number;
                                obj.fld_home_phone_number = mtlwsobj.fld_home_phone_number;
                                obj.fld_office_phone_number = mtlwsobj.fld_office_phone_number;
                                obj.fld_client_isAgent = mtlwsobj.fld_client_isAgent;
                                obj.fld_client_isSmileClubMember = mtlwsobj.fld_client_isSmileClubMember;
                                obj.fld_expiry_point_round1 = mtlwsobj.fld_expiry_point_round1;
                                obj.fld_expiry_date_round1 = mtlwsobj.fld_expiry_date_round1;
                                obj.fld_expiry_point_round2 = mtlwsobj.fld_expiry_point_round2;
                                obj.fld_expiry_date_round2 = mtlwsobj.fld_expiry_date_round2;
                                obj.fld_mobile_phone_number_SMC = mtlwsobj.fld_mobile_phone_number_SMC;
                                break;
                        }

                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Response", "NETWS_ForPartner", "PartnerGetCustomerDetail", obj.fld_result + "|" + pacobj.PartnerName + "|" + fld_client_number + "|" + obj.fld_sessionID, refnum);

                        //20130909: CRM ให้เพิ่มส่ง SMS เอง
                        bool sendResult = SendSMS(fld_mobile_number, obj.fld_result.Replace("completed_MSG_", "").Replace("notcomplete_MSG_", ""));
                        return obj;
                    }
                    catch (Exception ex)
                    {
                        //LogRequest: Insert Log Request
                        logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Request", "NETWS_ForPartner", "PartnerGetCustomerDetail", fld_partner_username + "|" + fld_partner_password + "|" + fld_client_number + "|" + fld_mobile_number, refnum);

                        obj.fld_result = "notcomplete_" + ex.ToString();

                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Response", "NETWS_ForPartner", "PartnerGetCustomerDetail", obj.fld_result + "|" + pacobj.PartnerName + "|" + fld_client_number + "|" + obj.fld_sessionID, refnum);

                        return obj;
                    }
                }
                else
                {
                    //LogRequest: Insert Log Request
                    logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Request", "NETWS_ForPartner", "PartnerGetCustomerDetail", fld_partner_username + "|" + fld_partner_password + "|" + fld_client_number + "|" + fld_mobile_number, refnum);

                    obj.fld_result = pacobj.Result.Trim().Replace("notpass_", "notcomplete_");

                    //LogResponse: Insert Log Response
                    logobj.AddWSLog(pacobj.PartnerName, ipaddress, "Response", "NETWS_ForPartner", "PartnerGetCustomerDetail", obj.fld_result + "|" + pacobj.PartnerName + "|" + fld_client_number + "|" + obj.fld_sessionID, refnum);

                    return obj;
                }
            }
        }
        catch (Exception ex)
        {
            //LogRequest: Insert Log Request
            logobj.AddWSLog(fld_partner_username, ipaddress, "Request", "NETWS_ForPartner", "PartnerGetCustomerDetail", fld_partner_username + "|" + fld_partner_password + "|" + fld_client_number + "|" + fld_mobile_number, refnum);

            obj.fld_result = "notcomplete_" + ex.ToString();

            //LogResponse: Insert Log Response
            logobj.AddWSLog(fld_partner_username, ipaddress, "Response", "NETWS_ForPartner", "PartnerGetCustomerDetail", obj.fld_result + "|" + obj.fld_sessionID, refnum);

            return obj;
        }
    }
    private GetCustomerDetail_Result MTLGetCustomerDetail(string fld_client_number)
    {
        GetCustomerDetail_Result obj = new GetCustomerDetail_Result();

        //1. Call ApplinX Web Services GetCustomerDetail()
        MTL.WS_Admin.WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService wsobj = new MTL.WS_Admin.WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService();
        obj.fld_result = wsobj.GetCustomerDetail(admin_username, admin_password, fld_client_number, out obj.fld_sessionID, out obj.fld_customer_name, out obj.fld_customer_surname, out obj.fld_customer_dob, out obj.fld_customer_age, out obj.fld_customer_idcard, out obj.fld_smile_point, out obj.fld_card_type, out obj.fld_email, out obj.fld_address_line1, out obj.fld_address_line2, out obj.fld_address_line3, out obj.fld_mobile_phone_number, out obj.fld_home_phone_number, out obj.fld_office_phone_number, out obj.fld_client_isAgent, out obj.fld_client_isSmileClubMember, out obj.fld_expiry_point_round1, out obj.fld_expiry_date_round1, out obj.fld_expiry_point_round2, out obj.fld_expiry_date_round2, out obj.fld_mobile_phone_number_SMC);

        /*
         * ตัวอย่างข้อมูลสำหรับทดสอบ
         */
        //GetCustomerDetail_Result obj = new GetCustomerDetail_Result
        //{
        //    fld_result = "found",
        //    fld_sessionID = "U012341",
        //    fld_customer_name = "สุนทร",
        //    fld_customer_surname = "ธนาประเสริฐสุข",
        //    fld_customer_dob = "17/05/2521",
        //    fld_customer_age = "35",
        //    fld_customer_idcard = "3-7605-00235-26-9",
        //    fld_smile_point = "1200.50",
        //    fld_card_type = "Smile",
        //    fld_email = "*****@*****.**",
        //    fld_address_line1 = "250 ถ.รัชดาภิเษก ห้วยขวาง กทม. 10310",
        //    fld_address_line2 = "",
        //    fld_address_line3 = "",
        //    fld_mobile_phone_number = "0868212217",
        //    fld_home_phone_number = "032461573",
        //    fld_office_phone_number = "022902098",
        //    fld_client_isAgent = "N",
        //    fld_client_isSmileClubMember = "Y",
        //    fld_expiry_point_round1 = "1000.00",
        //    fld_expiry_date_round1 = "30/06/56",
        //    fld_expiry_point_round2 = "200.50",
        //    fld_expiry_date_round2 = "31/12/56",
        //    fld_mobile_phone_number_SMC = "0868212217"
        //};

        return obj;
    }
    public GetCustomerDetail_Result GetCustomerDetail(string fld_channel, string fld_partner_branch_code, string fld_partner_branch_name, string fld_client_number)
    {
        GetCustomerDetail_Result obj = new GetCustomerDetail_Result();
        RefRunningTBBLL runningobj = new RefRunningTBBLL();
        refnum = runningobj.AddRefRunningTBAndReturn();
        WSLogBLL logobj = new WSLogBLL();
        try
        {
            if (fld_channel == "" || fld_channel.ToUpper() != "TESTEDC" || fld_client_number == "")
            {
                //LogRequest: Insert Log Request
                logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "GetCustomerDetail", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number, refnum);

                obj.fld_result = "notpass_กรุณาระบุ Channel หรือ Client Number ให้ถูกต้อง";
                //LogResponse: Insert Log Response
                logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                return obj;
            }
            else
            {
                switch (fld_channel.ToUpper())
                {
                    case "TESTEDC":
                        try
                        {
                            //LogRequest: Insert Log Request
                            logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "GetCustomerDetail", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number, refnum);

                            //เอาชื่อ-นามสกุลลูกค้าจาก Method GetCustomerDetail มาแสดงด้วย
                            GetCustomerDetail_Result obj2 = getCustomerDetail(fld_client_number);
                            obj.fld_result = obj2.fld_result;
                            obj.fld_sessionID = obj2.fld_sessionID;
                            obj.fld_customer_name = obj2.fld_customer_name;
                            obj.fld_customer_surname = obj2.fld_customer_surname;
                            obj.fld_customer_dob = obj2.fld_customer_dob;
                            obj.fld_customer_age = obj2.fld_customer_age;
                            obj.fld_customer_idcard = obj2.fld_customer_idcard;
                            obj.fld_smile_point = obj2.fld_smile_point;
                            obj.fld_card_type = obj2.fld_card_type;
                            obj.fld_email = obj2.fld_email;
                            obj.fld_address_line1 = obj2.fld_address_line1;
                            obj.fld_address_line2 = obj2.fld_address_line2;
                            obj.fld_address_line3 = obj2.fld_address_line3;
                            obj.fld_mobile_phone_number = obj2.fld_mobile_phone_number;
                            obj.fld_home_phone_number = obj2.fld_home_phone_number;
                            obj.fld_office_phone_number = obj2.fld_office_phone_number;
                            obj.fld_client_isAgent = obj2.fld_client_isAgent;
                            obj.fld_client_isSmileClubMember = obj2.fld_client_isSmileClubMember;
                            //LogResponse: Insert Log Response
                            logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                            return obj;
                        }
                        catch (Exception ex)
                        {
                            obj.fld_result = ex.ToString();
                            //LogResponse: Insert Log Response
                            logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                            return obj;
                        }
                        break;
                    default:
                        obj.fld_result = "notfound_ระบบของท่านไม่มีสิทธิ์ตรวจสอบรายละเอียดของสมาชิกเมืองไทย Smile Club";
                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                        return obj;
                        break;
                }
            }
        }
        catch (Exception ex)
        {
            obj.fld_result = ex.ToString();
            //LogResponse: Insert Log Response
            logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

            return obj;
        }
    }
Ejemplo n.º 6
0
    public GetCustomerDetail_Result GetCustomerDetail(string fld_channel, string fld_partner_branch_code, string fld_partner_branch_name, string fld_client_number)
    {
        GetCustomerDetail_Result obj        = new GetCustomerDetail_Result();
        RefRunningTBBLL          runningobj = new RefRunningTBBLL();

        refnum = runningobj.AddRefRunningTBAndReturn();
        WSLogBLL logobj = new WSLogBLL();

        try
        {
            if (fld_channel == "" || fld_channel.ToUpper() != "TESTEDC" || fld_client_number == "")
            {
                //LogRequest: Insert Log Request
                logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "GetCustomerDetail", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number, refnum);

                obj.fld_result = "notpass_กรุณาระบุ Channel หรือ Client Number ให้ถูกต้อง";
                //LogResponse: Insert Log Response
                logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                return(obj);
            }
            else
            {
                switch (fld_channel.ToUpper())
                {
                case "TESTEDC":
                    try
                    {
                        //LogRequest: Insert Log Request
                        logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "GetCustomerDetail", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number, refnum);

                        //เอาชื่อ-นามสกุลลูกค้าจาก Method GetCustomerDetail มาแสดงด้วย
                        GetCustomerDetail_Result obj2 = getCustomerDetail(fld_client_number);
                        obj.fld_result                   = obj2.fld_result;
                        obj.fld_sessionID                = obj2.fld_sessionID;
                        obj.fld_customer_name            = obj2.fld_customer_name;
                        obj.fld_customer_surname         = obj2.fld_customer_surname;
                        obj.fld_customer_dob             = obj2.fld_customer_dob;
                        obj.fld_customer_age             = obj2.fld_customer_age;
                        obj.fld_customer_idcard          = obj2.fld_customer_idcard;
                        obj.fld_smile_point              = obj2.fld_smile_point;
                        obj.fld_card_type                = obj2.fld_card_type;
                        obj.fld_email                    = obj2.fld_email;
                        obj.fld_address_line1            = obj2.fld_address_line1;
                        obj.fld_address_line2            = obj2.fld_address_line2;
                        obj.fld_address_line3            = obj2.fld_address_line3;
                        obj.fld_mobile_phone_number      = obj2.fld_mobile_phone_number;
                        obj.fld_home_phone_number        = obj2.fld_home_phone_number;
                        obj.fld_office_phone_number      = obj2.fld_office_phone_number;
                        obj.fld_client_isAgent           = obj2.fld_client_isAgent;
                        obj.fld_client_isSmileClubMember = obj2.fld_client_isSmileClubMember;
                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                        return(obj);
                    }
                    catch (Exception ex)
                    {
                        obj.fld_result = ex.ToString();
                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                        return(obj);
                    }
                    break;

                default:
                    obj.fld_result = "notfound_ระบบของท่านไม่มีสิทธิ์ตรวจสอบรายละเอียดของสมาชิกเมืองไทย Smile Club";
                    //LogResponse: Insert Log Response
                    logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                    return(obj);

                    break;
                }
            }
        }
        catch (Exception ex)
        {
            obj.fld_result = ex.ToString();
            //LogResponse: Insert Log Response
            logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "GetCustomerDetail", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

            return(obj);
        }
    }
Ejemplo n.º 7
0
    public CheckSmilePassword_Result CheckSmilePassword(string fld_channel, string fld_partner_branch_code, string fld_partner_branch_name, string fld_client_number, string fld_smile_password, string fld_card_seq_number)
    {
        CheckSmilePassword_Result obj        = new CheckSmilePassword_Result();
        RefRunningTBBLL           runningobj = new RefRunningTBBLL();

        refnum = runningobj.AddRefRunningTBAndReturn();
        WSLogBLL logobj = new WSLogBLL();

        try
        {
            if (fld_channel == "" || fld_channel.ToUpper() != "TESTEDC" || fld_client_number == "")
            {
                //LogRequest: Insert Log Request
                logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "CheckSmilePassword", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number + "|" + fld_smile_password + "|" + fld_card_seq_number, refnum);

                obj.fld_result = "notpass_กรุณาระบุ Channel หรือ Client Number ให้ถูกต้อง";
                //LogResponse: Insert Log Response
                logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "CheckSmilePassword", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                return(obj);
            }
            else
            {
                switch (fld_channel.ToUpper())
                {
                case "TESTEDC":
                    try
                    {
                        //LogRequest: Insert Log Request
                        logobj.AddWSLog(fld_channel, ipaddress, "Request", "NETWS_ForPartner", "CheckSmilePassword", fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + fld_client_number + "|" + fld_smile_password + "|" + fld_card_seq_number, refnum);

                        // 20111117 เปลี่ยน ApplinX Application Service เพื่อ 24 ชม.
                        //WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService wsobj = new WS_Admin_ForSmartCard.WS_Admin_ForSmartCardService();
                        WS_Admin_SmileService_ForSmartCard.WS_Admin_ForSmartCardService wsobj = new WS_Admin_SmileService_ForSmartCard.WS_Admin_ForSmartCardService();
                        obj.fld_result = wsobj.CheckSmilePassword(admin_username, admin_password, fld_client_number, fld_smile_password, fld_card_seq_number, out obj.fld_sessionID, out obj.fld_last_changed_password_channel, out obj.fld_last_changed_password_date, out obj.fld_last_changed_password_time);

                        //เอาชื่อ-นามสกุลลูกค้าจาก Method GetCustomerDetail มาแสดงด้วย
                        GetCustomerDetail_Result obj2 = getCustomerDetail(fld_client_number);
                        obj.fld_customer_name    = obj2.fld_customer_name;
                        obj.fld_customer_surname = obj2.fld_customer_surname;
                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "CheckSmilePassword", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                        return(obj);
                    }
                    catch (Exception ex)
                    {
                        obj.fld_result = ex.ToString();
                        //LogResponse: Insert Log Response
                        logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "CheckSmilePassword", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                        return(obj);
                    }
                    break;

                default:
                    obj.fld_result = "notpass_ระบบของท่านไม่มีสิทธิ์ตรวจสอบรหัสผ่านของสมาชิกเมืองไทย Smile Club";
                    //LogResponse: Insert Log Response
                    logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "CheckSmilePassword", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

                    return(obj);

                    break;
                }
            }
        }
        catch (Exception ex)
        {
            obj.fld_result = ex.ToString();
            //LogResponse: Insert Log Response
            logobj.AddWSLog(fld_channel, ipaddress, "Response", "NETWS_ForPartner", "CheckSmilePassword", obj.fld_result + "|" + fld_channel + "|" + fld_partner_branch_code + "|" + fld_partner_branch_name + "|" + obj.fld_sessionID, refnum);

            return(obj);
        }
    }