Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SetRegulerExpression();
            if (Request.Cookies.Get("FabyMartUsername") != null)
            {
                clsEncryption objEncrypt = new clsEncryption();
                if (Request.Cookies.Get("FabyMartUsername").Value != "")
                {
                    txtEmail.Text = objEncrypt.Decrypt(Request.Cookies.Get("FabyMartUsername").Value, appFunctions.strKey);
                    if (Request.Cookies.Get("FabyMartPassword").Value != "")
                    {
                        txtpassword.Attributes.Add("value", objEncrypt.Decrypt(Request.Cookies.Get("FabyMartPassword").Value, appFunctions.strKey));
                        chkRemeber.Checked = true;
                    }
                }

                objEncrypt = null;
            }
            else
            {
                chkRemeber.Checked = false;
            }
        }
    }
Esempio n. 2
0
    //Dim strHostName As String = System.Net.Dns.GetHostName()

    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            dynamic objEncrypt = new clsEncryption();



            if ((Request.Cookies.Get("JetAPIAdminUsername") != null))
            {
                if (!string.IsNullOrEmpty(Request.Cookies.Get("JetAPIAdminUsername").Value))
                {
                    txtUserName.Text = objEncrypt.Decrypt(Request.Cookies.Get("JetAPIAdminUsername").Value, appFunctions.strKey);

                    if ((Request.Cookies.Get("JetAPIAdminPassword") != null))
                    {
                        if (!string.IsNullOrEmpty(Request.Cookies.Get("JetAPIAdminPassword").Value))
                        {
                            txtPassword.Attributes.Add("value", objEncrypt.Decrypt(Request.Cookies.Get("JetAPIAdminPassword").Value, appFunctions.strKey));
                        }
                    }

                    chkRemeber.Checked = true;
                }
            }
        }
    }
