Ejemplo n.º 1
0
        public string Remai(string detpmaketimeId, string stTime, string endTime)
        {
            string TheDay = time;

            Oos.Numeral.Model.xc_detpmaketime model = new Oos.Numeral.Bll.xc_detpmaketime().GetModel(detpmaketimeId);
            if (model != null)
            {
                if (model.Reserved2 < 0)
                {
                    return("无限制");
                }
                else
                {
                    if (TheDay != "")
                    {
                        DateTime statTime = DateTime.Parse(TheDay + " " + stTime);
                        DateTime EndTime  = DateTime.Parse(TheDay + " " + endTime);
                        string   num      = BllApp.GetXCYYApprovedCount(OrganId, "", AppProjectId, statTime, EndTime);

                        return((model.Reserved2 - int.Parse(num) <= 0) ? "0" : (model.Reserved2 - int.Parse(num) + "" + "个"));
                    }
                    else
                    {
                        return("0个");
                    }
                }
            }
            else
            {
                return("0个");
            }
        }
Ejemplo n.º 2
0
        private void ListData()
        {
            List <Oos.Numeral.Model.xc_detpmaketime> list = new Oos.Numeral.Bll.xc_detpmaketime().GetObjectIdList(AppProjectId, "2");

            if (list.Count == 0)
            {
                list = new Oos.Numeral.Bll.xc_detpmaketime().GetObjectIdList(OrganId, "1");
            }
            ListCount          = list.Count;
            rptDept.DataSource = list;
            rptDept.DataBind();
        }
Ejemplo n.º 3
0
        public string Validation(object[] obj)
        {
            string str = "";

            Oos.Numeral.Bll.xc_appproject          BllAppXc  = new Oos.Numeral.Bll.xc_appproject();
            Oos.Numeral.Bll.Numeral_Appointment    BllNumApp = new Oos.Numeral.Bll.Numeral_Appointment();
            List <Oos.Numeral.Model.xc_appproject> ListAppXc = BllAppXc.GetAppProjectIdList(obj[1].ToString());

            if (ListAppXc.Count > 0)
            {
                List <Oos.Numeral.Model.Numeral_Appointment> List = BllNumApp.getAppointmentTelAndCardXc(obj[3].ToString(), obj[4].ToString(), obj[0].ToString(), obj[1].ToString());
                if (List.Count >= ListAppXc[0].IDCradLimit && ListAppXc[0].IDCradLimit > 0)
                {
                    //   str = "当前个人个数已经超过设置限制,已存在预约记录,预约的日期:";
                    str = "当前预约人员存在已预约信息,预约日期:" + List[0].AppointmentStatTime.ToString("yyyy-MM-dd HH:mm:00") + ",请作废后再预约";
                }
                //else if (List.Count > 0)
                //{
                //    str = "预约的身份证或者手机号已经存在";
                //}
                Oos.Numeral.Model.xc_detpmaketime model = new Oos.Numeral.Bll.xc_detpmaketime().GetModel(GetQueryOrForms("XCDetpMakeTimeID"));
                string num = BllApp.GetXCYYApprovedCountPersonal(OrganId, "", obj[1].ToString(), DateTime.Parse(obj[5].ToString()), DateTime.Parse(obj[6].ToString()));
                if (model.Reserved2 >= 0)
                {
                    if (model.Reserved2 - int.Parse(num) <= 0)
                    {
                        str = "当前预约的个数已经超过设置限制";
                    }
                }
            }
            else
            {
                str = "未获取到配置的事项";
            }



            return(str);
        }
