本文整理匯總了C#中ActionService.UpdateData方法的典型用法代碼示例。如果您正苦於以下問題:C# ActionService.UpdateData方法的具體用法?C# ActionService.UpdateData怎麽用?C# ActionService.UpdateData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ActionService
的用法示例。
在下文中一共展示了ActionService.UpdateData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ExportStopWorkingByTemplate
//.........這裏部分代碼省略.........
string status = string.Empty;
var contractServices = new Hre_WorkHistoryServices();
var actionService = new ActionService(UserLogin);
var objs = new List<object>();
string strIDs = string.Empty;
foreach (var item in selectedIds)
{
strIDs += Common.DotNetToOracle(item.ToString()) + ",";
}
if (strIDs.IndexOf(",") > 0)
strIDs = strIDs.Substring(0, strIDs.Length - 1);
objs.Add(strIDs);
var lstStopWorking = actionService.GetData<Hre_StopWorkingEntity>(objs, ConstantSql.hrm_hr_sp_get_StopWorkingByListId, ref status);
if (lstStopWorking == null)
return null;
int i = 0;
String suffix = DateStart.ToString("_ddMMyyyyHHmmss");
string folferPath = string.Empty;
string folderName = "ExportHre_StopWorking" + suffix;
if (lstStopWorking.Count > 1)
{
folferPath = dirpath + "/" + folderName;
Directory.CreateDirectory(folferPath);
}
else
{
folferPath = dirpath;
}
var fileDoc = string.Empty;
foreach (var stopWorking in lstStopWorking)
{
if (stopWorking.DateStop.HasValue)
{
stopWorking.DateStopFormat = stopWorking.DateStop.Value.ToString("dd/MM/yyyy");
}
if (stopWorking.DateQuit.HasValue)
stopWorking.DateQuitFormat = stopWorking.DateQuit.Value.ToString("dd/MM/yyyy");
if (stopWorking.RequestDate.HasValue)
stopWorking.RequestDateFormat = stopWorking.RequestDate.Value.ToString("dd/MM/yyyy");
stopWorking.RequestDate_Day = stopWorking.RequestDate.Value.Day.ToString();
stopWorking.RequestDate_Month = stopWorking.RequestDate.Value.Month.ToString();
stopWorking.RequestDate_Year = stopWorking.RequestDate.Value.Year.ToString();
ActionService service = new ActionService(UserLogin);
var exportService = new Cat_ExportServices();
Cat_ExportEntity template = null;
string outputPath = string.Empty;
List<object> lstObjExport = new List<object>();
lstObjExport.Add(null);
lstObjExport.Add(null);
lstObjExport.Add(null);
lstObjExport.Add(null);
lstObjExport.Add(1);
lstObjExport.Add(10000000);
if (!string.IsNullOrEmpty(valueFields))
{
template = actionService.GetData<Cat_ExportEntity>(Common.DotNetToOracle(valueFields), ConstantSql.hrm_cat_sp_get_ExportById, ref status).FirstOrDefault();
}
if (template == null)
{
messages = "Error";
return Json(messages, JsonRequestBehavior.AllowGet);
}
string templatepath = Common.GetPath(Common.TemplateURL + template.TemplateFile);
if (!System.IO.File.Exists(templatepath))
{
messages = "NotTemplate";
return Json(messages, JsonRequestBehavior.AllowGet);
}
outputPath = folferPath + "/" + Common.ChuyenTVKhongDau(stopWorking.ProfileName) + suffix + i.ToString() + "_" + template.TemplateFile;
fileDoc = NotificationType.Success.ToString() + "," + Common.DownloadURL + "/" + Common.ChuyenTVKhongDau(stopWorking.ProfileName) + suffix + i.ToString() + "_" + template.TemplateFile;
if (!System.IO.File.Exists(templatepath))
{
messages = "NotTemplate";
return Json(messages, JsonRequestBehavior.AllowGet);
}
var lststopworking = new List<Hre_StopWorkingEntity>();
lststopworking.Add(stopWorking);
ExportService.ExportWord(outputPath, templatepath, lststopworking);
}
List<object> lstNo = new List<object>();
lstNo.Add(strIDs);
if (lstStopWorking.Count > 1)
{
var fileZip = Common.MultiExport("", true, folderName);
var updateNoPrint1 = actionService.UpdateData<Hre_StopWorkingEntity>(lstNo, ConstantSql.hrm_hr_sp_set_UpdateNoPrint, ref status);
return Json(fileZip);
}
var updateNoPrint2 = actionService.UpdateData<Hre_StopWorkingEntity>(lstNo, ConstantSql.hrm_hr_sp_set_UpdateNoPrint, ref status);
return Json(fileDoc);
}