예제 #1
0
    public static void SaveCloudData(string data)
    {
        string      path   = Application.persistentDataPath + "/Xml/Item.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }
        else
        {
            InitSetting();
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot = xmlDoc.DocumentElement;

        elmRoot.RemoveAll();
        var decrpytData = DataSecurityManager.DecryptData(data);

        elmRoot.InnerXml = decrpytData;
        // 암호화/////
        var encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
예제 #2
0
        public bool Insert(UserDTO oUserData)
        {
            string          sProcName;
            DatabaseManager oDB;

            try
            {
                oDB = new DatabaseManager();

                sProcName = "up_Ins_UserMaster";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@UserId", DbType.String, oUserData.UserId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sUserName", DbType.String, DataSecurityManager.Encrypt(oUserData.UserName));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Password", DbType.String, DataSecurityManager.Encrypt(oUserData.Password));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Active", DbType.Boolean, oUserData.Active);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Administrator", DbType.Boolean, oUserData.Administrator);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@UserRoleId", DbType.Int32, oUserData.UserRoleData.UserRoleId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@UserEmailId", DbType.String, DataSecurityManager.Encrypt(oUserData.EmailId));
                oDB.ExecuteNonQuery(oDB.DbCmd);
            }
            catch (Exception exp)
            {
                oDB       = null;
                oUserData = null;
                GF.LogError("clsUserMaster.Insert", exp.Message);
                return(false);
            }
            finally
            {
                oDB       = null;
                oUserData = null;
            }
            return(true);
        }