Esempio n. 3
0
 private void frmLogin_Load(object sender, EventArgs e)
 {
     this.MaximizeBox = false;
     try
     {
         clsRegKey     oReg        = new clsRegKey();
         clsEncryption oEncryption = new clsEncryption();
         oReg.RegistryPathCurrentUser = clsGlobal.s_FullRegKey;
         clsGlobal.str_Server         = oReg.getSetting("Server");
         clsGlobal.str_User           = oEncryption.Decrypt(oReg.getSetting("User"));
         clsGlobal.str_Password       = oEncryption.Decrypt(oReg.getSetting("Password"));
         clsGlobal.str_Database       = oReg.getSetting("Database");
         clsGlobal.str_Port           = oReg.getSetting("Port");
         oReg        = null;
         oEncryption = null;
     }
     catch (NpgsqlException ex)
     {
         XtraMessageBox.Show("Unable connect to database server, please configure the database connection first", clsGlobal.str_ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         frmServerInitialize frm = new frmServerInitialize();
         frm.ShowDialog(this);
         frm = null;
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show("Could not write/read Registry System.!\nCall Your System Administrator\n", clsGlobal.str_ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Esempio n. 4
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            btnSaveAndAddnew.Visible = HasAdd;
            btnClear.Visible         = HasAdd;

            SetUpDrowDown();
            objEncrypt = new clsEncryption();


            if ((Request.QueryString.Get("ID") != null))
            {
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    noIdFoundRedirect("Tab.aspx");
                }

                objEncrypt = null;
                SetValuesToControls();
            }


            if ((Request.QueryString.Get("PID") != null))
            {
                try
                {
                    intParentId = Convert.ToInt32(objEncrypt.Decrypt(Request.QueryString.Get("PID"), appFunctions.strKey));
                }
                catch (Exception ex)
                {
                    noIdFoundRedirect("Tab.aspx");
                }

                ddlParent.SelectedValue = intParentId.ToString();

                objTab = new tblTab();
                objTab.LoadByPrimaryKey(intParentId);
                objTab.Query.AddResultColumn(tblTab.ColumnNames.AppAddPage);
                objTab.Query.Load();

                ////Set Value To Controls
                //txtAddPage.Text = objTab.AppAddPage;

                objTab.Where.WhereClauseReset();
                objTab = null;
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ViewState["SortOrder"]         = appFunctions.Enum_SortOrderBy.Asc;
         ViewState["SortColumn"]        = "";
         dgvGridView.Columns[0].Visible = HasDelete;
         if (Session[appFunctions.Session.ShowMessage.ToString()] != null)
         {
             if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
             {
                 DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                 Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                 Session[appFunctions.Session.ShowMessageType.ToString()] = "";
             }
         }
         objCommon = new clsCommon();
         objCommon.FillRecordPerPage(ref ddlPerPage);
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 string pid = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
             }
         }
         LoadDataGrid(true, false);
         txtSearch.Focus();
         objCommon = null;
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SetRegulerExpression();
            lnkSaveAndAddnew.Visible = HasAdd;
            objClsCommon             = new clsCommon();
            objClsCommon.FillDropDownList(ddlBlock, "tblBlock", tblBlock.ColumnNames.AppBlockName, tblBlock.ColumnNames.AppBlockId, "--Select Block--", tblBlock.ColumnNames.AppBlockId, appFunctions.Enum_SortOrderBy.Asc, "appIsShowContent = 'False'");
            objClsCommon = null;
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }

                objEncrypt = null;
                SetValuesToControls();
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         ViewState["SortOrder"]   = appFunctions.Enum_SortOrderBy.Asc;
         ViewState["SortColumn"]  = "";
         lnkSaveAndAddnew.Visible = HasAdd;
         objCommon = new clsCommon();
         objCommon.FillDropDownList(ddlCategory, "tblCategory", tblCategory.ColumnNames.AppCategory, tblCategory.ColumnNames.AppCategoryID, "-- Select Category --", tblCategory.ColumnNames.AppCategory, appFunctions.Enum_SortOrderBy.Asc);
         objCommon = null;
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
                 // noIdFoundRedirect("Employee.aspx");
             }
             objEncrypt = null;
             SetValuesToControls();
             LoadAllData();
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "HideTab()", true);
         }
     }
 }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            lnkSaveAndAddnew.Visible = HasAdd;
            ViewState["SortOrder"]   = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"]  = "";

            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }
                objEncrypt = null;
                SetValuesToControls();
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "HideTab()", true);
            }
        }
    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        objUser = new tblUser();
        objUser.Where.AppUserName .Value = txtUserName.Text;
        objUser.Query.Load();
        if (objUser.RowCount > 0)
        {
            clsCommon objCommon = new clsCommon();
            clsEncryption objEncrypt = new clsEncryption();
            string StrBody = "";
            string strSubject = "Password Recovery Request";
            StrBody = objCommon.readFile(Server.MapPath("~/admin/EmailTemplates/ForgetPassword.html"));
            StrBody = StrBody.Replace("`email`", objUser.AppEmail);
            StrBody = StrBody.Replace("`password`", objEncrypt.Decrypt(objUser.AppPassword, appFunctions.strKey.ToString()));
            objCommon.SendMail(objUser.AppEmail, strSubject, StrBody);
            objEncrypt = null;
            objCommon = null;

            txtUserName.Text = "";
            lblMsg.Text = "Your password has been sent to your email address. Please check your email.";
            lblMsg.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lblMsg.Text = "Invalid Your User Name.";
            lblMsg.ForeColor = System.Drawing.Color.Red;

        }
        objUser = null;
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            lnkSaveAndAddnew.Visible = HasAdd;

            objClsCommon = new clsCommon();
            if ((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()])
            {
                objClsCommon.FillDropDownList(ddlRoleName, "tblRole", tblRole.ColumnNames.AppRoleName, tblRole.ColumnNames.AppRoleID, "--Select Role--", tblRole.ColumnNames.AppRoleID, appFunctions.Enum_SortOrderBy.Asc);
            }
            else
            {
                objClsCommon.FillDropDownList(ddlRoleName, "tblRole", tblRole.ColumnNames.AppRoleName, tblRole.ColumnNames.AppRoleID, "--Select Role--", tblRole.ColumnNames.AppRoleID, appFunctions.Enum_SortOrderBy.Asc, tblRole.ColumnNames.AppCreatedBy + "=" + Session[appFunctions.Session.UserID.ToString()].ToString());
            }
            objClsCommon = null;
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }

                objEncrypt = null;
                SetValuesToControls();
            }
        }
    }
