# ENTER CHI TIẾT

## 1. Proc enter chi tiết

* Trường hợp, không đặt được enter chi tiết, thì viết lệnh proc để enter
* proc lấy điều kiện + enter ra 1 báo cáo chi tiết

```csharp
public void DMain(DataRow drDuLieuBaoCao, int rowindex, int columnindex, _DataGridView dtgDLReport, FOR0025 formBaoCao)
	{
		try
		{
			string wherethem = "", dkreport = "";
			DataView dvrp = dtgDLReport.DataSource as DataView;
			if(dvrp == null || dvrp.Count == 0)
				return;

			#region: Lấy báo cáo enter và điều kiện enter
			DataRow drReport = formBaoCao.txtReport.CurrentRow;
			wherethem = drReport["DieuKienEnterBC"].ToString();
			int ReportEnter = 0;
			ReportEnter = Convert.ToInt32(drReport["reportEnter"].ToString());
			#endregion: Lấy báo cáo enter và điều kiện enter
			dkreport = formBaoCao.CreateWhereCondition(true);
			//_Func.TextEditer("1:"+wherethem);
			if(!string.IsNullOrWhiteSpace(wherethem))
			{
				wherethem = _Func.FormatStringValue(wherethem, drDuLieuBaoCao, true);
				if(!string.IsNullOrWhiteSpace(dkreport))
					dkreport += " and ("+ wherethem+")";
			}
			//_Func.TextEditer("2:"+wherethem);
			if(dtgDLReport.gridView1.Columns[columnindex].Name.Contains("thang_"))
			{
				dkreport +=  (!string.IsNullOrWhiteSpace(dkreport)?" and ": "") + (string.IsNullOrWhiteSpace(dkreport)?"": " month(vr.ngay)="+ dtgDLReport.gridView1.Columns[columnindex].Name.ToString().Split('_')[1].ToString()+" and year(vr.ngay)=" + dtgDLReport.gridView1.Columns[columnindex].Name.ToString().Split('_')[2].ToString());
				wherethem +=  (!string.IsNullOrWhiteSpace(wherethem)?" and ": "") + (string.IsNullOrWhiteSpace(dkreport)?"": " month(vr.ngay)="+ dtgDLReport.gridView1.Columns[columnindex].Name.ToString().Split('_')[1].ToString()+" and year(vr.ngay)=" + dtgDLReport.gridView1.Columns[columnindex].Name.ToString().Split('_')[2].ToString());
			}
			//_Func.TextEditer("3:"+wherethem);
			if(!formBaoCao.cheKhongHien.Checked)
				_Func.TextEditer(wherethem);
			if(ReportEnter>0)//chi tiêt ra báo cáo
			{
				dynamic fbc = formBaoCao.OpenForm("FOR0026");
				fbc.dkEnterChiTiet = dkreport;
				if(!formBaoCao.cheKhongHien.Checked)
					_Func.TextEditer(fbc.dkEnterChiTiet);
				((dynamic)fbc).LoadReportAll(formBaoCao, false, ReportEnter, wherethem);
				fbc.form25 = formBaoCao;
				fbc.Text = "[BC enter] "+ _Func.DBEXEC("select " + _Vari.Language +" from report where report="+ReportEnter, true).ToString();
				fbc.ShowDialog();
			}
		}
		catch(Exception ex)
		{
			MessageBox.Show(ex.Message);
		}
	}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kythuat.dtechvn.com/bao-cao/enter-chi-tiet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
