예제 #1
0
        private void ListData()
        {
            List <Oos.Numeral.Model.Numeral_Appointment> list = new Oos.Numeral.Bll.Numeral_Appointment().getXCYYList(AppProjectId, DeptId, DateTime.Parse(time + " " + GetQueryOrForms("Statime")), DateTime.Parse(time + " " + GetQueryOrForms("endTime"))); //获取预约情况

            rptDept.DataSource = list;
            rptDept.DataBind();
        }
예제 #2
0
        private void ListData()
        {
            List <Oos.Numeral.Model.Numeral_Appointment> list = new List <Oos.Numeral.Model.Numeral_Appointment>();

            if (type == "1")
            {
                list = new Oos.Numeral.Bll.Numeral_Appointment().getAppointmentIdvalXc(val, OrganId); //获取预约情况
            }
            else if (type == "2")
            {
                list = new Oos.Numeral.Bll.Numeral_Appointment().getAppointmentIdCardXc(IdCard, OrganId); //获取预约情况
            }
            rptDept.DataSource = list;
            rptDept.DataBind();
        }
예제 #3
0
        public string AddNumeralAt(string OrganId, string AppProjectId, string AppointmentDeptName, string AppointmentName, string AppointmentTel, string AppointmentCard, DateTime AppointmentStatTime, DateTime AppointmentEndTime, int AppointmentType, DateTime time)
        {
            //OrganId = "131|00000000000000000000000000000000";
            string results = "";

            // DateTime newTime = DateTime.Now;
            Oos.Numeral.Bll.AppProject          BAppProject          = new Oos.Numeral.Bll.AppProject();
            Oos.Numeral.Bll.Numeral_Appointment BNumeral_Appointment = new Oos.Numeral.Bll.Numeral_Appointment();

            List <Oos.Numeral.Model.AppProject> aptList = BAppProject.GetAppProjectCodeIDList(OrganId, AppProjectId);

            if (aptList != null & aptList.Count > 0)
            {
                Random ro = new Random();
                int    i  = ro.Next(100000, 1000000);
                while (BNumeral_Appointment.GetVER(i.ToString(), OrganId, DateTime.Now))
                {
                    i = ro.Next(100000, 1000000);
                }
                Oos.Numeral.Model.Numeral_Appointment model = new Oos.Numeral.Model.Numeral_Appointment();
                model.ID = System.Guid.NewGuid().ToString();
                model.AppointmentAppProject   = aptList[0].AppProjectName;
                model.AppointmentCard         = AppointmentCard;
                model.AppointmentDeptId       = aptList[0].AppObjectOrganCodeID;
                model.AppointmentDeptName     = AppointmentDeptName;
                model.AppointmentEndTime      = AppointmentEndTime;
                model.AppointmentName         = AppointmentName;
                model.AppointmentStatTime     = AppointmentStatTime;
                model.AppointmentTel          = AppointmentTel;
                model.AppointmentType         = AppointmentType;
                model.AppointmentVerification = i.ToString();
                model.CreateDate = time;
                model.IsTake     = 0;
                model.OrganId    = OrganId;
                model.Remark     = "";
                model.Reserved1  = "";
                model.Reserved2  = aptList[0].AppProjectCodeID;
                model.Reserved3  = "";
                model.Reserved4  = "";
                model.Reserved5  = "";
                model.IsApproved = 1;
                if (BNumeral_Appointment.Add(model))
                {
                    results = i.ToString();
                }
            }
            return(results);
        }
예제 #4
0
        public void undo()
        {
            string str = "0";

            Oos.Numeral.Bll.Numeral_Appointment   detTimeBll = new Oos.Numeral.Bll.Numeral_Appointment();
            Oos.Numeral.Model.Numeral_Appointment detModel   = detTimeBll.GetModel(GetQueryOrForms("KeyValue"));
            if (detModel != null)
            {
                detModel.IsTake = 2;
                if (detTimeBll.Update(detModel))
                {
                    str = "y";
                }
            }
            Response.Write(str);
            Response.End();
        }
예제 #5
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);
        }
예제 #6
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();
        }