Esempio n. 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         lnkSaveAndAddnew.Visible = HasAdd;
         objCommon = new clsCommon();
         objCommon.FillDropDownList(ddlCountry, "tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, "-- Select Country --");
         ddlState.Items.Clear();
         ddlState.Items.Add(new ListItem("-- Select State --", "0"));
         ddlCity.Items.Clear();
         ddlCity.Items.Add(new ListItem("-- Select City --", "0"));
         objCommon = null;
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
                 // noIdFoundRedirect("Employee.aspx");
             }
             objEncrypt = null;
             SetValuesToControls();
         }
     }
 }
    public bool SendPassword()
    {
        tblCustomer objCustomer = new tblCustomer();

        objCustomer.Where.AppEmailID.Value = txtEmail.Text;
        objCustomer.Query.Load();
        if (objCustomer.RowCount > 0)
        {
            clsCommon     objCommon  = new clsCommon();
            clsEncryption objEncrypt = new clsEncryption();
            string        StrBody    = "";
            string        strSubject = "Password Recovery Request";
            StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/ForgetPassword.html"));
            StrBody = StrBody.Replace("`email`", objCustomer.AppEmailID);
            StrBody = StrBody.Replace("`password`", objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey.ToString()));

            objCommon.SendConfirmationMail(objCustomer.AppEmailID, strSubject, StrBody, Enums.Enum_Confirmation_Mail_type.register);
            objEncrypt = null;
            objCommon  = null;

            txtEmail.Text = "";
        }
        else
        {
            DInfo.ShowMessage("Invalid email address, Please enter registered email.", Enums.MessageType.Error);
            return(false);
        }
        objCustomer = null;

        return(true);
    }
    //'Dim da As SqlDataAdapter
    //'Dim cn As New SqlConnection


    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            //'cn = New SqlConnection("Server=dbserver;Database=key_CarCrox;Uid=sa;Password=123456;")
            //'cn.Open()
            btnSaveAndAddnew.Visible = HasAdd;
            btnClear.Visible         = HasAdd;

            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();

                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    noIdFoundRedirect("Role.aspx");
                }

                objEncrypt = null;
                SetValuesToControls();
            }
            else
            {
                SetValuesToControls(true);
            }
        }
    }
Esempio n. 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"] = "";

            objCommon = new clsCommon();
            objCommon.FillDropDownList(ddlstatus, "tblOrderStatus", tblOrderStatus.ColumnNames.AppOrderStatus, tblOrderStatus.ColumnNames.AppOrderStatusID, "-- Select Status --", tblOrderStatus.ColumnNames.AppDisplayOrder, appFunctions.Enum_SortOrderBy.Asc);
            objCommon.FillRecordPerPage(ref ddlPerPage);
            objCommon = null;
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }
                objEncrypt = null;
                SetValuesToControls();
            }
            LoadDataGrid(true, false);
        }
    }
Esempio n. 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         lnkSaveAndAddnew.Visible = HasAdd;
         SetRegExpresssion();
         objCommon = new clsCommon();
         objCommon.FillDropDownList(ddlProduct, "tblProduct", tblProduct.ColumnNames.AppProductName, tblProduct.ColumnNames.AppProductID, "-- Select Product --");
         objCommon   = null;
         img.Visible = false;
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
                 // noIdFoundRedirect("Employee.aspx");
             }
             objEncrypt = null;
             SetValuesToControls();
         }
     }
 }
