private void SetValuesToControls()
    {
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objOrder = new tblOrder();
            if (objOrder.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)))
            {
                lblOrderNo.Text                = objOrder.s_AppOrderNo;
                ddlstatus.SelectedValue        = objOrder.s_AppOrderStatusID;
                lblOrderAmount.Text            = objOrder.s_AppOrderAmount;
                lblReceiverName.Text           = objOrder.s_AppReceiverName;
                lblReceiverContactNo1.Text     = objOrder.s_AppReceiverContactNo1;
                lblReceiverContactNo2.Text     = objOrder.s_AppReceiverContactNo2;
                lblRecevierEmail.Text          = objOrder.s_AppRecevierEmail;
                lblReceiverAddress.Text        = objOrder.s_AppReceiverAddress;
                lblPreferedTime.Text           = objOrder.s_AppPreferedTime;
                lblBillReceiverName.Text       = objOrder.s_AppBillReceiverName;
                lblBillReceiverContactNo1.Text = objOrder.s_AppBillReceiverContactNo1;
                lblBillReceiverContactNo2.Text = objOrder.s_AppBillReceiverContactNo2;
                lblBillRecevierEmail.Text      = objOrder.s_AppBillRecevierEmail;
                lblBillReceiverAddress.Text    = objOrder.s_AppBillReceiverAddress;

                tblCustomer objCust = new tblCustomer();

                if (objCust.LoadByPrimaryKey(objOrder.AppCustomerID))
                {
                    lblCustomer.Text       = objCust.s_AppFirstName + " " + objCust.s_AppLastName;
                    lblCustomerMobile.Text = objCust.s_AppMobile;
                    lblCustomerEmail.Text  = objCust.s_AppEmailID;
                }
                objCust = null;
            }
            objOrder = null;
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            SetUpPageContent(ref metaDescription, ref metaKeywords);
            objCommon = new clsCommon();
            string strIds = objCommon.GetParameterFromUrl(Enums.Enums_URLParameterType.ByNumber, "1");

            if (strIds != "")
            {
                Boolean approved = false;
                try
                {
                    string      strId       = objEncrypt.Decrypt(strIds, appFunctions.strKey);
                    tblCustomer objCustomer = new tblCustomer();
                    if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(strId)))
                    {
                        if (!(objCustomer.AppIsVerified))
                        {
                            objCustomer.AppIsVerified = true;
                            objCustomer.Save();
                            approved = true;
                        }
                    }
                    objCustomer = null;
                    Response.Redirect(GetAlias("Login.aspx") + "?From=" + objEncrypt.Encrypt("ApprovedPage" + approved.ToString(), appFunctions.strKey), true);
                }
                catch (Exception ex)
                {
                }
            }
            objCommon = null;
        }
    }
    private bool SaveData()
    {
        objClsCommon = new clsCommon();
        objCustomer  = new tblCustomer();
        if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "")
        {
            objCustomer.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value));
        }
        else
        {
            objCustomer.AddNew();
        }
        objCustomer.AppFirstName = txtFirstName.Text;
        objCustomer.AppLastName  = txtLastName.Text;
        objCustomer.AppEmailID   = txtEmail.Text;
        objEncrypt = new clsEncryption();
        objCustomer.AppPassword = objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey);
        objEncrypt            = null;
        objCustomer.AppMobile = txtMobile.Text;
        objCustomer.AppPhone  = txtPhone.Text;
        if (RbtnMale.Checked)
        {
            objCustomer.AppGender = true;
        }
        else
        {
            objCustomer.AppGender = false;
        }
        objCustomer.AppIsVerified = chkIsVerified.Checked;

        if (FileUploadImg.HasFile)
        {
            string strError = "";
            string Time     = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second);
            string strPath  = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, false, 0, 2000);
            if (strError == "")
            {
                objCustomer.AppImage = strPath;
            }
            else
            {
                DInfo.ShowMessage(strError, Enums.MessageType.Error);
                return(false);
            }
        }
        objCustomer.AppIsActive     = chkIsActive.Checked;
        objCustomer.AppIsNewsLetter = chkIsNewsLetter.Checked;
        objCustomer.Save();
        iCustomerID  = objCustomer.AppCustomerID;
        objCustomer  = null;
        objClsCommon = null;
        return(true);
    }
 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;
     }
 }
