แก้ไข op 324,3247,3248

This commit is contained in:
Nakorn Rientrakrunchai
2020-08-23 16:36:26 +07:00
parent 3d72f494eb
commit 9244531bb0
8 changed files with 42 additions and 10 deletions

View File

@@ -103,6 +103,12 @@ namespace TodoAPI2.Controllers
string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username");
string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password");
var p = (from i in _repository.GetContext().eva_adjust_postponement
where i.id == model.round_id
select i).FirstOrDefault();
model.date_text = MyHelper.GetDateStringForReport(p.theDate);
model.command_no = p.command_no;
string url = $"{mainurl}{reportsite}/rep_eva01.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}";
var data = httpclient.DownloadData(url);

View File

@@ -354,19 +354,37 @@ namespace TodoAPI2.Models
return result;
}
//public List<external_linkageViewModel> GetEvaRound()
//{
// var sql = string.Format("select distinct eva_performance_plan.id,eva_performance_plan.{0}theTime{0} , eva_performance_plan.fiscal_year from eva_performance_plan order by eva_performance_plan.fiscal_year,eva_performance_plan.{0}theTime{0}", '"'.ToString());
// var para = db.GetParameterListNpgsql();
// DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
// var result = new List<external_linkageViewModel>();
// foreach (DataRow dr in dt.Rows)
// {
// var i = new external_linkageViewModel();
// i.external_id = Convert.ToInt32(dr["theTime"]);
// i.id_guid = Guid.Parse(dr["id"].ToString());
// i.external_code = dr["theTime"].ToString();
// i.external_name = dr["theTime"].ToString() + "/" + dr["fiscal_year"].ToString();
// result.Add(i);
// }
// return result;
//}
public List<external_linkageViewModel> GetEvaRound()
{
var sql = string.Format("select distinct eva_performance_plan.id,eva_performance_plan.{0}theTime{0} , eva_performance_plan.fiscal_year from eva_performance_plan order by eva_performance_plan.fiscal_year,eva_performance_plan.{0}theTime{0}", '"'.ToString());
var sql = string.Format("select id,fiscal_year,{0}theRound{0} from eva_adjust_postponement where create_evaluation_id is null order by fiscal_year,{0}theRound{0}", '"'.ToString());
var para = db.GetParameterListNpgsql();
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
var result = new List<external_linkageViewModel>();
foreach (DataRow dr in dt.Rows)
{
var i = new external_linkageViewModel();
i.external_id = Convert.ToInt32(dr["theTime"]);
i.id_guid = Guid.Parse(dr["id"].ToString());
i.external_code = dr["theTime"].ToString();
i.external_name = dr["theTime"].ToString() + "/" + dr["fiscal_year"].ToString();
i.external_id = Convert.ToInt32(dr["id"]);
//i.id_guid = Guid.Parse(dr["id"].ToString());
i.external_code = dr["theRound"].ToString();
i.external_name = dr["theRound"].ToString() + "/" + dr["fiscal_year"].ToString();
result.Add(i);
}
return result;

View File

@@ -15,7 +15,7 @@ namespace TodoAPI2.Models
rep_eva01WithSelectionViewModel GetWithSelection(Guid id);
rep_eva01WithSelectionViewModel GetBlankItem();
DataContext GetContext();
}
}

View File

@@ -16,8 +16,11 @@ namespace TodoAPI2.Models
public string org_id { get; set; }
public Guid? round_id { get; set; }
public int? round_id { get; set; }
public string round_text { get; set; }
public string command_no { get; set; }
public string date_text { get; set; }
}
}

View File

@@ -73,6 +73,11 @@ namespace TodoAPI2.Models
return i;
}
public DataContext GetContext()
{
return _repository.Context;
}
#endregion
#endregion

View File

@@ -16,7 +16,7 @@ namespace TodoAPI2.Models
public int? org_id { get; set; }
public Guid? round_id { get; set; }
public int? round_id { get; set; }
public string round_text { get; set; }
}

View File

@@ -26,7 +26,7 @@ function rep_eva01_GetSearchParameter(fileType) {
function rep_eva01_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithDataOrg($("#s_rep_eva01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva01_round_id"), data, "id_guid", "external_name", "item_round_id", data.id_guid);
DropDownClearFormAndFeedWithData($("#s_rep_eva01_round_id"), data, "id", "external_name", "item_round_id", data.id_guid);
}
function DropDownClearFormAndFeedWithDataOrg(d, result, x, y, z, i) {

View File

@@ -26,7 +26,7 @@ function rep_eva02_GetSearchParameter(fileType) {
function rep_eva02_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithDataOrg($("#s_rep_eva02_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva02_round_id"), data, "id_guid", "external_name", "item_round_id", data.round_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva02_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
}
function DropDownClearFormAndFeedWithDataOrg(d, result, x, y, z, i) {