private async void btnInsSetting_Click(object sender, EventArgs e) { var r = new SettingBussines { Guid = Guid.NewGuid(), DateSabt = DateConvertor.M2SH(DateTime.Now), Status = true, //DivarCat3 = txtD_Cat3.Text, //DivarCat1 = txtD_Cat1.Text, //DivarPicPath = txtD_Address.Text, //CountAdvInDayDivar = int.Parse(txtD_CountInDay.Text), //CountAdvInDaySheypoor = int.Parse(txtSh_CountInDay.Text), //CountAdvInIPDivar = int.Parse(txtD_CountInIP.Text), //CountAdvInIPSheypoor = int.Parse(txtSh_CountInIP.Text), //CountAdvInMounthDivar = int.Parse(txtD_CountInMounth.Text), //CountAdvInMounthSheypoor = int.Parse(txtSh_CountInMounth.Text), // DivarCat2 = txtD_Cat2.Text, // DivarDayCountForUpdateState = 10, //SheypoorCat1 = txtSh_Cat1.Text, //SheypoorCat2 = txtSh_Cat2.Text, //SheypoorCat3 = txtSh_Cat3.Text, // SheypoorDayCountForUpdateState = 10, // SheypoorPicPath = txtSh_Address.Text, //DivarMaxImgCount = int.Parse(txtDivarMaxImg.Text), //SheypoorMaxImgCount = int.Parse(txtSheypoorMaxImg.Text) }; await r.SaveAsync(); }
private async void btnFinish_Click(object sender, EventArgs e) { try { btnFinish.Enabled = false; if (int.Parse(txtAdvInDay.Text) > 10) { WebErrorLog.ErrorInstence.StartErrorLog( "تعداد آگهی ارسالی به ازای هر سیمکارت در روز نمی تواند بیشتر از 10 آگهی باشد", false); txtAdvInDay.Focus(); return; } if (int.Parse(txtAdvInMounth.Text) > 30) { WebErrorLog.ErrorInstence.StartErrorLog( "تعداد آگهی ارسالی به ازای هر سیمکارت در ماه نمی تواند بیشتر از 30 آگهی باشد", false); txtAdvInMounth.Focus(); return; } if (int.Parse(txtCountPic.Text) > 10) { WebErrorLog.ErrorInstence.StartErrorLog("تعداد تصاویر آگهی ارسالی نمی تواند بیشتر از 10 تصویر باشد", false); txtCountPic.Focus(); return; } if (int.Parse(txtUpdateDayCount.Text) > 30) { WebErrorLog.ErrorInstence.StartErrorLog("روزهای بروزرسانی آگهی نمی تواند بیشتر از 30 روز باشد", false); txtUpdateDayCount.Focus(); return; } cls.CountAdvInDay = int.Parse(txtAdvInDay.Text); cls.CountAdvInMounth = int.Parse(txtAdvInMounth.Text); cls.CountAdvInIP = int.Parse(txtAdvInIP.Text); cls.MaxImgCount = int.Parse(txtCountPic.Text); cls.Address = txtAdvAddress.Text; cls.DayCountForUpdateState = int.Parse(txtUpdateDayCount.Text); cls.DayCountForDelete = txtDelete.Text.ParseToInt(); await cls.SaveAsync(); WebErrorLog.ErrorInstence.StartErrorLog("اطلاعات ذخیره شد", true); SetData(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } finally { btnFinish.Enabled = true; } }
private async void mnuDefault_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { return; } if (DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; clsSetting.PanelGuid = guid; await clsSetting.SaveAsync(); await CheckDefault(); } catch (Exception exception) { WebErrorLog.ErrorInstence.StartErrorLog(exception); } }