private static string CreateSMSMessage_phi(string brand, string pan, string date, string time, string vip_card, string vip_cif, string mobile, string loc_pan) { try { classChange_PIN Change_pin = new classChange_PIN();//1111 Random RndNum = new Random(); string pin = RndNum.Next(100000, 999999).ToString(); int flag1 = Change_pin.Change_PIN(mobile, pin, zpk_uat, loc_pan); pan = pan.Substring(12, 4); if (vip_card == "Y" || vip_cif == "Y") { SCBPhone = "1800545438"; } else { SCBPhone = "19006538"; } string create_date = date.Substring(6, 2) + "/" + date.Substring(4, 2);; string tmp_smsMessage = ""; int flag2 = -1; if (flag1 == 0)//fail { classKichHoatTheLogWriter.WriteLog("Error WS 1 gen PIN fo LOC :" + loc_pan.Substring(1, 16)); flag2 = Change_pin.Change_PIN(mobile, pin, zpk_uat, loc_pan);//call ws lan 2 if (flag2 == 0) { classKichHoatTheLogWriter.WriteLog("Error WS 2 gen PIN fo LOC :" + loc_pan.Substring(1, 16)); } } if (flag1 == 1 || flag2 == 1) { tmp_smsMessage = "The SCB " + brand + " x" + pan + " vua kich hoat thanh cong.QK duoc tang PTN khi chi tieu du dieu kien trong 30ngay ke tu .PIN " + pin + create_date + ".LH " + SCBPhone; } else { tmp_smsMessage = "The SCB " + brand + " x" + pan + " vua kich hoat thanh cong.Quy Khach duoc tang phi thuong nien/qua tang hap dan khi chi tieu du dieu kien trong 30ngay ke tu " + create_date + ".LH " + SCBPhone; } return(tmp_smsMessage); } catch (Exception ex) { classKichHoatTheLogWriter.WriteLog("Error CreateSMSMessage(), " + ex.Message); return(""); } }
private static string Gen_PIN(string mobile, string loc_pan) { try { classChange_PIN Change_pin = new classChange_PIN();//1111 Random RndNum = new Random(); string pin = ""; string mobile_tmp = ""; pin = RndNum.Next(100000, 999999).ToString(); if (mobile == "0" || mobile == "" || mobile.Length < 10) { mobile_tmp = "0123456789"; } else { mobile_tmp = mobile; } int flag1 = Change_pin.Change_PIN(mobile_tmp, pin, zpk_live, loc_pan); //int flag1 = Change_pin.Change_PIN(mobile, pin, zpk_uat, loc_pan); int flag2 = -1; if (flag1 == 0)//fail { classKichHoatTheLogWriter.WriteLog("Error WS 1 gen PIN fo LOC :" + loc_pan.Substring(1, 16)); //flag2 = Change_pin.Change_PIN(mobile, pin, zpk_uat, loc_pan);//call ws lan 2 flag2 = Change_pin.Change_PIN(mobile_tmp, pin, zpk_live, loc_pan);//call ws lan 2 if (flag2 == 0) { classKichHoatTheLogWriter.WriteLog("Error WS 2 gen PIN fo LOC :" + loc_pan.Substring(1, 16)); } } return(pin); } catch (Exception ex) { classKichHoatTheLogWriter.WriteLog("Error Gen_PIN(), " + ex.Message + ",mobile:" + mobile + ",loc:" + loc_pan); return(""); } }