Ejemplo n.º 1
0
        public async Task <ActionResult <Takes> > PostTakes(Takes takes)
        {
            _context.Takes.Add(takes);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTakes", new { id = takes.TakeId }, takes));
        }
Ejemplo n.º 2
0
    Take ImportTake(XmlElement parent, Takes takes, MediaType mediaType)
    {
        String mediaKey = ChildString(parent, "MediaRef");
        Media  media    = FindMedia(myVegas.Project.MediaPool, mediaKey);

        if (null == media)
        {
            return(null);
        }
        Int32       streamIndex = ChildInt32(parent, "StreamIndex");
        MediaStream stream      = media.Streams.GetItemByMediaType(mediaType, streamIndex);

        if (null == stream)
        {
            throw new ApplicationException("bad index for take media stream: " + mediaKey);
        }
        Take take = new Take(stream);

        takes.Add(take);
        try { take.Name = ChildString(parent, "Name"); } catch {}
        try { take.Offset = ChildTimecode(parent, "Offset"); } catch {}
        Boolean isActive = false;

        try { isActive = ChildBoolean(parent, "IsActive"); } catch {}
        if (isActive)
        {
            return(take);
        }
        else
        {
            return(null);
        }
    }
Ejemplo n.º 3
0
        public async Task <IActionResult> PutTakes(int id, Takes takes)
        {
            if (id != takes.TakeId)
            {
                return(BadRequest());
            }

            _context.Entry(takes).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TakesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 4
0
 //להצגת רכב מרשימת השכרות
 public frmTakeForLong(int br, int TakeCode, string searchUpdate)
 {
     InitializeComponent();
     Suport.FillCombox(cmbCity, ct.GetTable(), "nameCity", "coudeCity");
     Suport.FillCombox(cmbLicenseKind, curentL.GetTable(), "nameLicense", "coudeLicense");
     bra            = br;//סניף
     curentBranch   = new Branch(br);
     txtBranch.Text = Convert.ToString(curentBranch.BranchName);
     curentTake     = new Takes(TakeCode);
     //מילוי נתונים לפי הת.ז שבהשכרה
     curentClient = new Client(curentTake.IDclient);
     FillTxtClient();
     //מילוי פרטי רכב
     st = curentTake.NumCar;
     FillTXT();
     btnUpdate.Visible = true;
     if (searchUpdate == "search")
     {
         this.Enabled = false;
     }
     else
     {
         btnCar.Enabled = true;
         grpCar.Enabled = false;
     }
     //קוד השכרה
     this.takeCode = TakeCode;
 }
Ejemplo n.º 5
0
        public bool AddClassToStudent(string courseId, int studentId)
        {
            var studentTakes = new Takes();

            try
            {
                studentTakes.Student_Id = studentId;
                studentTakes.Course_Id  = courseId;

                var studentCourses = _dbQueries.GetStudentCourses(studentId);


                var query = from student in _dbQueries.GetStudentCourses(studentId)
                            where student.Course_Id == courseId
                            select student;

                var studentData = query.FirstOrDefault <Takes>();

                if (studentData == null)
                {
                    _dbQueries.AddedClassToStudent(studentTakes);
                }

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(false);
            }
        }
Ejemplo n.º 6
0
    void ExportTakes(XmlElement parent, Takes takes)
    {
        XmlElement elt = AddChild(parent, "Takes");

        elt.SetAttribute("Count", takes.Count.ToString(myNumberFormat));
        foreach (Take take in takes)
        {
            ExportTake(elt, take);
        }
    }
Ejemplo n.º 7
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int num = Convert.ToInt32(dgvTakes.SelectedRows[0].Cells[0].Value);

            curentTake       = new Takes(num);
            txtCodeTake.Text = curentTake.NumTakes.ToString();
            txtCarNum.Text   = curentTake.NumCar;
            txtId.Text       = curentTake.IDclient;
            dtpFrom.Text     = curentTake.DateTake;
            dtpTo.Text       = curentTake.DateReturn;
        }
