Exemplo n.º 1
0
        /// <summary>
        /// 批量提交工时表
        /// </summary>
        void SubmitManySheet(HttpContext context)
        {
            bool result = false;
            int  temp   = 0;

            if (!string.IsNullOrEmpty(context.Request.QueryString["Array"]))
            {
                var arr = new Tools.Serialize().DeserializeJson <string[]>(context.Request.QueryString["Array"]);
                if (arr != null && arr.Length > 0)
                {
                    var bll = new BLL.WorkEntryBLL();
                    foreach (var thisArr in arr)
                    {
                        var thisSub = thisArr.Split('_');
                        if (thisSub.Length == 2)
                        {
                            if (!bll.SubmitWorkEntry(DateTime.Parse(thisSub[1]), long.Parse(thisSub[0]), LoginUserId))
                            {
                                temp++;
                            }
                        }
                    }
                }
            }
            if (temp == 0)
            {
                result = true;
            }
            WriteResponseJson(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取工时表信息
        /// </summary>
        /// <param name="context"></param>
        private void GetTimesheetInfo(HttpContext context)
        {
            long id       = long.Parse(context.Request.QueryString["id"]);
            var  weReport = new BLL.WorkEntryBLL().GetWorkEntryReportById(id);

            object[] data = new object[] { weReport.resource_id, weReport.start_date.Value.ToString("yyyy-MM-dd"), weReport.id };
            context.Response.Write(new Tools.Serialize().SerializeJson(data));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 提交工时表
        /// </summary>
        /// <param name="context"></param>
        private void SubmitTimesheet(HttpContext context)
        {
            DateTime start = DateTime.Parse(context.Request.QueryString["startDate"]);
            long     resId = long.Parse(context.Request.QueryString["resId"]);
            var      bll   = new BLL.WorkEntryBLL();

            context.Response.Write(new Tools.Serialize().SerializeJson(bll.SubmitWorkEntry(start, resId, LoginUserId)));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取工时类型
        /// </summary>
        /// <param name="context"></param>
        private void GetWorkEntryType(HttpContext context)
        {
            long batchId = long.Parse(context.Request.QueryString["id"]);
            long id      = 0;
            int  type;
            bool rtn = new BLL.WorkEntryBLL().GetWorkEntryType(batchId, out type, out id);

            object[] data = new object[] { rtn, type, id };
            context.Response.Write(new Tools.Serialize().SerializeJson(data));
        }