예제 #3
0
 public DataTable GetBookableRoomDetails(BALAgentRooms obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
         da.SelectCommand.Parameters.Clear();
         da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
         da.SelectCommand.Parameters.AddWithValue("@AgentId", obj._AgentId);
         da.SelectCommand.CommandType = CommandType.StoredProcedure;
         cn.Open();
         da.SelectCommand.ExecuteReader();
         DataTable dtReturnData = new DataTable();
         cn.Close();
         da.Fill(dtReturnData);
         if (dtReturnData != null && dtReturnData.Rows.Count > 0)
         {
             foreach (DataRow row in dtReturnData.Rows)
             {
                 row["AgentName"] = DataSecurityManager.Decrypt(row["AgentName"].ToString());
             }
             return(dtReturnData);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
예제 #4
0
    public static void CreateNode(Map data, XmlDocument xmlDoc, string path)
    {
        // 자식 노드 생성
        XmlNode child = xmlDoc.CreateNode(XmlNodeType.Element, "Map", string.Empty);

        xmlDoc.DocumentElement.FirstChild.AppendChild(child);

        XmlAttribute id = xmlDoc.CreateAttribute("id");

        id.Value = data.id.ToString();
        child.Attributes.Append(id);

        // 자식 노드에 들어갈 속성 생성
        XmlElement clearPoint = xmlDoc.CreateElement("ClearPoint");

        clearPoint.InnerText = data.clearPoint.ToString();
        child.AppendChild(clearPoint);
        XmlElement stageNumber = xmlDoc.CreateElement("StageNumber");

        stageNumber.InnerText = data.stageNumber.ToString();
        child.AppendChild(stageNumber);


        // 암호화/////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
예제 #5
0
    public static ItemDatabase LoadUser()
    {
        string path = Application.persistentDataPath + "/Xml/Item.Xml";

        if (System.IO.File.Exists(path))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
            //복호화////
            XmlElement elmRoot     = xmlDoc.DocumentElement;
            var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);
            elmRoot.InnerXml = decrpytData;
            //////////
            string _xml;
            using (var stringWriter = new StringWriter())
                using (var xmlTextWriter = XmlWriter.Create(stringWriter))
                {
                    xmlDoc.WriteTo(xmlTextWriter);
                    xmlTextWriter.Flush();
                    _xml = stringWriter.GetStringBuilder().ToString();
                }
            if (_xml != null)
            {
                XmlSerializer serializer = new XmlSerializer(typeof(ItemDatabase));
                var           reader     = new StringReader(_xml);
                ItemDatabase  itemDB     = serializer.Deserialize(reader) as ItemDatabase;
                reader.Close();
                Debugging.Log("ItemDatabase 기존 파일 로드");
                return(itemDB);
            }
        }
        Debugging.LogSystemWarning("ItemDatabase wasn't loaded. >> " + path + " is null. >>");
        return(null);
    }
예제 #6
0
    public static void RegenerateWeekMission(List <Mission> weekMissions)
    {
        string      path   = Application.persistentDataPath + "/Xml/Mission.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot = xmlDoc.DocumentElement;

        var decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////

        XmlNodeList nodes = xmlDoc.SelectNodes("MissionCollection/Missions/Mission");

        foreach (XmlNode node in nodes)
        {
            if (node.SelectSingleNode("MissionType").InnerText.Equals("1"))
            {
                node.ParentNode.RemoveChild(node);
            }
        }
        CreateNodes(weekMissions, xmlDoc, path);
        Debugging.Log("주간 미션 초기화 완료");
    }
예제 #7
0
    public static void DeleteEquipItemSave(int id)
    {
        string      path   = Application.persistentDataPath + "/Xml/Item.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////
        ///
        XmlNodeList nodes = xmlDoc.SelectNodes("ItemCollection/Items/Item");

        foreach (XmlNode node in nodes)
        {
            if (node.SelectSingleNode("CustomId").InnerText == id.ToString() || node.SelectSingleNode("CustomId").InnerText.Equals(id.ToString()))
            {
                node.ParentNode.RemoveChild(node);
                break;
            }
        }
        // 암호화/////
        var encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
        Debugging.Log(id + " 의 아이템 데이터 xml 삭제 완료");
    }
예제 #8
0
    public static void ClearMission(Mission mission)
    {
        string      path   = Application.persistentDataPath + "/Xml/Mission.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot = xmlDoc.DocumentElement;

        var decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////

        XmlNodeList nodes = xmlDoc.SelectNodes("MissionCollection/Missions/Mission");

        foreach (XmlNode node in nodes)
        {
            if (node.Attributes.GetNamedItem("id").Value == mission.id.ToString() || node.Attributes.GetNamedItem("id").Value.Equals(mission.id.ToString()))
            {
                node.SelectSingleNode("Clear").InnerText = mission.clear.ToString().ToLower();
                break;
            }
        }
        // 암호화/////
        var encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
예제 #9
0
        public int Insert(AgentDTO oAgentData)
        {
            DatabaseManager oDB;
            int             agentId = -1;

            try
            {
                oDB = new DatabaseManager();
                string sProcName = "up_Ins_AgentMaster";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sAgentCode", DbType.String, oAgentData.AgentCode);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sAgentName", DbType.String, oAgentData.AgentName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@AgentEmailId", DbType.String, DataSecurityManager.Encrypt(oAgentData.EmailId));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Password", DbType.String, DataSecurityManager.Encrypt(oAgentData.Password));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Category", DbType.String, DataSecurityManager.Encrypt(oAgentData.category));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@Country", DbType.String, DataSecurityManager.Encrypt(oAgentData.country));
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@localAgent", DbType.Byte, oAgentData.localagent);
                    << << << < HEAD

                    oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@CssPath", DbType.String, oAgentData.CssPath);

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@RedirectURL", DbType.String, oAgentData.RedirectURL);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@IsPaymentBypass", DbType.Boolean, (oAgentData.IsPaymentBypass));

                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@AgentURL", DbType.String, (oAgentData.AgentURL));
예제 #10
0
        public int ValidateUser(UserDTO oUserData)
        {
            DatabaseManager oDB;
            int             iLoginId = 0;

            oDB = new DatabaseManager();
            try
            {
                string sProcName = "up_ValidateUser";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sUserId", DbType.String, oUserData.UserId);
                //    oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sPwd", DbType.String, oUserData.Password);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@sPwd", DbType.String, DataSecurityManager.Encrypt(oUserData.Password));
                DataSet ds = oDB.ExecuteDataSet(oDB.DbCmd);
                if (ds != null)
                {
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        iLoginId = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
                    }
                }
                if (iLoginId != 0)
                {
                    SaveUserInfoToSession(oUserData.UserId);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            return(iLoginId);
        }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string st = DataSecurityManager.Encrypt("*****@*****.**");

        if (Session["CustomerMailId"] == null || Session["AgentMailId"] == null)
        {
            LinkButton1.Visible = false;
        }
        if (Session["CustName"] != null)
        {
            lblUsername.Text = "Hello " + Session["CustName"].ToString();
            //lnkCustomerRegis.Visible = false;
            navlogin.Visible    = false;
            LinkButton1.Visible = true;
        }

        else if (Session["UserName"] != null)

        {
            lblUsername.Text = "Hello " + Session["UserName"].ToString();
            //lnkCustomerRegis.Visible = false;
            navlogin.Visible    = false;
            LinkButton1.Visible = true;
        }
        else
        {
            //lnkCustomerRegis.Visible = false;
            navlogin.Visible    = true;
            LinkButton1.Visible = false;
        }
    }
    protected void btnCustLogin_Click(object sender, EventArgs e)
    {
        try
        {
            blcus.Email    = txtCustMailId.Text.Trim();
            blcus.Password = txtCustPass.Text.Trim();
            blcus.action   = "LoginCust";

            DataTable dtCustomer = dlcus.checkDuplicateemail(blcus);
            if (dtCustomer != null)
            {
                if (dtCustomer.Rows.Count > 0)
                {
                    Session["CustMailId"] = txtCustMailId.Text.Trim();


                    ViewState["Pass"]      = txtCustPass.Text.Trim();
                    lblBillingAddress.Text = dtCustomer.Rows[0]["BillingAddress"].ToString();


                    lblAgentName.Text     = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + " " + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString());
                    lbPaymentMethod.Text  = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["PaymentMethod"].ToString());
                    hdnfPhoneNumber.Value = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Telephone"].ToString());

                    Session["CustId"]       = dtCustomer.Rows[0]["CustId"].ToString();
                    Session["CustomerCode"] = dtCustomer.Rows[0]["CustId"].ToString();

                    Session.Add("CustomerMailId", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Email"].ToString()));
                    Session.Add("CustPassword", DataSecurityManager.Decrypt(dtCustomer.Rows[0]["Password"].ToString()));
                    DataTable dtrpax = SessionServices.RetrieveSession <DataTable>("Bookingdt");

                    string BookRef = DataSecurityManager.Decrypt(dtCustomer.Rows[0]["FirstName"].ToString()) + DataSecurityManager.Decrypt(dtCustomer.Rows[0]["LastName"].ToString()) + "X" + Convert.ToDouble(dtrpax.Compute("SUM(Pax)", string.Empty)).ToString() + "-" + "Self";
                    ViewState["BookRef"] = BookRef;
                    lbPaymentMethod.Text = "N/A";


                    pnlFullDetails.Visible          = true;
                    panelwithoutCreditAgent.Visible = true;
                    pnlBookButton.Visible           = true;
                    customerLogin.Visible           = false;
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Password or Email Id incorrect')", true);
            }
            //Bookingdt = Session["Bookingdt"] as DataTable;
            //  preparetables(Bookingdt);
        }
        catch
        {
        }
    }
예제 #13
0
 public static void SetCloudDataToUser(CloudDataInfo data)
 {
     if (!string.IsNullOrEmpty(data.UserData))
     {
         Debug.Log("서버 UserData 로컬 저장 중");
         string decryptData = DataSecurityManager.DecryptData(data.UserData);
         SaveCloudPlayer(decryptData);
     }
 }
    public string GetBillingAddress(DataTable dataRow)

    {
        address1   = DataSecurityManager.Decrypt(dataRow.Rows[0]["Address1"].ToString());
        address2   = DataSecurityManager.Decrypt(dataRow.Rows[0]["Address2"].ToString());
        city       = DataSecurityManager.Decrypt(dataRow.Rows[0]["City"].ToString());
        state      = DataSecurityManager.Decrypt(dataRow.Rows[0]["State"].ToString());
        postalCode = DataSecurityManager.Decrypt(dataRow.Rows[0]["PostalCode"].ToString());

        return(string.Format("{0} {1}, {2} {3} {4}", address1, address2, city, state, postalCode));
    }
예제 #15
0
    public static string GetUserDataToCloud()
    {
        PlayerData userData   = new PlayerData();
        string     dataStream = JsonConvert.SerializeObject(userData);

        if (!string.IsNullOrEmpty(dataStream))
        {
            string encrpytData = DataSecurityManager.EncryptData(dataStream);
            return(encrpytData);
        }
        return(null);
    }
예제 #16
0
    public static void CreateNodes(List <Mission> data, XmlDocument xmlDoc, string path)
    {
        for (var i = 0; i < data.Count; i++)
        {
            // 자식 노드 생성
            XmlNode child = xmlDoc.CreateNode(XmlNodeType.Element, "Mission", string.Empty);
            xmlDoc.DocumentElement.FirstChild.AppendChild(child);

            XmlAttribute id = xmlDoc.CreateAttribute("id");
            id.Value = data[i].id.ToString();
            child.Attributes.Append(id);

            // 자식 노드에 들어갈 속성 생성
            XmlElement type = xmlDoc.CreateElement("MissionType");
            type.InnerText = data[i].missionType.ToString();
            child.AppendChild(type);
            XmlElement level = xmlDoc.CreateElement("MissionLevel");
            level.InnerText = data[i].missionLevel.ToString();
            child.AppendChild(level);
            XmlElement point = xmlDoc.CreateElement("Point");
            point.InnerText = data[i].point.ToString();
            child.AppendChild(point);
            XmlElement clearPoint = xmlDoc.CreateElement("ClearPoint");
            clearPoint.InnerText = data[i].clearPoint.ToString();
            child.AppendChild(clearPoint);
            XmlElement clearType = xmlDoc.CreateElement("ClearType");
            clearType.InnerText = data[i].clearType.ToString();
            child.AppendChild(clearType);
            XmlElement clear = xmlDoc.CreateElement("Clear");
            clear.InnerText = data[i].clear.ToString().ToLower();
            child.AppendChild(clear);
            XmlElement enable = xmlDoc.CreateElement("Enable");
            enable.InnerText = data[i].enable.ToString().ToLower();
            child.AppendChild(enable);
            XmlElement rewardType = xmlDoc.CreateElement("RewardType");
            rewardType.InnerText = data[i].rewardType.ToString();
            child.AppendChild(rewardType);
            XmlElement rewardItem = xmlDoc.CreateElement("RewardItemId");
            rewardItem.InnerText = data[i].rewardItemId.ToString();
            child.AppendChild(rewardItem);
            XmlElement rewardItemCount = xmlDoc.CreateElement("RewardItemCount");
            rewardItemCount.InnerText = data[i].rewardItemCount.ToString();
            child.AppendChild(rewardItemCount);
        }
        // 암호화/////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
예제 #17
0
        private void btnEncrypt_Click(object sender, EventArgs e)
        {
            List <UserMaster> userMasterEncryptedList = new List <UserMaster>();

            foreach (DataGridViewRow row in dgDB.Rows)
            {
                UserMaster um = row.DataBoundItem as UserMaster;
                um.UserName = DataSecurityManager.Encrypt(um.UserName);
                um.Password = DataSecurityManager.Encrypt(um.Password);
                userMasterEncryptedList.Add(um);
            }
            dgEncrypted.DataSource = userMasterEncryptedList;
        }
예제 #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string t          = "VDIzaDQ1aXMxMjRJNTRz";
        string PassportNo = DataSecurityManager.Decrypt(t.ToString());

        if (Session["CustName"] != null)
        {
            //lblUsername.Text = "Hello " + Session["CustName"].ToString();
        }
        if (!IsPostBack)
        {
            LoadCountries();
        }
    }
        public BookingDTMail[] GetBookingDetailsmail(int bookingid)
        {
            BookingDTMail[] oBRD = null;
            DatabaseManager oDB  = null;

            try
            {
                oDB = new DatabaseManager();
                string sProcName = "BookingDetailsformail";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@bookingid", DbType.Int32, bookingid);
                DataSet dsBRD = null;
                dsBRD = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB   = null;

                if (dsBRD != null)
                {
                    oBRD = new BookingDTMail[dsBRD.Tables[0].Rows.Count];
                    for (int i = 0; i < oBRD.Length; i++)
                    {
                        oBRD[i]               = new BookingDTMail();
                        oBRD[i].Bookingcode   = dsBRD.Tables[0].Rows[i][0].ToString();
                        oBRD[i].AgentName     = DataSecurityManager.Decrypt(dsBRD.Tables[0].Rows[i][1].ToString());
                        oBRD[i].RefAgentName  = DataSecurityManager.Decrypt(dsBRD.Tables[0].Rows[i][2].ToString());
                        oBRD[i].Accomodation  = Convert.ToString(dsBRD.Tables[0].Rows[i][3].ToString());
                        oBRD[i].checkin       = Convert.ToDateTime(dsBRD.Tables[0].Rows[i][4].ToString());
                        oBRD[i].checkout      = Convert.ToDateTime(dsBRD.Tables[0].Rows[i][5].ToString());
                        oBRD[i].bookingstatus = Convert.ToString(dsBRD.Tables[0].Rows[i][6].ToString());
                        oBRD[i].pax           = Convert.ToInt32(dsBRD.Tables[0].Rows[i][7].ToString());
                        oBRD[i].Nights        = Convert.ToInt32(dsBRD.Tables[0].Rows[i][8].ToString());
                        oBRD[i].Bookingref    = Convert.ToString(dsBRD.Tables[0].Rows[i][9].ToString());
                        oBRD[i].chartered     = Convert.ToBoolean((dsBRD.Tables[0].Rows[i][10] != null && dsBRD.Tables[0].Rows[i][10].ToString() != "")? dsBRD.Tables[0].Rows[i][10] : false);
                        oBRD[i].packagename   = Convert.ToString(dsBRD.Tables[0].Rows[i][11].ToString());
                    }
                    dsBRD = null;
                }
            }
            catch (Exception exp)
            {
                oDB = null;
                //    GF.LogError("clsBookingRoomReportsHandler.GetDetailedBookingDetails", exp.Message);
                return(null);
            }
            finally
            {
                oDB = null;
            }
            return(oBRD);
        }
예제 #20
0
    public static void SaveUser(int id)
    {
        string      path   = Application.persistentDataPath + "/Xml/Heros.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////

        XmlNodeList nodes = xmlDoc.SelectNodes("HeroCollection/Heros/Hero");

        foreach (XmlNode node in nodes)
        {
            if (node.Attributes.GetNamedItem("id").Value == id.ToString() || node.Attributes.GetNamedItem("id").Value.Equals(id.ToString()))
            {
                HeroData hd = HeroSystem.GetUserHero(id);
                if (hd != null)
                {
                    node.SelectSingleNode("Level").InnerText         = hd.level.ToString();
                    node.SelectSingleNode("Exp").InnerText           = hd.exp.ToString();
                    node.SelectSingleNode("Strength").InnerText      = hd.strength.ToString();
                    node.SelectSingleNode("Intelligent").InnerText   = hd.intelligent.ToString();
                    node.SelectSingleNode("Physical").InnerText      = hd.physical.ToString();
                    node.SelectSingleNode("Agility").InnerText       = hd.agility.ToString();
                    node.SelectSingleNode("EquipmentItem").InnerText = hd.equipmentItem.ToString();
                }
                break;
            }
        }
        // 암호화/////
        var encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
        Debugging.Log(id + " 영웅의 단일 xml 저장 완료");
    }
예제 #21
0
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        string       st = DataSecurityManager.Decrypt("VDIzaDQ1aXMxMjRJNTRzNTVNNjVpbDNxNDNGNVRpOXdoMHdnZGZnNDMzQzM0bDQ1U3RINTQ0aVNoNHM5U2YwbZa29muiOnz/yMzpkFm/2rcsgt8rk4zSTV0+MmcmpeZG");
        UserDTO      userDto;
        UserServices userServices;
        int          iLoginId;

        userDto      = new UserDTO();
        userServices = new UserServices();
        try
        {
            if (Login1.UserName.Trim().ToString() == "" || Login1.Password.Trim().ToString() == "")
            {
                e.Authenticated = false;
            }

            userDto.UserId   = Login1.UserName.Trim().ToString();
            userDto.Password = Login1.Password.Trim().ToString();
            iLoginId         = userServices.ValidateUser(userDto);
            if (iLoginId > 0)
            {
                Session["getadmin"]     = Login1.UserName.Trim().ToString();
                Session["iLoginId"]     = iLoginId;
                e.Authenticated         = true;
                SessionServices.LoginId = iLoginId;
            }
            else if (iLoginId <= 0)
            {
                iLoginId = 0;
                //SessionHandler"LoginId"] = 0;
                SessionServices.LoginId = iLoginId;
                e.Authenticated         = false;
            }
        }
        catch (Exception exp)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "errorMsg", "" + exp.Message + "');");
            //Console.Write(exp.Message);
        }
        finally
        {
            userServices = null;
            userDto      = null;
        }
    }