Ejemplo n.º 8
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         curentTake = new Takes(takeCode);
     }
     catch
     {
         MessageBox.Show("לא נמצאו שדות מתאימים");
     }
     FillTakeClass();
     curentTakeTable.UpdateToAccess(curentTake);
 }
Ejemplo n.º 9
0
        public int SaveTakes(Takes takes)
        {
            query   = "INSERT INTO Takes(student_id, course_id, enroll_date) VALUES(@student_id, @course_id, @enroll_date)";
            command = new SqlCommand(query, connection);
            command.Parameters.Clear();
            command.Parameters.AddWithValue("student_id", takes.StudentId);
            command.Parameters.AddWithValue("course_id", takes.CourseId);
            command.Parameters.AddWithValue("enroll_date", takes.EnrollDate);
            connection.Open();
            int rowAffected = command.ExecuteNonQuery();

            connection.Close();
            return(rowAffected);
        }
Ejemplo n.º 10
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            Takes takes = new Takes();

            takes.StudentId  = Convert.ToInt32(rollComboBox.SelectedValue);
            takes.CourseId   = courseComboBox.SelectedValue.ToString();
            takes.EnrollDate = enrollDateTimePicker.Value;

            string message = takesManager.SaveTakes(takes);

            MessageBox.Show(message);

            PopulateTakesCourseListView(takesManager.GetFromTakes());
        }
Ejemplo n.º 11
0
        public string SaveTakes(Takes takes)
        {
            /*if (studentGateway.DoesRollExist(student.RollNo, 0))
             * {
             *  return "Roll No. already exists!";
             * }*/
            int rowAffected = takesGateway.SaveTakes(takes);

            if (rowAffected > 0)
            {
                return("Data inserted successfully.");
            }
            return("Insertion failed!");
        }
Ejemplo n.º 12
0
        private void btnCode_Click(object sender, EventArgs e)
        {
            try
            {
                curentTake       = new Takes(Convert.ToInt32(txtCpde.Text));
                txtCodeTake.Text = curentTake.NumTakes.ToString();
                txtCarNum.Text   = curentTake.NumCar;
                txtId.Text       = curentTake.IDclient;
                dtpFrom.Value    = Convert.ToDateTime(curentTake.DateTake);
                dtpTo.Value      = Convert.ToDateTime(curentTake.DateReturn);

                FillTXT();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "לא נמצאו פרטים תואמים נסו שוב / נסו באמצעות הקשת ת.ז של הלקוח המבוקש");
            }
        }
Ejemplo n.º 13
0
    Take ImportTakes(XmlElement parent, Takes takes, MediaType mediaType)
    {
        XmlElement elt = parent["Takes"];

        if (null == elt)
        {
            return(null);
        }
        Take activeTake = null;

        foreach (XmlElement child in elt)
        {
            Take take = ImportTake(child, takes, mediaType);
            if (null != take)
            {
                activeTake = take;
            }
        }
        return(activeTake);
    }
Ejemplo n.º 14
0
        private void borrowButton_Click(object sender, EventArgs e)
        {
            int length = listView1.CheckedItems.Count;

            if (length > 3)
            {
                MessageBox.Show("SORRY, YOU CAN NOT GET MORE THAN 3 BOOKS AT A TIME.");
            }
            else if (length == 0)
            {
                MessageBox.Show("PLEASE, CHECK AT LEAST A BOOK.");
            }
            else
            {
                db.updateLibraryCard(ID, length);
                Takes[] t = new Takes[10];
                for (int i = 0; i < 10; i++)
                {
                    t[i] = new Takes();
                }
                //ListView.CheckedListViewItemCollection checkedItems = listView1.CheckedItems;
                //MessageBox.Show(listView1.CheckedItems[1].SubItems[1].Text);
                for (int i = 0; i < length; i++)
                {
                    t[i].book_ID    = Convert.ToInt32(listView1.CheckedItems[i].SubItems[0].Text);
                    t[i].ID         = Convert.ToInt32(ID);
                    t[i].date_taken = DateTime.Now.ToString("dd.MM.yy");
                    t[i].last_date  = DateTime.Now.AddDays(db.getDeadlineOfBook(t[i].book_ID)).ToString("dd.MM.yy");
                }
                if (db.borrowBook(t, length))
                {
                    MessageBox.Show("Borrowed Successful.");
                }
                else
                {
                    MessageBox.Show("You already have one of the selected books, Please, check again.");
                }
            }
        }
