private void assignHV(List<decimal> ip_lst_id_lop, decimal ip_so_luong_hv) { decimal v_id_lop = ip_lst_id_lop[0]; var v_lst = GetSelectedRows(m_grv); for (int i = 0; i < v_lst.Count; i++) { US_GD_DIEM v_us = new US_GD_DIEM(); var v_data_row = m_grv.GetDataRow(v_lst[i]); v_us.dcID_LOP_MON = ip_lst_id_lop[(int)(i / ip_so_luong_hv)]; v_us.dcID_NHAN_VIEN = CIPConvert.ToDecimal(v_data_row[0].ToString()); v_us.strQUA_MON = "N"; v_us.strHOC_XONG_YN = "N"; v_us.strDA_XOA = "N"; v_us.datNGAY_LAP = DateTime.Now.Date; v_us.datNGAY_SUA = DateTime.Now.Date; updateNhanVienMonHoc(v_us.dcID_NHAN_VIEN); v_us.Insert(); } }
protected void m_grv_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomButtonCallbackEventArgs e) { var z = e.VisibleIndex.ToString(); DataRow v_datarow = m_grv.GetDataRow(Int16.Parse(z)); decimal id_lop_mon = CIPConvert.ToDecimal(v_datarow["ID"].ToString()); if (check_lop_mon_is_valid()) { decimal id_nhan_vien = CIPConvert.ToDecimal(Account.Person.ID_USER.ToString()); US_GD_DIEM v_us = new US_GD_DIEM(); v_us.dcID_LOP_MON = id_lop_mon; v_us.dcID_NHAN_VIEN = id_nhan_vien; v_us.strQUA_MON = "N"; v_us.strHOC_XONG_YN = "N"; v_us.strDA_XOA = "N"; v_us.datNGAY_LAP = DateTime.Now.Date; v_us.datNGAY_SUA = DateTime.Now.Date; v_us.Insert(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Thông báo", "alert('Đăng kí thành công!')", true); } }