예제 #22
0
        public List <AgentMarket> BindControlsAgentmarket(BALLinks obj)
        {
            List <AgentMarket> agentMarkets = new List <AgentMarket>();

            try
            {
                SqlConnection cn = new SqlConnection(strCon);

                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("[dbo].[sp_Links]", cn);
                da.SelectCommand.Parameters.Clear();
                da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.SelectCommand.Parameters.AddWithValue("@marketid", obj._MarketId);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                da.SelectCommand.ExecuteReader();
                DataTable dtReturnData = new DataTable();
                cn.Close();
                da.Fill(dtReturnData);
                if (dtReturnData != null)
                {
                    List <Action> actions = new List <Action>();
                    foreach (DataRow row in dtReturnData.Rows)
                    {
                        AgentMarket am = new AgentMarket
                        {
                            AgentId = Convert.ToInt32(row[0].ToString()),
                            //AgentName = DataSecurityManager.Decrypt(row[1].ToString()),
                            cnt = Convert.ToBoolean(row[2].ToString())
                        };
                        actions.Add(new Action(() => am.AgentName = DataSecurityManager.Decrypt(Convert.ToString(row[1]))));
                        agentMarkets.Add(am);
                    }
                    ParallelOptions po = new ParallelOptions();
                    po.MaxDegreeOfParallelism = 100;

                    Parallel.Invoke(po, actions.ToArray());
                }
                return(agentMarkets);
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #23
0
    public static void AddAbility(int id)
    {
        string      path   = Application.persistentDataPath + "/Xml/Ability.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////
        CreateNode(AbilitySystem.GetAbility(id), xmlDoc, path);
    }
예제 #24
0
    public static void CreateXml(Map data, string path)
    {
        XmlDocument xmlDoc = new XmlDocument();

        // Xml을 선언한다(xml의 버전과 인코딩 방식을 정해준다.)
        xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "utf-8", "yes"));

        // 루트 노드 생성
        XmlNode root = xmlDoc.CreateNode(XmlNodeType.Element, "MapCollection", string.Empty);

        xmlDoc.AppendChild(root);

        XmlNode root2 = xmlDoc.CreateNode(XmlNodeType.Element, "Maps", string.Empty);

        root.AppendChild(root2);

        // 자식 노드 생성
        XmlNode child = xmlDoc.CreateNode(XmlNodeType.Element, "Map", string.Empty);

        root2.AppendChild(child);

        XmlAttribute id = xmlDoc.CreateAttribute("id");

        id.Value = data.id.ToString();
        child.Attributes.Append(id);

        // 자식 노드에 들어갈 속성 생성
        XmlElement clearPoint = xmlDoc.CreateElement("ClearPoint");

        clearPoint.InnerText = data.clearPoint.ToString();
        child.AppendChild(clearPoint);
        XmlElement stageNumber = xmlDoc.CreateElement("StageNumber");

        stageNumber.InnerText = data.stageNumber.ToString();
        child.AppendChild(stageNumber);

        // 암호화/////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
    private void loaddetails(int bookingid)
    {
        blbooking._iBookingId = Convert.ToInt32(bookingid);
        DataTable dt = dlbooking.paymentreminder(blbooking);

        if (dt != null && dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Name"]      = DataSecurityManager.Decrypt(dt.Rows[i]["Name"].ToString());
                dt.Rows[i]["lastname"]  = DataSecurityManager.Decrypt(dt.Rows[i]["lastname"].ToString());
                dt.Rows[i]["Email"]     = DataSecurityManager.Decrypt(dt.Rows[i]["Email"].ToString());
                dt.Rows[i]["Telephone"] = DataSecurityManager.Decrypt(dt.Rows[i]["Telephone"].ToString());
            }
        }
        else
        {
            // ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Your final payment against this booking has been received. There is no outstanding.')", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Your final payment against this booking has been received. There is no outstanding.');window.location.href = 'searchproperty1.aspx';", true);

            //string jv = "alert('Your final payment against this booking has been received. There is no outstanding.');";
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", jv, true);
            Response.Redirect("searchproperty1.aspx?ID=01");

            // Response.Redirect("searchproperty1.aspx");
        }
        lblAgentName.Text  = dt.Rows[0]["Name"].ToString() + " " + dt.Rows[0]["lastname"].ToString();
        Session["InvName"] = DataSecurityManager.Decrypt(dt.Rows[0]["Name"].ToString()) + " " + DataSecurityManager.Decrypt(dt.Rows[0]["lastname"].ToString());

        try
        {
            {
                lblBillingAddress.Text = dt.Rows[0]["BillingAddress"].ToString();
                Session["Address"]     = dt.Rows[0]["BillingAddress"].ToString();
            }
        }
        catch
        {
            lblBillingAddress.Text = GetBillingAddress(dt);
            Session["Address"]     = GetBillingAddress(dt);
        }
        calculate(dt);
        Session["getdata"] = dt;
    }
