Ejemplo n.º 1
0
        protected void btnLoginTravelers_Click(object sender, ImageClickEventArgs e)
        {
            if (!txtMelliCode.Text.IsValidMelliCode())
            {
                MessageBoxHelper.ShowMessageBox(this, "کد ملی نامعتبراست", "", MessageBoxType.Information);
                return;
            }
            if (!txtMobileNumber.Text.IsValidMobileNumber())
            {
                MessageBoxHelper.ShowMessageBox(this, "شماره همراه نامعتبراست", "", MessageBoxType.Information);
                return;
            }
            var gUser = new GeustKidsUser
            {
                GeustUserId = Guid.NewGuid(),
                EmailAddress = txtEmailAddress.Text,
                Name = txtName.Text,
                Family = txtFamily.Text,
                MelliCode = txtMelliCode.Text,
                MobileNumber = txtMobileNumber.Text,
                CreateDateTime = DateTime.Now
            };
            KidsUser_DataProvider.SaveGeustKidsUser(gUser);
            FormBaseClass.GeustKidsUser = gUser;

            Response.Redirect(Request["ReturnUrl"] ?? "~/جزیره آرزوها.aspx");
        }
Ejemplo n.º 2
0
 private void FillExcellRow(GeustKidsUser user, ExcelWorksheet sheet, int RowId)
 {
     sheet.Cells[RowId, 1].Value = user.Name;
     sheet.Cells[RowId, 2].Value = user.Family;
     sheet.Cells[RowId, 3].Value = user.MelliCode;
     sheet.Cells[RowId, 4].Value = user.EmailAddress;
     sheet.Cells[RowId, 5].Value = user.MobileNumber;
     sheet.Cells[RowId, 6].Value = PersianDateTime.MiladiToPersian(user.CreateDateTime).ToShortDateTimeString();
 }
 public static void SaveGeustKidsUser(GeustKidsUser gUser)
 {
     using (var ctx = new BMIKidsEntities(ConnectionString))
     {
         try
         {
             ctx.GeustKidsUsers.ApplyChanges(gUser);
             ctx.SaveChanges();
             gUser.AcceptChanges();
         }
         catch (Exception ex)
         {
             LogUtility.WriteEntryEventLog("SaveGeustKidsUser", ex, EventLogEntryType.Information);
             if (ex.InnerException != null)
                 throw ex.InnerException;
             throw;
         }
     }
 }