Ejemplo n.º 1
0
        public dynamic MeesevaEncryptData(MeesevaModel obj2)
        {
            try
            {
                var data = _objmweb.VSWS_GETTOKEN("VSWS-APTS", "P$W$@13112019"); //[{"Status":"100","token":"asd$#@4568"}]


                var data2 = JsonConvert.DeserializeObject <dynamic>(data);
                //_objmweb.VSWS_GETAPPDETAILS("VSWS-APTS", "P$W$@13112019", data2[0].token,obj2.PARAM1);
                MeesevaModel _OBJMES = new MeesevaModel();
                if (data2[0].Status == "100")
                {
                    _OBJMES.STATUS            = "100";
                    _OBJMES.TOKEN             = data2[0].token;
                    _OBJMES.CHANNELID         = "CODETREE";
                    _OBJMES.LANDINGID         = DateTime.Now.ToString("yyyyMMddHHmmssfff") + new Random().Next(1000, 9999).ToString();
                    _OBJMES.SCAID             = "35";
                    _OBJMES.OPERATORID        = "CODETREE-1";
                    _OBJMES.OPERATOR_UNIQUENO = "CCSP35CODETREE1";
                    _OBJMES.SERVICEID         = obj2.SERVICEID;            //"818";
                    _OBJMES.SECRETARIATCODE   = obj2.SECRETARIATCODE;
                    string strjson = _OBJMES.TOKEN + "|" + _OBJMES.LANDINGID + "|" + _OBJMES.SCAID + "|" + _OBJMES.CHANNELID + "|" + _OBJMES.OPERATORID + "|" + _OBJMES.OPERATOR_UNIQUENO + "|" + _OBJMES.SERVICEID;

                    //TripleDESCryptoServiceProvider _objtds = new TripleDESCryptoServiceProvider();
                    byte[] key             = { 0xA2, 0x15, 0x37, 0x07, 0xCB, 0x62, 0xC1, 0xD3, 0xF8, 0xF1, 0x97, 0xDF, 0xD0, 0x13, 0x4F, 0x79, 0x01, 0x67, 0x7A, 0x85, 0x94, 0x16, 0x31, 0x92 };
                    byte[] iv              = { 50, 51, 52, 53, 54, 55, 56, 57 };
                    string encdata         = new cTripleDES(key, iv).Encrypt(strjson);
                    string serialized_data = JsonConvert.SerializeObject(_OBJMES);
                    string mappath         = HttpContext.Current.Server.MapPath("MeesevaInitiateLogs");
                    Task   WriteTask       = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, serialized_data));
                    GetMeesevaInitiate(_OBJMES);

                    _OBJMES.ENCDATA = encdata;
                    return(_OBJMES);
                }
                else
                {
                    _OBJMES.STATUS = "102";
                    _OBJMES.REASON = "Invalid Request";
                    return(_OBJMES);
                }
            }
            catch (Exception ex)
            {
                string mappath   = HttpContext.Current.Server.MapPath("MeesevaInitiateExceptionLogs");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, ex.Message.ToString()));
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public dynamic MeesevaHousesiteVROEncryptData(MeesevaModel obj2)
        {
            try
            {
                HousesiteWebservice.API _obj = new HousesiteWebservice.API();
                var data = _obj.GetTokenSSO("VSWS-HOUSING", "#@pts@04062020");                //VSWS_GETTOKEN("VSWS-APTS", "P$W$@13112019"); //[{"Status":"100","token":"asd$#@4568"}]


                var data2 = JsonConvert.DeserializeObject <dynamic>(data);

                //_objmweb.VSWS_GETAPPDETAILS("VSWS-APTS", "P$W$@13112019", data2[0].token,obj2.PARAM1);
                MeesevaHOuseSitesModel _OBJMES = new MeesevaHOuseSitesModel();
                if (data2[0].status == "100")
                {
                    _OBJMES.STATUS    = "100";
                    _OBJMES.TOKEN     = data2[0].token;
                    _OBJMES.LANDINGID = DateTime.Now.ToString("yyyyMMddHHmmssfff") + new Random().Next(1000, 9999).ToString();
                    _OBJMES.USERID    = obj2.OPERATORID;
                    //_OBJMES.SECRETARIATCODE = obj2.SECRETARIATCODE;


                    string strjson = _OBJMES.TOKEN + "|" + _OBJMES.LANDINGID + "|" + _OBJMES.USERID;

                    //TripleDESCryptoServiceProvider _objtds = new TripleDESCryptoServiceProvider();
                    byte[] key             = { 0xA2, 0x15, 0x37, 0x07, 0xCB, 0x62, 0xC1, 0xD3, 0xF8, 0xF1, 0x97, 0xDF, 0xD0, 0x13, 0x4F, 0x79, 0x01, 0x67, 0x7A, 0x85, 0x94, 0x16, 0x31, 0x92 };
                    byte[] iv              = { 50, 51, 52, 53, 54, 55, 56, 57 };
                    string encdata         = new cTripleDES(key, iv).Encrypt(strjson);
                    string serialized_data = JsonConvert.SerializeObject(_OBJMES);
                    string mappath1        = HttpContext.Current.Server.MapPath("MeesevaInitiateLogs");
                    Task   WriteTask1      = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath1, serialized_data));
                    //GetMeesevaInitiate(_OBJMES);
                    _OBJMES.RedirectUrl = "http://navaratnalu-housesites1.ap.gov.in/GVSPortal/UserInterface/VSWSRedirection.aspx";
                    _OBJMES.ENCDATA     = encdata;
                    return(_OBJMES);
                }
                else
                {
                    _OBJMES.STATUS = "102";
                    _OBJMES.REASON = "Invalid Request";
                    return(_OBJMES);
                }
            }
            catch (Exception ex)
            {
                string mappath   = HttpContext.Current.Server.MapPath("MeesevaInitiateExceptionLogs");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log(mappath, ex.Message.ToString()));
                throw ex;
            }
        }