Esempio n. 16
0
        private void ServerInitialize_Load(object sender, EventArgs e)
        {
            try
            {
                oReg.RegistryPathCurrentUser = clsGlobal.s_FullRegKey;

                txtServer.Text   = oReg.getSetting("Server");
                txtUsername.Text = oEncryption.Decrypt(oReg.getSetting("User"));
                txtpassword.Text = oEncryption.Decrypt(oReg.getSetting("Password"));
                cboDatabase.Properties.NullText = oReg.getSetting("Database");
                txtPort.Text = oReg.getSetting("Port");
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Could not write/read Registry System.!\nCall Your System Administrator\n", clsGlobal.str_ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
    public void LoadRecentProduct()
    {
        string strRecentProductId = "";

        objEncrypt = new clsEncryption();
        if (Request.Cookies.Get("FebyMart") != null)
        {
            if (Request.Cookies.Get("FebyMart").Value != "")
            {
                strRecentProductId = objEncrypt.Decrypt(Request.Cookies.Get("FebyMart").Value, appFunctions.strKey);
            }
        }
        if (strRecentProductId != "")
        {
            if (!strRecentProductId.Contains(hdnProductDetailId.Value))
            {
                strRecentProductId = strRecentProductId.Trim(',').TrimEnd(',').Trim();
                string[] strIds = strRecentProductId.Split(',');
                if (strIds.Length > 3)
                {
                    string strRecentId = "";
                    for (int i = 1; i < 4; i++)
                    {
                        strRecentId = strRecentId + "," + strIds[i];
                    }
                    strRecentProductId = strRecentId.Trim(',').TrimEnd(',').Trim() + "," + hdnProductDetailId.Value;
                }
                else
                {
                    strRecentProductId = strRecentProductId + "," + hdnProductDetailId.Value;
                }
            }
        }
        else
        {
            strRecentProductId = hdnProductDetailId.Value;
        }
        tblProduct objTempProduct = new tblProduct();

        objDataTable = objTempProduct.LoadRecentProduct(strRecentProductId, hdnProductDetailId.Value);
        if (objDataTable.Rows.Count > 0)
        {
            RepRecentProduct.DataSource = objDataTable;
            RepRecentProduct.DataBind();
            divRecentProduct.Visible = true;
        }
        else
        {
            divRecentProduct.Visible = false;
        }
        objTempProduct     = null;
        httpCookie         = new HttpCookie("FebyMart", objEncrypt.Encrypt(strRecentProductId, appFunctions.strKey));
        httpCookie.Expires = DateTime.Today.AddDays(10);
        Response.Cookies.Add(httpCookie);
        objEncrypt = null;
    }
Esempio n. 18
0
    public Boolean IsLogin()
    {
        if (txtEmail.Text.Trim() == "" || txtPassword.Text.Trim() == "")
        {
            DInfo.ShowMessage("Enter user name and password.", Enums.MessageType.Error);
            return(false);
        }
        //string strRegex = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}" + "\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\" + ".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
        //Regex re = new Regex(strRegex);
        //if (!(re.IsMatch(txtEmail.Text.Trim())))
        //{
        //    DInfo.ShowMessage("Invalid Email (Ex. [email protected])", Enums.MessageType.Error);
        //    return false;
        //}
        tblCustomer objCustomer = new tblCustomer();

        objCustomer.Where.AppEmailID.Value = txtEmail.Text.Trim();
        objCustomer.Query.Load();
        if (objCustomer.RowCount > 0)
        {
            clsEncryption objEncrypt = new clsEncryption();
            if (string.Compare(objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey), txtPassword.Text, false) != 0)
            {
                DInfo.ShowMessage("Invalid user name and password.", Enums.MessageType.Error);
                return(false);
            }
            else
            {
                if (objCustomer.AppIsVerified)
                {
                    httpCookie         = new HttpCookie("FabyMartUsername", objEncrypt.Encrypt(txtEmail.Text, appFunctions.strKey));
                    httpCookie.Expires = DateTime.Today.AddDays(10);
                    Response.Cookies.Add(httpCookie);
                    httpCookie         = new HttpCookie("FabyMartPassword", objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey));
                    httpCookie.Expires = DateTime.Today.AddDays(10);
                    Response.Cookies.Add(httpCookie);
                    Session[appFunctions.Session.ClientUserID.ToString()]   = objCustomer.AppCustomerID;
                    Session[appFunctions.Session.ClientUserName.ToString()] = objCustomer.AppFirstName + " " + objCustomer.AppLastName;
                }
                else
                {
                    DInfo.ShowMessage("Your account is Not Verified .", Enums.MessageType.Error);
                    return(false);
                }
            }
            objEncrypt = null;
        }
        else
        {
            DInfo.ShowMessage("Invalid user name and password.", Enums.MessageType.Error);
            return(false);
        }
        objCustomer = null;
        return(true);
    }
