当前位置: 首页>>代码示例>>C#>>正文


C# ActionService.UpdateData方法代码示例

本文整理汇总了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);
        }
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_GetDataController.cs


注:本文中的ActionService.UpdateData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。