Exemple #1
0
        private int Save()
        {
            JAutomobileDefine objAutoDefine = new JAutomobileDefine();

            {
                SetData(objAutoDefine);
                if (State == ClassLibrary.JFormState.Insert)
                {
                    Code = objAutoDefine.Insert();
                }
                else
                if (State == ClassLibrary.JFormState.Update)
                {
                    objAutoDefine.Update();
                }
                State = ClassLibrary.JFormState.Update;

                if (jArchiveListCar.ObjectCode == 0)
                {
                    jArchiveListCar.ObjectCode = Code;
                }
                jArchiveListCar.ArchiveList();
                return(Code);
            }
        }
Exemple #2
0
 public static string GetHtmlString(string id)
 {
     // here we can put some details as car is in own line (AVL.Controls.Map.Line.IsInTheLine).
     // Or geofence details with (AVL.Controls.Map.Line.IsInTheArea).
     AutomobileDefine.JAutomobileDefine a = new JAutomobileDefine();
     a.GetData(int.Parse(id));
     return(string.Format("<strong>{0}</strong>", a.Plaque));
 }
Exemple #3
0
        private void SetData(JAutomobileDefine Auto)
        {
            Auto.Code = Code;

            string str = txtPlak1.Text + cmbPlak.Text + txtPlak2.Text + "-" + txtPlak3.Text;

            Auto.Plaque   = str;
            Auto.Capacity = int.Parse(txtCapacity.Text);
            Auto.Model    = int.Parse(txtModel.Text);
            Auto.Type     = (int)cmbType.SelectedValue;
            Auto.Active   = chkActive.Checked;
            Auto.maker    = (int)cmbMakerCompany.SelectedValue;
        }
Exemple #4
0
        private void Load1(int pCode)
        {
            JAutomobileDefine Auto = new JAutomobileDefine();

            Auto.GetData(pCode);


            txtPlak1.Text = Auto.Plaque.Substring(0, 2);
            cmbPlak.Text  = Auto.Plaque.Substring(2, 1);
            txtPlak2.Text = Auto.Plaque.Substring(3, 3);
            txtPlak3.Text = Auto.Plaque.Substring(7, 2);
            cmbMakerCompany.SelectedValue = Auto.maker;
            txtCapacity.Text      = Auto.Capacity.ToString();
            txtModel.Text         = Auto.Model.ToString();
            cmbType.SelectedValue = Auto.Type;
            chkActive.Checked     = Auto.Active;

            jArchiveListCar.ObjectCode = pCode;
        }
Exemple #5
0
 public void Delete()
 {
     if (MessageBox.Show("آیا تمایل دارید مورد انتخاب شده حذف گردد", "اخطار!", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
     {
         JAutomobileDefine objAutoDefine = new JAutomobileDefine();
         objAutoDefine.Code = Code;
         if (objAutoDefine.Delete())
         {
             Close();
         }
         else
         {
             MessageBox.Show("پردازش با خطا مواجه شد");
         }
     }
     else
     {
         Close();
     }
 }
Exemple #6
0
        public int Insert()
        {
            JAutomobileTable AT = new JAutomobileTable();

            AT.SetValueProperty(this);


            /*
             * AVL Project
             */
            if (AVL.Tools.IsAvlProject())
            {
                JAutomobileDefine au = new JAutomobileDefine();
                au.GetData(this.Plaque);
                if (au.Code < 1)
                {
                    Code = AT.Insert();
                    if (Code > 0)
                    {
                        InsertAVLObjecList();

                        return(Code);
                    }
                }
                else
                {
                    return(-1);
                }
            }
            /*		 */

            if (Find(Plaque))
            {
                Code = AT.Insert();
                return(Code);
            }
            return(0);
        }