public static string IssueSMSBlockRequest(ESNInfo info) { try { wsmsService.wsMessageHeader = getHeader(); SecurityHelper.prepareSoapContext(wsmsService.RequestSoapContext); WSM.ChangeServicePlansRequest cspRequest = new WSM.ChangeServicePlansRequest(); cspRequest.mdn = info.MDN; WSM.ProductDeployment deployment = new WSM.ProductDeployment(); deployment.serviceCode = "321PLAN2"; deployment.serviceEffectiveDateSpecified = true; deployment.serviceEffectiveDate = DateTime.Now; deployment.serviceExpirationDateSpecified = false; // cspRequest.pricePlan = deployment; List <WSM.ProductDeployment> list = new List <WSM.ProductDeployment>(); List <WSM.ProductDeployment> Oldlist = new List <WSM.ProductDeployment>(); var dt = DataLayer_WholesaleSubscriptionDetailService.GetPpSocList(info.CSA); var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "MO/MT SMS BLOCKING" select r.Field <string>("soc"); WSM.ProductDeployment deployment3 = new WSM.ProductDeployment(); deployment3.serviceCode = soc.FirstOrDefault().ToString(); deployment3.serviceEffectiveDate = DateTime.Now; deployment3.serviceEffectiveDateSpecified = true; deployment3.serviceExpirationDateSpecified = false; list.Add(deployment3); if (list.Count > 0 || Oldlist.Count > 0) { cspRequest.serviceList = list.ToArray(); WSM.ConfirmMsg cnfMsg = wsmsService.ChangeServicePlans(cspRequest); return(cnfMsg.confirmMsg); } } catch { throw; } return(string.Empty); }
public static ESNStatusDoc[] ActivateSubscription(List <ESNInfo> lstESNInfo) { List <ESNStatusDoc> lstESNDoc = new List <ESNStatusDoc>(); try { // wssService.activa wssService.wsMessageHeader = getHeader(); SecurityHelper.prepareSoapContext(wssService.RequestSoapContext); ESNStatusDoc doc = null; foreach (ESNInfo info in lstESNInfo) { try { ActivateSubscriptionRequest request = new ActivateSubscriptionRequest(); request.csa = info.CSA; request.effectiveDate = DateTime.Now; request.effectiveDateSpecified = true; ProductDeployment deployment = new ProductDeployment(); deployment.serviceCode = "321PLAN2"; deployment.serviceEffectiveDateSpecified = false; deployment.serviceExpirationDateSpecified = false; request.pricePlan = deployment; ElectronicSerialNumber number = new ElectronicSerialNumber(); number.Item = info.ESN; number.ItemElementName = ItemChoiceType.electronicSerialNumberDec; SerialNumber number2 = new SerialNumber(); number2.Item = number; request.esn = number2; List <ProductDeployment> list = new List <ProductDeployment>(); var dt = DataLayer_WholesaleSubscriptionDetailService.GetPpSocList(info.CSA); if (info.LocalCallOnly) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "LOCAL CALLING ONLY" select r.Field <string>("soc"); ProductDeployment item = new ProductDeployment(); item.serviceCode = soc.FirstOrDefault().ToString(); item.serviceEffectiveDate = DateTime.Now; item.serviceEffectiveDateSpecified = true; item.serviceExpirationDateSpecified = false; list.Add(item); } if (info.SMSBlock) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "MO/MT SMS BLOCKING" select r.Field <string>("soc"); ProductDeployment deployment3 = new ProductDeployment(); deployment3.serviceCode = soc.FirstOrDefault().ToString(); deployment3.serviceEffectiveDate = DateTime.Now; deployment3.serviceEffectiveDateSpecified = true; deployment3.serviceExpirationDateSpecified = false; list.Add(deployment3); } if (info.VoiceMail) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "VOICEMAIL" select r.Field <string>("soc"); ProductDeployment deployment4 = new ProductDeployment(); deployment4.serviceCode = soc.FirstOrDefault().ToString(); deployment4.serviceEffectiveDate = DateTime.Now; deployment4.serviceEffectiveDateSpecified = true; deployment4.serviceExpirationDateSpecified = false; list.Add(deployment4); } if (list.Count > 0) { request.serviceList = list.ToArray(); } ActivateSubscriptionReply reply = wssService.ActivateSubscription(request); info.MDN = reply.mdn; info.MSID = reply.msid; doc = new ESNStatusDoc(); doc.ESN = info.ESN; doc.MDN = info.MDN; doc.MSID = info.MSID; doc.ESNStatus = ESNSTATUSENUM.SUCCEEDED; doc.Message = "Activated"; lstESNDoc.Add(doc); } catch (System.Web.Services.Protocols.SoapException soapEx) { doc = new ESNStatusDoc(); doc.ESN = info.ESN; doc.ESNStatus = ESNSTATUSENUM.FAILED; doc.Message = soapEx.Detail.InnerText; lstESNDoc.Add(doc); } } return(lstESNDoc.ToArray()); } catch (Exception ex) { throw ex; } }
public static ESNStatusDoc[] ActivateSubscriptionV2(List <ESNInfo> lstESNInfo) { List <ESNStatusDoc> lstESNDoc = new List <ESNStatusDoc>(); try { // wssService.activa wssService.wsMessageHeader = getHeader(); SecurityHelper.prepareSoapContext(wssService.RequestSoapContext); ESNStatusDoc doc = null; foreach (ESNInfo info in lstESNInfo) { try { WholesaleActivateSubscriptionV2Type request = new WholesaleActivateSubscriptionV2Type(); request.csa = info.CSA; request.effectiveDate = DateTime.Now; request.effectiveDateSpecified = true; ProductDeploymentType2 deployment = new ProductDeploymentType2(); deployment.serviceCode = "321PLAN4"; request.pricePlan = deployment; request.deviceInfo = new DeviceInfoType3() { serialNumber = info.ESN, serialType = DeviceSerialNumberTypeCodeType3.E, serialTypeSpecified = true }; List <ProductDeploymentType2> serviceLIst = new List <ProductDeploymentType2>(); var dt = DataLayer_WholesaleSubscriptionDetailService.GetPpSocList(info.CSA); if (info.SMSBlock == true) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "MO/MT SMS BLOCKING" select r.Field <string>("soc"); ProductDeploymentType2 service = new ProductDeploymentType2 { serviceCode = soc.FirstOrDefault().ToString() }; serviceLIst.Add(service); } if (info.VoiceMail == true) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "VOICEMAIL" select r.Field <string>("soc"); ProductDeploymentType2 service = new ProductDeploymentType2 { serviceCode = soc.FirstOrDefault().ToString() }; serviceLIst.Add(service); } if (info.LocalCallOnly == true) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "LOCAL CALLING ONLY" select r.Field <string>("soc"); ProductDeploymentType2 service = new ProductDeploymentType2 { serviceCode = soc.FirstOrDefault().ToString() }; serviceLIst.Add(service); } //data blocking by default ProductDeploymentType2 svc = new ProductDeploymentType2 { serviceCode = "321DISNAI" }; serviceLIst.Add(svc); if (serviceLIst.Count > 0) { request.serviceList = serviceLIst.ToArray(); } wholesaleActivateSubscriptionV2ResponseType reply = wssService.WholesaleActivateSubscriptionV2(request); info.MDN = reply.mdn; info.MSID = reply.msid; doc = new ESNStatusDoc(); doc.ESN = info.ESN; doc.MDN = info.MDN; doc.MSID = info.MSID; doc.ESNStatus = ESNSTATUSENUM.SUCCEEDED; doc.Message = "Activated"; lstESNDoc.Add(doc); } catch (System.Web.Services.Protocols.SoapException soapEx) { doc = new ESNStatusDoc(); doc.ESN = info.ESN; doc.ESNStatus = ESNSTATUSENUM.FAILED; doc.Message = soapEx.Detail.InnerText; lstESNDoc.Add(doc); } } return(lstESNDoc.ToArray()); } catch (Exception ex) { throw ex; } }
public static DataTable GetPricePlans(String CSA) { return(DataLayer_WholesaleSubscriptionDetailService.GetPpSocList(CSA)); }
public static string ChangeServicePlans(ESNInfo info, bool OldLocalCallOnly, bool OldVoiceMail, bool OldSMSBlock) { try { wsmsService.wsMessageHeader = getHeader(); SecurityHelper.prepareSoapContext(wsmsService.RequestSoapContext); WSM.ChangeServicePlansRequest cspRequest = new WSM.ChangeServicePlansRequest(); cspRequest.mdn = info.MDN; WSM.ProductDeployment deployment = new WSM.ProductDeployment(); deployment.serviceCode = "321PLAN2"; deployment.serviceEffectiveDateSpecified = true; deployment.serviceEffectiveDate = DateTime.Now; deployment.serviceExpirationDateSpecified = false; List <WSM.ProductDeployment> list = new List <WSM.ProductDeployment>(); List <WSM.ProductDeployment> Oldlist = new List <WSM.ProductDeployment>(); var dt = DataLayer_WholesaleSubscriptionDetailService.GetPpSocList(info.CSA); //Set the old services if (OldLocalCallOnly == true && info.LocalCallOnly == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "LOCAL CALLING ONLY" select r.Field <string>("soc"); WSM.ProductDeployment item = new WSM.ProductDeployment(); item.serviceCode = soc.FirstOrDefault().ToString(); item.serviceExpirationDate = DateTime.Now; item.serviceEffectiveDateSpecified = false; item.serviceExpirationDateSpecified = true; Oldlist.Add(item); } if (OldVoiceMail == true && info.VoiceMail == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "VOICEMAIL" select r.Field <string>("soc"); WSM.ProductDeployment deployment4 = new WSM.ProductDeployment(); deployment4.serviceCode = soc.FirstOrDefault().ToString(); deployment4.serviceExpirationDate = DateTime.Now; deployment4.serviceEffectiveDateSpecified = false; deployment4.serviceExpirationDateSpecified = true; Oldlist.Add(deployment4); } if (OldSMSBlock == true && info.SMSBlock == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "MO/MT SMS BLOCKING" select r.Field <string>("soc"); WSM.ProductDeployment deployment3 = new WSM.ProductDeployment(); deployment3.serviceCode = soc.FirstOrDefault().ToString(); deployment3.serviceExpirationDate = DateTime.Now; deployment3.serviceEffectiveDateSpecified = false; deployment3.serviceExpirationDateSpecified = true; Oldlist.Add(deployment3); } if (Oldlist.Count > 0) { cspRequest.oldServiceList = Oldlist.ToArray(); } // New services if (info.LocalCallOnly && OldLocalCallOnly == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "LOCAL CALLING ONLY" select r.Field <string>("soc"); WSM.ProductDeployment item = new WSM.ProductDeployment(); item.serviceCode = soc.FirstOrDefault().ToString(); item.serviceEffectiveDate = DateTime.Now; item.serviceEffectiveDateSpecified = true; item.serviceExpirationDateSpecified = false; list.Add(item); } if (info.SMSBlock && OldSMSBlock == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "MO/MT SMS BLOCKING" select r.Field <string>("soc"); WSM.ProductDeployment deployment3 = new WSM.ProductDeployment(); deployment3.serviceCode = soc.FirstOrDefault().ToString(); deployment3.serviceEffectiveDate = DateTime.Now; deployment3.serviceEffectiveDateSpecified = true; deployment3.serviceExpirationDateSpecified = false; list.Add(deployment3); } if (info.VoiceMail && OldVoiceMail == false) { var soc = from r in dt.AsEnumerable() where r.Field <string>("socDescription") == "VOICEMAIL" select r.Field <string>("soc"); WSM.ProductDeployment deployment4 = new WSM.ProductDeployment(); deployment4.serviceCode = soc.FirstOrDefault().ToString(); deployment4.serviceEffectiveDate = DateTime.Now; deployment4.serviceEffectiveDateSpecified = true; deployment4.serviceExpirationDateSpecified = false; list.Add(deployment4); } if (list.Count > 0 || Oldlist.Count > 0) { cspRequest.serviceList = list.ToArray(); WSM.ConfirmMsg cnfMsg = wsmsService.ChangeServicePlans(cspRequest); return(cnfMsg.confirmMsg); } } catch { throw; } return(string.Empty); }