Esempio n. 19
0
    private void SetValuesToControl()
    {
        objSettings = new tblSettings();
        objEncrypt  = new clsEncryption();
        objSettings.LoadAll();
        if (objSettings.RowCount > 0)
        {
            try
            {
                txtSiteName.Text           = objSettings.AppSiteName;
                txtFooter.Text             = objSettings.AppFooterText;
                chkSiteOffline.Checked     = objSettings.AppIsSiteOffline;
                txtSiteOfflineMessage.Text = objSettings.AppSiteOfflineMessage;
                txtSiteTagLine.Text        = objSettings.AppSiteTagLine;
                ddlPerMenu.SelectedValue   = objSettings.AppSiteDefaultListLimit;
                txtPathToFolder.Text       = objSettings.AppPathToFolder;
                //txtDatasourceName.Text = objSettings.AppDatasource;
                //txtDatasourceUserName.Text = objSettings.AppDatasourceUserName;
                //txtDataBaseName.Text = objSettings.AppDatabaseName;
                txtSMTP.Text           = objSettings.AppSMTP;
                txtSiteEmail.Text      = objSettings.AppSiteEmail;
                txtPortNumber.Text     = objSettings.AppPortNumber;
                txtClientSiteUrl.Text  = objSettings.AppClientSiteURL;
                txtRecepientEmail.Text = objSettings.AppRecepientEmail;

                if (objSettings.AppSiteOfflineImage.ToString() != "" && objSettings.AppSiteOfflineImage.ToString() != null)
                {
                    imgOfflineImage.ImageUrl = objSettings.AppSiteOfflineImage;
                }
                if (objSettings.AppSiteLogo.ToString() != "" && objSettings.AppSiteLogo.ToString() != null)
                {
                    ImgLogo.ImageUrl = objSettings.AppSiteLogo;
                }
                if (objSettings.AppSiteFavicon.ToString() != "" && objSettings.AppSiteFavicon.ToString() != null)
                {
                    ImgFavicon.ImageUrl = objSettings.AppSiteFavicon;
                }
                //txtDatasourcePassword.Attributes.Add("value", objSettings.AppDatasourcePassword);
                txtEmailPassword.Attributes.Add("value", objEncrypt.Decrypt(objSettings.AppEmailPassword, appFunctions.strKey));

                if (objSettings.s_AppIsCOD != "")
                {
                    CHkIsCOD.Checked = objSettings.AppIsCOD;
                }
                else
                {
                    CHkIsCOD.Checked = false;
                }
            }
            catch (Exception e)
            {
            }
        }
        objSettings = null;
    }
Esempio n. 20
0
        private void Login(string strUsername, string strPassword)
        {
            try
            {
                clsEncryption oEncryption = new clsEncryption();
                using (clsConnection oconn = new clsConnection())
                {
                    NpgsqlCommand ocmd = new NpgsqlCommand();
                    oconn.Open();
                    ocmd.Connection = oconn.Conn;

                    ocmd            = new NpgsqlCommand();
                    ocmd.Connection = oconn.Conn;
                    bool   isActive = true;
                    string strsql   = @"select userid, username, fullname,email, groupusers from tbm_users where username=@username and password=@password and dlt='0' and active='1'";
                    ocmd.Parameters.Add("@username", NpgsqlTypes.NpgsqlDbType.Varchar).Value = oEncryption.Encrypt(strUsername.ToString().ToUpper());
                    ocmd.Parameters.Add("@password", NpgsqlTypes.NpgsqlDbType.Varchar).Value = oEncryption.Encrypt(strPassword.ToString());
                    ocmd.CommandText = strsql;
                    NpgsqlDataReader dr;
                    dr = ocmd.ExecuteReader();
                    if (dr.Read())
                    {
                        clsRegKey oRegKey = new clsRegKey();
                        oRegKey.RegistryPathCurrentUser = clsGlobal.s_FullRegKey;
                        oRegKey = null;
                        clsGlobal.strUserName     = oEncryption.Decrypt(dr["username"].ToString());
                        clsGlobal.strUserID       = dr["userid"].ToString();
                        clsGlobal.strHakAkses     = dr["groupusers"].ToString();
                        clsGlobal.strNamaPetugas  = dr["fullname"].ToString();
                        clsGlobal.strUserPassword = txtPassword.Text;
                        clsGlobal.strGroupUser    = dr["groupusers"].ToString();
                    }
                    else
                    {
                        XtraMessageBox.Show("Invalid username or password .!", clsGlobal.str_ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        strPassword = "";
                        oconn.Close();
                        ocmd        = null;
                        oEncryption = null;
                        return;
                    }
                    oconn.Close();
                    ocmd = null;
                }
                oEncryption       = null;
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Unable connect to database server, please configure the database connection first", clsGlobal.str_ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                frmServerInitialize frm = new frmServerInitialize();
                frm.ShowDialog(this);
            }
        }
 private void SetValuesToControls()
 {
     if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
     {
         objCustomer = new tblCustomer();
         if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
         {
             txtFirstName.Text = objCustomer.AppFirstName;
             txtLastName.Text  = objCustomer.AppLastName;
             txtEmail.Text     = objCustomer.AppEmailID;
             objEncrypt        = new clsEncryption();
             txtPassword.Attributes.Add("value", objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey));
             objEncrypt     = null;
             txtMobile.Text = objCustomer.AppMobile;
             txtPhone.Text  = objCustomer.AppPhone;
             if (objCustomer.s_AppGender != "")
             {
                 if (objCustomer.AppGender)
                 {
                     RbtnMale.Checked = true;
                 }
                 else
                 {
                     rbtnFeMale.Checked = true;
                 }
             }
             else
             {
                 RbtnMale.Checked = true;
             }
             chkIsVerified.Checked = objCustomer.AppIsVerified;
             if (objCustomer.AppImage != "")
             {
                 img.ImageUrl = objCustomer.AppImage;
             }
             if (objCustomer.s_AppIsActive != "")
             {
                 chkIsActive.Checked = objCustomer.AppIsActive;
             }
             if (objCustomer.s_AppIsNewsLetter != "")
             {
                 chkIsNewsLetter.Checked = objCustomer.AppIsNewsLetter;
             }
             if (objCustomer.s_AppIsVerified != "")
             {
                 chkIsVerified.Checked = objCustomer.AppIsVerified;
             }
         }
         objCustomer = null;
     }
 }
