コード例 #1
0
        //
        // GET: /Manage/SetPassword
        public ActionResult ChangePersonalInformation()
        {
            ChangePersonalInformation lmd = new ChangePersonalInformation();
            DataSet ds = new DataSet();

            Connection.Connection con = new Connection.Connection();
            ds = con.UserData(User.Identity.GetUserId());
            if (ds.Tables[0].Rows.Count == 1)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                lmd.Us_Name  = dr["Us_Name"].ToString();
                lmd.Us_LName = dr["Us_LName"].ToString();
                lmd.Us_Phone = dr["Us_Phone"].ToString();

                DateTimeFormatInfo format = new DateTimeFormatInfo();
                format.ShortDatePattern = "mm/dd/yyyy";
                lmd.Us_BirthDay         = Convert.ToDateTime(dr["Us_BirthDay"], format);

                lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                lmd.Countries       = con.GetListOfCountries();
                lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                lmd.Cities          = con.GetListOfCities(lmd.SelectedState);
            }
            return(View(lmd));
        }
コード例 #2
0
        public ActionResult OnlinePayment()
        {
            OnlinePaymentModel lmd = new OnlinePaymentModel();

            Connection.Connection con    = new Connection.Connection();
            DateTimeFormatInfo    format = new DateTimeFormatInfo();

            //format.ShortDatePattern = "mm-dd-yyyy";
            format.ShortDatePattern = "mm/dd/yyyy";
            if (User.Identity.GetUserId() != null)
            {
                DataSet ds = new DataSet();
                ds          = con.UserData(User.Identity.GetUserId());
                lmd.Do_Date = Convert.ToDateTime(DateTime.Now, format);
                if (ds.Tables[0].Rows.Count == 1)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    lmd.Us_Name         = dr["Us_Name"].ToString();
                    lmd.Us_LName        = dr["Us_LName"].ToString();
                    lmd.Us_Phone        = dr["Us_Phone"].ToString();
                    lmd.Us_Email        = dr["Us_Email"].ToString();
                    lmd.Us_HomeAddress  = dr["Us_HomeAddress"].ToString();
                    lmd.Us_WorkAddress  = dr["Us_WorkAddress"].ToString();
                    lmd.City_Ct_Id      = Convert.ToInt16(dr["City_Ct_Id"]);
                    lmd.SelectedState   = con.StateData(lmd.City_Ct_Id);
                    lmd.SelectedCountry = con.CountryData(lmd.SelectedState);
                    lmd.Countries       = con.GetListOfCountries();
                    lmd.States          = con.GetListOfStates(lmd.SelectedCountry);
                    lmd.Cities          = con.GetListOfCities(lmd.SelectedState);

                    return(View(lmd));
                }
            }
            //lmd.Us_BirthDay = Convert.ToDateTime(DateTime.Now, format);
            lmd.SelectedState   = 1;
            lmd.SelectedCountry = 1;
            lmd.City_Ct_Id      = 1;
            lmd.Countries       = con.GetListOfCountries();
            lmd.States          = con.GetListOfStates(1);
            lmd.Cities          = con.GetListOfCities(1);
            return(View(lmd));
        }
コード例 #3
0
        //
        // GET: /Manage/Index
        public async Task <ActionResult> Index(ManageMessageId?message)
        {
            ViewBag.StatusMessage =
                message == ManageMessageId.ChangePasswordSuccess ? "پسورد شما تغییر یافته است"
                : message == ManageMessageId.SetPasswordSuccess ? "پسورد شما ست شده است"
                : message == ManageMessageId.Error ? "خطایی رخ داده است"
                : message == ManageMessageId.AddPhoneSuccess ? "شماره تلفن شما اضاه شده است"
                : message == ManageMessageId.RemovePhoneSuccess ? "شماره تلفن شما حذف شده است"
                : message == ManageMessageId.UpdatePersonalInformation ? "اطلاعات شما با موفقیت ذخیره گردید"
                : message == ManageMessageId.PeriodicPaymentFormSuccess? "فرم حمایت دوره ای به درستی تکمیل گردید"
                : message == ManageMessageId.OnlinePaymentSuccess? "پرداخت آنلاین به درستی انجام شد"
                : message == ManageMessageId.AddGallerySuccess ? "اضافه نمودن به درستی انجام شد"
                : "";

            var UserGroupType = 1;
            var userId        = User.Identity.GetUserId();

            Connection.Connection con = new Connection.Connection();
            DataSet ds = new DataSet();

            ds = con.UserData(User.Identity.GetUserId());
            if (ds.Tables[0].Rows.Count == 1)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                UserGroupType = Convert.ToInt16(dr["UserGroup_Gr_Id"]);
            }

            var model = new IndexViewModel
            {
                HasPassword = HasPassword(),
                PhoneNumber = await UserManager.GetPhoneNumberAsync(userId),
                Logins      = await UserManager.GetLoginsAsync(userId),
                GroupType   = UserGroupType
            };

            return(View(model));
        }