Ejemplo n.º 4
0
        public void selectDay(string years, string month, string DeptId, string AppProjectId)
        {
            string status = "0";
            string msg    = "";
            string data   = "[]";

            try
            {
                Oos.Numeral.Bll.xc_blackandwhitelist   bwBll             = new Oos.Numeral.Bll.xc_blackandwhitelist();
                Oos.Numeral.Bll.xc_weekscycle          wsBll             = new Oos.Numeral.Bll.xc_weekscycle();
                Oos.Numeral.Bll.Numeral_Appointment    appointmentBll    = new Oos.Numeral.Bll.Numeral_Appointment();
                Oos.Numeral.Bll.xc_detpmaketime        detpmaketimeBll   = new Oos.Numeral.Bll.xc_detpmaketime();
                Oos.Systems.Bll.Systems_WorkDayManager WorkDayManagerBll = new Oos.Systems.Bll.Systems_WorkDayManager();
                StringBuilder str = new StringBuilder();
                str.Append("[");
                int dayOf = int.Parse(DateTime.Parse(years + "-" + month + "-" + "01").DayOfWeek.ToString("d"));
                for (int i = 0; i < dayOf; i++)
                {
                    if (i == 0)
                    {
                        str.Append("{\"day\": \"\", \"type\": \"\",\"select\": \"\", \"num\": \"\", \"total\": \"\" }");
                    }
                    else
                    {
                        str.Append(",{\"day\": \"\", \"type\": \"\",\"select\": \"\", \"num\": \"\", \"total\": \"\" }");
                    }
                }
                int      MonthDay = DateTime.DaysInMonth(int.Parse(years), int.Parse(month));
                DateTime strTime  = DateTime.Parse(int.Parse(years) + "-" + int.Parse(month) + "-01" + " 00:00:00");
                DateTime endTime  = DateTime.Parse(int.Parse(years) + "-" + int.Parse(month) + "-01" + " 23:59:59").AddMonths(1).AddDays(-1);
                if (AppProjectId.Trim().Length == 0)
                {
                    for (int i = 1; i <= MonthDay; i++)
                    {
                        if (dayOf == 0 && i == 1)
                        {
                            str.Append("{\"day\": \"" + i + "\", \"type\": \"\",\"select\": \"\", \"num\": \"\", \"total\": \"\" }");
                        }
                        else
                        {
                            str.Append(",{\"day\": \"" + i + "\", \"type\": \"\",\"select\": \"\", \"num\": \"\", \"total\": \"\" }");
                        }
                    }
                }
                else
                {
                    List <Oos.Numeral.Model.xc_blackandwhitelist>   bwlist              = bwBll.GetTimeList(AppProjectId, DeptId, strTime, endTime);          //获取黑白名单
                    List <Oos.Numeral.Model.xc_weekscycle>          scyclelistW         = wsBll.GetList(AppProjectId, DeptId, 1);                             //获取周期周时间
                    List <Oos.Numeral.Model.xc_weekscycle>          scyclelistM         = wsBll.GetList(AppProjectId, DeptId, 2);                             //获取周期月时间
                    List <Oos.Numeral.Model.Numeral_Appointment>    Appointmentlist     = appointmentBll.getXCYYList(AppProjectId, DeptId, strTime, endTime); //获取预约情况
                    List <Oos.Numeral.Model.xc_detpmaketime>        DeptMaketimeList    = detpmaketimeBll.GetObjectIdList(AppProjectId, "2");                 //获取时间段的总数
                    List <Oos.Systems.Model.Systems_WorkDayManager> WorkDayManagerList1 = WorkDayManagerBll.GetOrganIdList(OrganId, 0);                       //放假日期
                    List <Oos.Systems.Model.Systems_WorkDayManager> WorkDayManagerList2 = WorkDayManagerBll.GetOrganIdList(OrganId, 1);                       //上班日期
                    if (DeptMaketimeList.Count == 0)
                    {
                        DeptMaketimeList = detpmaketimeBll.GetObjectIdList(OrganId, "1");
                    }
                    int total = sumtotal(DeptMaketimeList);
                    for (int i = 1; i <= MonthDay; i++)
                    {
                        DateTime time   = DateTime.Parse((int.Parse(years) + "-" + int.Parse(month) + "-" + i.ToString().PadLeft(2, '0')));
                        int      type   = 0; //是否可预约,0不可以,1可以
                        int      select = 0;

                        if (isMakeApp(bwlist, scyclelistW, scyclelistM, time, WorkDayManagerList1, WorkDayManagerList2))
                        {
                            type = 1;
                        }
                        if (time < DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")))
                        {
                            select = 1;
                        }

                        int num = SumNum(Appointmentlist, time);



                        if (dayOf == 0 && i == 1)
                        {
                            str.Append("{\"day\": \"" + i + "\", \"type\": \"" + type + "\", \"select\": \"" + select + "\", \"num\": \"" + num + "\" , \"total\": \"" + total + "\"  }");
                        }
                        else
                        {
                            str.Append(",{\"day\": \"" + i + "\", \"type\": \"" + type + "\", \"select\": \"" + select + "\", \"num\": \"" + num + "\" , \"total\": \"" + total + "\"  }");
                        }
                    }
                }

                for (int i = 0; i < 42 - dayOf - MonthDay; i++)
                {
                    str.Append(",{\"day\": \"\", \"type\": \"\", \"select\": \"\", \"num\": \"\", \"total\": \"\" }");
                }
                str.Append("]");
                status = "1";
                msg    = "执行成功";
                data   = str.ToString();
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }

            Response.Write("{\"status\": " + status + ",\"msg\":\"" + msg + "\",\"data\":" + data + "}");
            Response.End();
        }