Ejemplo n.º 15
0
        public string IsExistOrInsert(Takes takes)
        {
            string exist = "";

            try
            {
                commadString = "SELECT * FROM Takes WHERE ID ='" + takes.ID + "' AND course_id ='" + takes.Course_id + "' AND sec_id ='" + takes.sec_id + "' AND semester = '" + takes.Semester + "' AND year =" + takes.Year + "";
                sqlCommand   = new SqlCommand(commadString, sqlConnection);

                sqlConnection.Open();
                sqlDataAdapter = new SqlDataAdapter(sqlCommand);
                dataTable      = new DataTable();
                sqlDataAdapter.Fill(dataTable);

                if (dataTable.Rows.Count > 0)
                {
                    exist = "Data  is exist \n Please check duplicated data";
                }
                sqlConnection.Close();

                if (String.IsNullOrEmpty(exist))
                {
                    commadString = "INSERT INTO Takes VALUES('" + takes.ID + "','" + takes.Course_id + "','" + takes.sec_id + "','" + takes.Semester + "'," + takes.Year + ",'" + takes.Grade + "')";
                    // commadString = "INSERT INTO Takes VALUES('"+takes.ID+"','"+takes.Course_id+"','"+takes.sec_id + "','"+takes.Semester+"',"+takes.Year+",'"+takes.Grade+"')";
                    sqlCommand = new SqlCommand(commadString, sqlConnection);

                    sqlConnection.Open();

                    sqlCommand.ExecuteNonQuery();

                    sqlConnection.Close();
                }
            }
            catch (Exception exception)
            {
            }

            return(exist);
        }
Ejemplo n.º 16
0
        private void btnok_Click(object sender, EventArgs e)
        {
            try {
                curentTake = new Takes(Convert.ToInt32(txtnumTake.Text));
                Car curentCar = new Car(curentTake.NumCar);
                curentCar.Finds = false;
                CarTable curentCarTable = new CarTable();
                curentCarTable.UpdateToAccess(curentCar);
                MessageBox.Show("תודה שהשכרתם באלבר");
                //עדכון שהחניה פנויה
                curentParking             = new ParkingInBranch(curentCar.CoudeParking);
                curentParking.Fullparking = false;
                curentParkingTable.UpdateToAccess(curentParking);
            }
            catch
            {
                MessageBox.Show("לא נמצא לקוח במאגר וודא שהקלדת נכון את ת.ז");
            }
            frmReportTakeCar f1 = new frmReportTakeCar(curentTake.NumTakes);

            f1.Show();
            this.Close();
        }
Ejemplo n.º 17
0
 public string IsExistOrInsert(Takes takes)
 {
     return(takesRepository.IsExistOrInsert(takes));
 }
Ejemplo n.º 18
0
 public void AddedClassToStudent(Takes model)
 {
     _dbContext.Add(model);
     _dbContext.SaveChanges();
 }
Ejemplo n.º 19
0
 public InWorldCraftingRecipe Clone()
 {
     return(new InWorldCraftingRecipe(Mode, VariantGroups, Takes.Clone(), Tool.Clone(), Returns.DeepClone(), Makes.DeepClone(), CraftSound, IsTool, Disabled, Remove, MakeTime));
 }
Ejemplo n.º 20
0
 public TakesUi()
 {
     InitializeComponent();
     takes        = new Takes();
     takesManager = new TakesManager();
 }
Ejemplo n.º 21
0
 public static int?insert(Takes takes)
 {
     return(takes.id != null?Global.db.Saveable(takes).ExecuteCommand() : Global.db.Insertable(takes).ExecuteCommand());
 }
Ejemplo n.º 22
0
 public static int?update(Takes takes)
 {
     return(Global.db.Updateable(takes).ExecuteCommand());
 }