예제 #26
0
    public static void AddItemListSave(Item[] items)
    {
        string      path   = Application.persistentDataPath + "/Xml/Item.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////
        CreateNodes(items, xmlDoc, path);
        Debugging.Log(items.Length + " 의 아이템 데이터 xml 추가저장 완료");
    }
예제 #27
0
    public static void CreateNode(Ability data, XmlDocument xmlDoc, string path)
    {
        // 자식 노드 생성
        XmlNode child = xmlDoc.CreateNode(XmlNodeType.Element, "Ability", string.Empty);

        xmlDoc.DocumentElement.FirstChild.AppendChild(child);

        XmlAttribute id = xmlDoc.CreateAttribute("id");

        id.Value = data.id.ToString();
        child.Attributes.Append(id);

        // 자식 노드에 들어갈 속성 생성
        XmlElement level = xmlDoc.CreateElement("Level");

        level.InnerText = "1";
        child.AppendChild(level);
        XmlElement type = xmlDoc.CreateElement("AbilityType");

        type.InnerText = data.abilityType.ToString();
        child.AppendChild(type);
        XmlElement powerType = xmlDoc.CreateElement("PowerType");

        powerType.InnerText = data.powerType.ToString();
        child.AppendChild(powerType);
        XmlElement power = xmlDoc.CreateElement("Power");

        power.InnerText = data.power.ToString();
        child.AppendChild(power);
        XmlElement image = xmlDoc.CreateElement("Image");

        image.InnerText = data.image;
        child.AppendChild(image);

        // 암호화/////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }
예제 #28
0
        private BookingTouristDTO[] FillTouristDetails(DataSet ds)
        {
            DataRow dr;

            BookingTouristDTO[] oBookingTouristDTO = null;
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    oBookingTouristDTO = new BookingTouristDTO[ds.Tables[0].Rows.Count];
                    #region AssigningValues
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        dr = ds.Tables[0].Rows[i];
                        oBookingTouristDTO[i] = new BookingTouristDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].TouristNo = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].FirstName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(1)));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].LastName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(2)));
                        }
                        if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].PassportNo = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(3)));
                        }
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            oBookingTouristDTO[i].Nationality = Convert.ToString(dr.ItemArray.GetValue(4));
                        }
                    }
                    #endregion AssigningValues
                }
            }

            return(oBookingTouristDTO);
        }