Esempio n. 22
0
    private bool SaveData()
    {
        objUser = new tblUser();
        objUser.LoadByPrimaryKey((int)Session[appFunctions.Session.UserID.ToString()]);
        objEncrypt = new clsEncryption();
        if (string.Compare(objEncrypt.Decrypt(objUser.AppPassword, appFunctions.strKey), txtOldPassword.Text) == 0)
        {
            objUser.AppPassword = objEncrypt.Encrypt(txtNewPassword.Text, appFunctions.strKey);
            objUser.Save();
            return(true);
        }

        DInfo.ShowMessage("Old Password is incorrect", Enums.MessageType.Error);
        return(false);
    }
Esempio n. 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hdnProductDetailID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
            ViewState["SortOrder"]   = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"]  = "";
            //btnAdd.Visible = HasAdd;
            btnDelete.Visible = HasDelete;

            dgvGridView.Columns[0].Visible = HasDelete;
            // dgvGridView.Columns[1].Visible = HasEdit;
            objCommon = new clsCommon();
            objCommon.BindEnumtoDDL(typeof(Enums.Enum_ReviewStatus), ddlStatus, "--Select Status--");

            //   objCommon.FillDropDownList(ddlUserName, "tblRegistration", tblRegistration.ColumnNames.AppFullName, tblRegistration.ColumnNames.AppRegistrationID, "--Select UserName--", tblRegistration.ColumnNames.AppUserStatus + "<>" + Convert.ToInt32(Enums.Enum_UserStatus.Created));
            //  objCommon.FillDropDownList(ddlProfessionalName, "tblProfessional", tblProfessional.ColumnNames.AppProfessionalName, tblProfessional.ColumnNames.AppProfessionalID, "--Select Professional--", tblProfessional.ColumnNames.AppPublishedBy + "<>" + "0");
            objCommon = null;
            if (Session[appFunctions.Session.ShowMessage.ToString()] != null)
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }
            objCommon = new clsCommon();
            objCommon.FillRecordPerPage(ref ddlPerPage);
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    string pid = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                    //     ddlProfessionalName.SelectedValue = pid;
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }
            }
            LoadDataGrid(true, false);
            //txtSearch.Focus();
            objCommon = null;
        }
    }
Esempio n. 24
0
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     if (IsLogin())
     {
         tblCustomer objCustomer = new tblCustomer();
         objCustomer.Where.AppEmailID.Value = txtEmail.Text.Trim();
         objCustomer.Query.Load();
         if (objCustomer.RowCount > 0)
         {
             objEncrypt = new clsEncryption();
             if (string.Compare(objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey), txtPassword.Text, false) != 0)
             {
                 DInfo.ShowMessage("Invalid user name or password.", Enums.MessageType.Error);
             }
             else
             {
                 if (objCustomer.AppIsVerified)
                 {
                     httpCookie         = new HttpCookie("FabyMartUsername", objEncrypt.Encrypt(txtEmail.Text, appFunctions.strKey));
                     httpCookie.Expires = DateTime.Today.AddDays(10);
                     Response.Cookies.Add(httpCookie);
                     httpCookie         = new HttpCookie("FabyMartPassword", objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey));
                     httpCookie.Expires = DateTime.Today.AddDays(10);
                     Response.Cookies.Add(httpCookie);
                     Session[appFunctions.Session.ClientUserID.ToString()]   = objCustomer.AppCustomerID;
                     Session[appFunctions.Session.ClientUserName.ToString()] = objCustomer.AppFirstName + " " + objCustomer.AppLastName;
                     objCommon = new clsCommon();
                     string strRedirect = objCommon.GetParameterFromUrl(Enums.Enums_URLParameterType.ByNumber, "1");
                     objCommon = null;
                     Response.Redirect(objPageBase.GetAlias("Default.aspx"));
                 }
                 else
                 {
                     DInfo.ShowMessage("Your account is Not Verified.Plase verify it by your registered email address .", Enums.MessageType.Error);
                 }
             }
             objEncrypt = null;
         }
         else
         {
             DInfo.ShowMessage("Invalid user name or password.", Enums.MessageType.Error);
         }
         objCustomer = null;
     }
 }