Example #5
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);
    }
    public bool SaveCustomer()
    {
        objCommon = new clsCommon();
        if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmail.Text, Session[appFunctions.Session.ClientUserID.ToString()].ToString()))
        {
            DInfo.ShowMessage("Email address already exist.", Enums.MessageType.Error);
            return(false);
        }

        tblCustomer objCustomer = new tblCustomer();

        if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString())))
        {
            objCustomer.AppFirstName = txtFirstName.Text.Trim();
            objCustomer.AppLastName  = txtLastName.Text.Trim();
            objCustomer.AppEmailID   = txtEmail.Text.Trim();
            objCustomer.AppMobile    = txtMobile.Text.Trim();
            objCustomer.AppPhone     = txtPhone.Text;
            //objCustomer.AppAddress = txtAddress.Text;
            //objCustomer.s_AppPincode = txtPincode.Text;

            if (RbtnMale.Checked)
            {
                objCustomer.AppGender = true;
            }
            else
            {
                objCustomer.AppGender = false;
            }
            if (FileUploadImg.HasFile)
            {
                string strError = "";
                string Time     = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second);
                string strPath  = objCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + txtLastName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, true);
                if (strError == "")
                {
                    objCustomer.AppImage = strPath;
                }
                else
                {
                    DInfo.ShowMessage(strError, Enums.MessageType.Error);
                    return(false);
                }
            }

            //string strCountryId = ddlCountry.SelectedValue;
            //string strStateId = ddlState.SelectedValue;
            //string strCityID = ddlCity.SelectedValue;
            //if (ddlCountry.SelectedValue == "-1")
            //{
            //    tblCountry objCountry = new tblCountry();
            //    objCountry.Where.AppCountry.Value = txtcountry.Text;
            //    objCountry.Query.Load();
            //    if (!(objCountry.RowCount > 0))
            //    {
            //        objCountry.AddNew();
            //        objCountry.AppCountry = txtcountry.Text;
            //        objCountry.Save();
            //    }
            //    strCountryId = objCountry.s_AppCountryID;
            //    objCountry = null;
            //}
            //if (ddlState.SelectedValue == "-1")
            //{
            //    tblState objState = new tblState();
            //    objState.Where.AppCountryID.Value = strCountryId;
            //    objState.Where.AppState.Value = txtState.Text;
            //    objState.Query.Load();
            //    if (!(objState.RowCount > 0))
            //    {
            //        objState.AddNew();
            //        objState.AppState = txtState.Text;
            //        objState.s_AppCountryID = strCountryId;
            //        objState.Save();
            //    }
            //    strStateId = objState.s_AppStateID;
            //    objState = null;
            //}
            //if (ddlCity.SelectedValue == "-1")
            //{
            //    tblCity objCity = new tblCity();
            //    objCity.Where.AppStateID.Value = strStateId;
            //    objCity.Where.AppCity.Value = txtCity.Text;
            //    objCity.Query.Load();
            //    if (!(objCity.RowCount > 0))
            //    {
            //        objCity.AddNew();
            //        objCity.AppCity = txtCity.Text;
            //        objCity.s_AppStateID = strStateId;
            //        objCity.Save();
            //    }
            //    strCityID = objCity.s_AppCityID;
            //    objCity = null;
            //}
            //            objCustomer.s_AppCityId = strCityID;
            //objCustomer.s_AppStateId = strStateId;
            //objCustomer.s_AppCountryId = strCountryId;
            objCustomer.Save();
        }
        objCustomer = null;
        objCommon   = null;
        return(true);
    }
    private void CustomerInfo()
    {
        objCustomer = new tblCustomer();
        if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString())))
        {
            txtFirstName.Text = objCustomer.AppFirstName;
            txtLastName.Text  = objCustomer.AppLastName;
            txtEmail.Text     = objCustomer.AppEmailID;
            txtEmail.Enabled  = false;
            txtMobile.Text    = objCustomer.AppMobile;
            txtPhone.Text     = objCustomer.AppPhone;
            if (objCustomer.s_AppCountryId != "")
            {
                objCommon = new clsCommon();
                //if (ddlCountry.Items.FindByValue(objCustomer.s_AppCountryId) != null)
                //{
                //    ddlCountry.SelectedValue = objCustomer.s_AppCountryId;
                //    objCommon.FillDropDownList(ddlState, "tblState", tblState.ColumnNames.AppState, tblState.ColumnNames.AppStateID, "-- Select State --", tblState.ColumnNames.AppState, appFunctions.Enum_SortOrderBy.Asc, tblState.ColumnNames.AppCountryID + "=" + ddlCountry.SelectedValue);
                //    ddlState.Items.Add(new ListItem("Other", "-1"));
                //    if (objCustomer.s_AppStateId != "")
                //    {
                //        if (ddlState.Items.FindByValue(objCustomer.s_AppStateId) != null)
                //        {
                //            ddlState.SelectedValue = objCustomer.s_AppStateId;
                //            objCommon.FillDropDownList(ddlCity, "tblCity", tblCity.ColumnNames.AppCity, tblCity.ColumnNames.AppCityID, "-- Select City --", tblCity.ColumnNames.AppCity, appFunctions.Enum_SortOrderBy.Asc, tblCity.ColumnNames.AppStateID + "=" + ddlState.SelectedValue);
                //            ddlCity.Items.Add(new ListItem("Other", "-1"));
                //            if (objCustomer.s_AppCityId != "")
                //            {
                //                if (ddlCity.Items.FindByValue(objCustomer.s_AppCityId) != null)
                //                {
                //                    ddlCity.SelectedValue = objCustomer.s_AppCityId;
                //                }
                //            }
                //        }
                //    }
                //}
                //txtcountry.Visible = false;
                //txtState.Visible = false;
                //txtCity .Visible = false;
                objCommon = null;
            }

            if (objCustomer.s_AppGender != "")
            {
                if (objCustomer.AppGender)
                {
                    RbtnMale.Checked = true;
                }
                else
                {
                    rbtnFeMale.Checked = true;
                }
            }
            else
            {
                RbtnMale.Checked = true;
            }
            if (objCustomer.AppImage != "")
            {
                img.ImageUrl = objCustomer.AppImage;
            }
            img.ImageUrl = objCustomer.AppImage;
            //  txtAddress.Text = objCustomer.AppAddress;
            //if (objCustomer.s_AppPincode != "")
            //{
            //    txtPincode.Text = objCustomer.s_AppPincode;
            //}
        }
        objCustomer = null;
    }