예제 #29
0
    public static void EquipItemSave(int dismountId, int equipId, int targetCharacterId)
    {
        string      path   = Application.persistentDataPath + "/Xml/Item.Xml";
        XmlDocument xmlDoc = new XmlDocument();

        if (System.IO.File.Exists(path))
        {
            xmlDoc.LoadXml(System.IO.File.ReadAllText(path));
        }

        //복호화////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        decrpytData = DataSecurityManager.DecryptData(elmRoot.InnerText);

        elmRoot.InnerXml = decrpytData;
        //////////
        ///
        XmlNodeList nodes = xmlDoc.SelectNodes("ItemCollection/Items/Item");

        Debugging.Log(equipId + "아이템 장착 데이터 xml 저장중..");
        foreach (XmlNode node in nodes)
        {
            if (dismountId != 0)
            {
                if (node.SelectSingleNode("CustomId").InnerText == dismountId.ToString() || node.SelectSingleNode("CustomId").InnerText.Equals(dismountId.ToString()))
                {
                    node.SelectSingleNode("EquipCharacterId").InnerText = "0";
                }
            }
            if (node.SelectSingleNode("CustomId").InnerText == equipId.ToString() || node.SelectSingleNode("CustomId").InnerText.Equals(equipId.ToString()))
            {
                node.SelectSingleNode("EquipCharacterId").InnerText = targetCharacterId.ToString();
            }
        }
        // 암호화/////
        var encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
        Debugging.Log(equipId + " 의 아이템 장착 데이터 xml 저장 완료");
    }
