protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ddlService.Items.Insert(0, "All"); string seccode = Page.Request.Form["Seccode"]; string userid = Page.Request.Form["userid"]; string distcode = Page.Request.Form["DistCode"]; if (string.IsNullOrEmpty(seccode) || string.IsNullOrEmpty(userid) || string.IsNullOrEmpty(distcode)) { Response.Redirect("https://gramawardsachivalayam.ap.gov.in/GSWS/#!/Login"); return; } //distcode = "502"; string requestId = string.Empty; System.Guid guid = System.Guid.NewGuid(); string strguid = guid.ToString(); requestId = strguid.Substring(strguid.LastIndexOf("-") + 1); requestId = requestId.ToUpper().Replace('O', 'W').Replace('0', '4'); requestId = requestId.Substring(0, 11); //LandingDetails LD = new LandingDetails(); MeesevaModel LD = new MeesevaModel(); MeesevaProductionService.MeeSevaWebService objPromeeseva = new MeesevaProductionService.MeeSevaWebService(); try { var data = objPromeeseva.VSWS_GETTOKEN("VSWS-APTS", "P$W$@13112019"); //[{"Status":"100","token":"asd$#@4568"}] //var data = objPromeeseva.get("VSWS-APTS", "P$W$@13112019"); //[{"Status":"100","token":"asd$#@4568"}] //string mappath = HttpContext.Current.Server.MapPath("MeesevaExceptionLogs"); //Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, data)); //var data2 = JsonConvert.DeserializeObject<dynamic>(data); //_objmweb.VSWS_GETAPPDETAILS("VSWS-APTS", "P$W$@13112019", data2[0].token,obj2.PARAM1); string status = "100"; MeesevaModel _OBJMES = new MeesevaModel(); if (status == "100") { string channelid = string.Empty; string uniqueid = string.Empty; string operatorid = string.Empty; channelid = userid.Split('-')[0].ToString();; operatorid = userid.ToString(); uniqueid = userid.Split('-')[0].ToString(); lblerror.Text = ""; LD.TOKEN = "asd$#@4568"; LD.LANDINGID = DateTime.Now.ToString("yyyyMMddHHmmssfff") + new Random().Next(1000, 9999).ToString(); LD.SCAID = "35"; LD.CHANNELID = channelid; //"CODETREE"; LD.OPERATORID = operatorid; // Request.QueryString["userid"] ?? ""; //"CODETREE-1"; LD.OPERATOR_UNIQUENO = "CCSP35" + uniqueid + 1; //"CCSP35CODETREE1"; LD.SECRETARIATCODE = seccode ?? ""; //LD.SERVICEID = Request.QueryString["Serviceid"] ?? ""; cTripleDES des = new cTripleDES(key, iv); LD.ENCDATA = des.Encrypt(Create_ENCDATA(LD.TOKEN, LD.LANDINGID, LD.SCAID, LD.CHANNELID, LD.OPERATORID, LD.OPERATOR_UNIQUENO)); NameValueCollection DATA = new NameValueCollection(); DATA.Add("TOKEN", LD.TOKEN); DATA.Add("LANDINGID", LD.LANDINGID); DATA.Add("SCAID", LD.SCAID); DATA.Add("CHANNELID", LD.CHANNELID); DATA.Add("OPERATORID", LD.OPERATORID); DATA.Add("OPERATOR_UNIQUENO", LD.OPERATOR_UNIQUENO); DATA.Add("ENCDATA", LD.ENCDATA); new EncryptMeeseva().GetMeesevaInitiate(LD); string msdistkey = ConfigurationManager.AppSettings["MSdistkey"].ToString(); string msuserkey = ConfigurationManager.AppSettings["MSUserkey"].ToString(); string[] strdistarr = msdistkey.Split(','); string[] strusertarr = msuserkey.Split(','); bool distflag = Array.Exists(strdistarr, element => element.Equals(distcode)); bool userflag = Array.Exists(strusertarr, element => element.Equals(userid)); //23456789-WEDS //HtmlHelper.RedirectAndPOST(this.Page, "http://meeseva.gov.in/GSVWIMeeseva/UserInterface/DC/VSWSRedirection.aspx", DATA); if (distflag || userflag) { HtmlHelper.RedirectAndPOST(this.Page, "https://onlineap.meeseva.gov.in/GSVWIMeeseva/UserInterface/DC/VSWSRedirection.aspx ", DATA); } else { HtmlHelper.RedirectAndPOST(this.Page, "http://reports.meeseva.gov.in/GSVWIMeeseva/UserInterface/DC/VSWSRedirection.aspx ", DATA); } } else { lblerror.Text = "Invalid Request"; } } catch (Exception ex) { string mappath = HttpContext.Current.Server.MapPath("MeesevaExceptionLogs"); Task WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, ex.Message.ToString())); lblerror.Text = ex.Message.ToString(); } } }