Ejemplo n.º 1
0
 private void btnReturnConfirm_Click(object sender, EventArgs e)
 {
     if (jJanusGrid1.SelectedRow == null)
     {
         return;
     }
     _Code = Convert.ToInt32(jJanusGrid1.SelectedRow.Row["Code"]);
     if (_Code == 0)
     {
         JMessages.Information(" از لیست رکوردی را انتخاب کنید ", "");
         return;
     }
     if (JMessages.Question(" آیا می خواهید تایید برگشت شود ؟ ", "") == DialogResult.Yes)
     {
         JWeight tmpWeight = new JWeight();
         foreach (DataRow dr in jJanusGrid1.DefaultView.Rows)
         {
             tmpWeight.GetData(Convert.ToInt32(dr["Code"]));
             tmpWeight.verify = false;
             if (!(tmpWeight.Update()))
             {
                 JMessages.Error(" ویرایش با خطا مواجه شد ", "");
                 return;
             }
         }
         JMessages.Information(" ویرایش با موفقیت انجام شد ", "");
         btnSearch_Click(null, null);
     }
 }
Ejemplo n.º 2
0
        private void btnClear_Click(object sender, EventArgs e)
        {
            JWeight   tmpWeight = new JWeight();
            DataTable tmpdt;

            try
            {
                tmpdt = JWeights.GetLastDataTable();
                if ((tmpdt != null) && (tmpdt.Rows.Count > 0))
                {
                    tmpWeight.GetData(Convert.ToInt32(tmpdt.Rows[0]["Code"]));
                    if (tmpWeight.verify == true)
                    {
                        JMessages.Error(" این تورین تایید مالی شده و قابل تغییر نمی باشد ", "");
                        return;
                    }
                    tmpWeight.pay_h = Convert.ToInt32(txtPay.Text);
                    if (tmpWeight.Update())
                    {
                        JMessages.Information(" ویرایش با موفقیت انجام شد ", "");
                    }
                    else
                    {
                        JMessages.Error(" خطا در ویرایش ", "");
                    }
                }
                else
                {
                    JMessages.Error(" رکوردی با این کاربری پیدا نشد ", "");
                }
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
            }
        }