Esempio n. 25
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                string strId = "";
                objEncrypt = new clsEncryption();
                objCommon  = new clsCommon();
                strId      = objCommon.GetParameterFromUrl(Enums.Enums_URLParameterType.ByNumber, "1");
                strId      = objEncrypt.Decrypt(strId, appFunctions.strKey);
                objEncrypt = null;

                if (strId != "")
                {
                    objReturnOrder = new tblReturnOrder();
                    objDataTable   = objReturnOrder.GetReturnOrderListWithCityStateCountry(strId, Convert.ToInt32(Enums.Enum_ReturnStatus.Slip).ToString(), appFunctions.strSellerName, appFunctions.strMobileNo, appFunctions.strAddress, appFunctions.strCountry, appFunctions.strState, appFunctions.strCity, appFunctions.strPinColde);

                    if (objDataTable.Rows.Count > 0)
                    {
                        printButton.Visible = true;
                    }
                    else
                    {
                        printButton.Visible = false;
                    }
                    dtProductInvoice.DataSource = objDataTable;
                    dtProductInvoice.DataBind();
                    //  objSubOrder.SetProductInvoiceGenerated(Convert.ToInt32(Enums.Enums_OrderStatus.Confirmed).ToString(),strId.TrimEnd(',').Trim());
                    objReturnOrder = null;
                }
                else
                {
                    printButton.Visible = false;
                }
            }
            catch (Exception ex)
            {
                printButton.Visible = false;
                Response.Write(ex.StackTrace.ToString());
            }
        }
    }
Esempio n. 26
0
    public bool SaveCustomer()
    {
        tblCustomer objCustomer = new tblCustomer();

        if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString())))
        {
            objEncrypt = new clsEncryption();
            if (string.Compare(objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey), txtOldPassword.Text, false) != 0)
            {
                DInfo.ShowMessage("Old password is incorrect", Enums.MessageType.Warning);
                return(false);
            }
            objCustomer.AppPassword = objEncrypt.Encrypt(txtNewRetryPassword.Text, appFunctions.strKey);
            objEncrypt = null;
            objCustomer.Save();
        }
        objCustomer = null;
        return(true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            lnkSaveAndAddnew.Visible = HasAdd;


            if (!((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()]))
            {
                trDefaultPage.Visible   = false;
                trIsStatic.Visible      = false;
                trdynParameters.Visible = false;
            }

            objClsCommon = new clsCommon();
            objClsCommon.FillDropDownList(ddlPageFormats, "tblPageFormat", tblPageFormat.ColumnNames.AppPageFormatName, tblPageFormat.ColumnNames.AppPageFormatId, "-- Select Page Format --", tblPageFormat.ColumnNames.AppPageFormatId, appFunctions.Enum_SortOrderBy.Asc, " appIsActive = 'true' ");
            objClsCommon = null;
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }

                objEncrypt = null;
                SetValuesToControls();
            }
            else
            {
                ChkIsLink.Checked = false;

                chkIsStatic.Checked = true;
            }
            CheckLink(ChkIsLink.Checked);
            SetRegulerExpression();
        }
    }
Esempio n. 28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if ((Request.QueryString.Get("ID") != null))
         {
             objEncrypt = new clsEncryption();
             try
             {
                 hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
             }
             catch (Exception ex)
             {
                 // noIdFoundRedirect("Employee.aspx");
             }
             objEncrypt = null;
             SetValuesToControls();
         }
     }
 }