예제 #30
0
    public static void CreateNode(Item data, XmlDocument xmlDoc, string path)
    {
        // 자식 노드 생성
        XmlNode child = xmlDoc.CreateNode(XmlNodeType.Element, "Item", string.Empty);

        xmlDoc.DocumentElement.FirstChild.AppendChild(child);

        XmlAttribute id = xmlDoc.CreateAttribute("id");

        id.Value = data.id.ToString();
        child.Attributes.Append(id);

        // 자식 노드에 들어갈 속성 생성
        XmlElement customId = xmlDoc.CreateElement("CustomId");

        customId.InnerText = data.customId.ToString();
        child.AppendChild(customId);
        XmlElement equipCharacterId = xmlDoc.CreateElement("EquipCharacterId");

        equipCharacterId.InnerText = data.equipCharacterId.ToString();
        child.AppendChild(equipCharacterId);
        XmlElement count = xmlDoc.CreateElement("Count");

        count.InnerText = data.count.ToString();
        child.AppendChild(count);
        XmlElement enable = xmlDoc.CreateElement("Enable");

        enable.InnerText = data.enable.ToString().ToLower();
        child.AppendChild(enable);
        XmlElement itemClass = xmlDoc.CreateElement("Class");

        itemClass.InnerText = data.itemClass.ToString();
        child.AppendChild(itemClass);

        // 암호화/////
        XmlElement elmRoot     = xmlDoc.DocumentElement;
        var        encrpytData = DataSecurityManager.EncryptData(elmRoot.InnerXml);

        elmRoot.InnerText = encrpytData;
        ////////////
        xmlDoc.Save(path);
    }