Exemple #1
0
 public bool insert(ST_detail_employee_construction item)
 {
     try
     {
         db.ST_detail_employee_constructions.InsertOnSubmit(item);
         db.SubmitChanges( );
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
        private void btn_AddNew_Click(object sender, EventArgs e)
        {
            int[] selectedRowHandles = grdv_em.GetSelectedRows( );

            bool status = false;

            if (selectedRowHandles.Length > 0)
            {
                for (int i = 0; i < selectedRowHandles.Length; i++)
                {
                    object row = grdv_em.GetRow(i); //get a row, do something with it

                    var propertyName = row.GetType( ).GetProperty("employee_id").GetValue(row, null);
                    var pro          = (propertyName == null) ? "" : propertyName.ToString( );


                    if (idContructItemms != 0)
                    {
                        // them moi
                        ST_detail_employee_construction em = new ST_detail_employee_construction( );
                        em.employee_id          = Int64.Parse(pro.ToString( ));
                        em.construction_item_id = idContructItemms;

                        if (_detail.insert(em))
                        {
                            status = true;
                        }
                        else
                        {
                            status = false;
                        }
                    }
                }
                if (status)
                {
                    messeage.success("Thêm Mới Thành Công !");
                    this.Close( );
                }
                else
                {
                    messeage.error("Thêm Mới Thất Bại !");
                    this.Close( );
                }
            }
            else
            {
                messeage.error("Bạn chưa chọn dữ liệu !");
            }
        }
Exemple #3
0
 public bool insert(ST_detail_employee_construction item)
 {
     return(_em.insert(item));
 }