Esempio n. 29
0
    private void SetValuesToControls()
    {
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objUser = new tblUser();
            if (objUser.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
            {
                txtUserName.Text = objUser.AppUserName;
                objEncrypt       = new clsEncryption();
                txtPassword.Attributes.Add("value", objEncrypt.Decrypt(objUser.AppPassword, appFunctions.strKey));
                ddlRoleName.SelectedValue = objUser.s_AppRoleId;

                txtFullName.Text      = objUser.AppFullName;
                txtMobileNo.Text      = objUser.AppMobile;
                txtEmailAddress.Text  = objUser.AppEmail;
                txtAddress.Text       = objUser.AppAddress;
                chkIsActive.Checked   = objUser.AppIsActive;
                imgUserPhoto.ImageUrl = objUser.s_AppPhoto;
                txtDescription.Text   = objUser.AppDescription;
            }
            objUser = null;
        }
    }
Esempio n. 30
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            ifError = false;
            ViewState["SortOrder"]  = appFunctions.Enum_SortOrderBy.Asc;
            ViewState["SortColumn"] = "";

            btnAdd.Visible    = HasAdd;
            btnDelete.Visible = HasDelete;
            dgvGridView.Columns[0].Visible = HasDelete;
            dgvGridView.Columns[1].Visible = HasEdit;
            dgvGridView.Columns[5].Visible = HasEdit;

            if ((Session[appFunctions.Session.ShowMessage.ToString()] != null))
            {
                if (!string.IsNullOrEmpty(Session[appFunctions.Session.ShowMessage.ToString()].ToString()))
                {
                    DInfo.ShowMessage(Session[appFunctions.Session.ShowMessage.ToString()].ToString(), (Enums.MessageType)Session[appFunctions.Session.ShowMessageType.ToString()]);
                    Session[appFunctions.Session.ShowMessage.ToString()]     = "";
                    Session[appFunctions.Session.ShowMessageType.ToString()] = "";
                }
            }
            objCommon = new clsCommon();
            objCommon.FillRecordPerPage(ref ddlPerPage);
            if ((Request.QueryString.Get("ID") != null))
            {
                objEncrypt = new clsEncryption();
                try
                {
                    hdnPKID.Value = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                    intSiteMapId  = Convert.ToInt32(hdnPKID.Value);
                }
                catch (Exception ex)
                {
                    // noIdFoundRedirect("Employee.aspx");
                }

                objEncrypt = null;
                if ((Request.QueryString.Get("type") != null))
                {
                    if ((Request.QueryString.Get("type") == "mtype"))
                    {
                        hdnType.Value = "mtype";
                    }
                    else
                    {
                        hdnType.Value = "";
                    }
                }
                else
                {
                    hdnType.Value = "";
                }
            }
            if (intSiteMapId != -1)
            {
                DataTable dt = new DataTable();

                objEncrypt = new clsEncryption();
                dynamic objTempMenuItem = new tblMenuItem();
                if (hdnType.Value == "")
                {
                    dt             = objTempMenuItem.GetSiteMap(intSiteMapId);
                    strSiteMapData = dt.Rows[0][0].ToString();
                    dt             = objTempMenuItem.GetMenuType(intSiteMapId, false);
                }
                else
                {
                    dt = objTempMenuItem.GetMenuType(intSiteMapId, true);
                }

                String[] SplitSiteMapString = strSiteMapData.Split('/');

                strSiteMap = "<a href='MasterMenus.aspx'>Menu Items</a>";

                if (SplitSiteMapString.Length > 1)
                {
                    strSiteMap += " >  <a href=MenuItems.aspx?Id=" + objEncrypt.Encrypt(dt.Rows[0]["appMenuTypeId"].ToString(), appFunctions.strKey) + "&type=mtype>" + dt.Rows[0]["appMenuTypeName"].ToString() + "</a>";
                    //strSiteMap = "<a href='MenuItems.aspx'>Parent Tabs </a>";
                }
                else
                {
                    strSiteMap += " > " + dt.Rows[0]["appMenuTypeName"].ToString();
                }

                for (int i = 0; i <= SplitSiteMapString.Length - 2; i += 1)
                {
                    String[] SplittedItems = SplitSiteMapString.GetValue(i).ToString().Split(',');
                    if (i == SplitSiteMapString.Length - 2)
                    {
                        strSiteMap += " > " + SplittedItems.GetValue(0);
                    }
                    else
                    {
                        strSiteMap += " > <a href='MenuItems.aspx?Id=" + objEncrypt.Encrypt(SplittedItems.GetValue(1).ToString(), appFunctions.strKey) + "'> " + SplittedItems.GetValue(0) + "</a>";
                    }
                }

                litSiteMap.Text = strSiteMap;
            }

            LoadDataGrid(true, false);
            txtSearch.Focus();
            objCommon = null;
        }
    }