سلام استاد مدائنی وقتتون بخیر
استاد من تو قسمت ویرایش شخص وقتی میخام کسیو ویرایش یا اد کنم با ارور
Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
روبه رو میشم اینم کد مربوط به ولید
if (BaseValidator.IsFormValid(this.components))
{
string ImageName = Guid.NewGuid().ToString() + Path.GetExtension(PcCustomer.ImageLocation);
string path = Application.StartupPath + "/images/";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
PcCustomer.Image.Save(path+ImageName);
Customers customers = new Customers()
{
CustomerID = int.Parse( TxtID.Text),
Address = TxtAddress.Text,
Email = TxtEmail.Text,
Mobile = TxtMobile.Text,
CustomerImage= ImageName
};
if (CustomerID==0)
{
db.customerRepository.InsertCustomer(customers);
}
else
{
db.customerRepository.UpdateCustomer(customers);
}
db.save();
DialogResult = DialogResult.OK;
}
سلام
در یکی از فیلد های مدل مشکلی هست
مقادیر رو برررسی کنید
سلام استاد من بعد دوروز استراحت امروز بازم تلاش کردم این ارور ولید هنوز میده و دلیلشم همون تکست ای دیه که در فرم افزودن میگیرم که با یه اینت دات پارس اوکیه ولی وقتی میخام ادیت کنم اون فیلد دیگه تبدیل به اینت نمیشه مشکل شده برام چیکارش کنم نه تبدیل میشه به اینت نه همینجوری به صورت عادی کار میکنه چون تکس باکس یه رشتس راه حلی دارین ؟
رشته باید به int تبدیل بشه مگر شنما کاراکتری استفاده کردید باشید