コード例 #1
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int ID = GetNumber <int>("i");

        if (ID > 0)
        {
            DataSet ds = MSDB.GetDataSet("ConnUser", "dbo.usp_OrgM_xGetOrgDetailByID"
                                         , new Dictionary <string, object>()
            {
                { "@OrgID", ID }
            });

            OrgManagementVM     VM   = new OrgManagementVM();
            List <OrgAllowIPVM> list = new List <OrgAllowIPVM>();
            WayneEntity.EntityS.FillModel(VM, ds.Tables[0]);
            WayneEntity.EntityS.FillModel(list, ds.Tables[1]);
            VM.OrgAllowIPList = list;

            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int pgNow      = GetNumber <int>("pgNow");
        int pgSize     = GetNumber <int>("pgSize");
        int RoleCateID = GetNumber <int>("rc");

        DataSet ds = MSDB.GetDataSet("ConnUser", "dbo.usp_PowerM_xGetRoleListByRoleCateID"
                                     , new Dictionary <string, object>()
        {
            { "@RoleCateID", RoleCateID },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });

        List <RolePowerSettingVM> list = new List <RolePowerSettingVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #3
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);

        if (Request.HttpMethod.Equals("POST"))
        {
            ID = GetNumber <int>("i");

            if (ID == 0)
            {
                string script = "<style>body{display:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>";
                Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
                return;
            }



            DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_DocumentM_xGetDocByID"
                                         , new Dictionary <string, object>()
            {
                { "@DocumentInfoID", ID }
            });

            EntityS.FillModel(VM, ds.Tables[0]);
            EntityS.FillModel(fileList, ds.Tables[1]);
            VM.FileList = fileList;
            FileList    = JsonConvert.SerializeObject(VM.FileList);
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        int pgNow  = GetNumber <int>("pgNow");
        int pgSize = GetNumber <int>("pgSize");

        int OrgID = GetNumber <int>("i");

        DataSet ds = MSDB.GetDataSet("ConnUser", "dbo.usp_CodeM_xGetOrgChangeLogListByID"
                                     , new Dictionary <string, object>()
        {
            { "@OrgID", OrgID }
        });

        List <MedicalCodeVM> list = new List <MedicalCodeVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //string sss = QueryStringEncryptToolS.EncryptQueryString("1q2w3e4r", "t00","hyweb");
        //Response.Write(sss);
        //sss = QueryStringEncryptToolS.DecryptQueryString(HttpUtility.UrlDecode(sss), "t00", "hyweb");
        //Response.Write("<br/>");
        //Response.Write(sss);
        //Response.End();

        base.AllowHttpMethod("POST");
        base.DisableTop(false);

        string DocTitle = GetString("d");

        PublishStateEnum publishState;

        Enum.TryParse(GetString("p"), out publishState);

        int pgNow  = GetNumber <int>("pgNow");
        int pgSize = GetNumber <int>("pgSize");

        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_DocumentM_xGetDocList"
                                     , new Dictionary <string, object>()
        {
            { "@DocTitle", DocTitle },
            { "@PublishState", publishState },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });


        List <DocumentInfoVM> InfoList = new List <DocumentInfoVM>();
        //List<DocumentFileInfoVM> fileList = new List<DocumentFileInfoVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(InfoList, ds.Tables[0]);
        //EntityS.FillModel(fileList, ds.Tables[1]);
        EntityS.FillModel(rtn, ds.Tables[1]);

        //foreach(var infoItem in InfoList)
        //{

        //    IEnumerable<DocumentFileInfoVM> files = fileList.Where(item => item.DocumentInfoID == infoItem.ID);

        //    //var info = InfoList.Find(item => item.ID == infoItem.ID);
        //    //info.FileList.AddRange(files);
        //    infoItem.FileList.AddRange(files);

        //}


        rtn.message = InfoList;
        //rtn.pgNow = pgNow;
        //rtn.pgSize = pgSize;
        //rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #6
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        int pgNow      = GetNumber <int>("pgNow");
        int pgSize     = GetNumber <int>("pgSize");
        int CaseUserID = GetNumber <int>("i");

        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_CertificateM_xGetApplyDataList"
                                     , new Dictionary <string, object>()
        {
            { "@CaseUserID", CaseUserID },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });

        List <ApplyDataRecordVM>     list     = new List <ApplyDataRecordVM>();
        List <ApplyDataRecordFileVM> FileList = new List <ApplyDataRecordFileVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);
        EntityS.FillModel(FileList, ds.Tables[2]);

        rtn.message  = list;
        rtn.message2 = FileList;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);


        string DocTitle = GetString("i");

        PublishStateEnum publishState;

        Enum.TryParse(GetString("p"), out publishState);

        int pgNow  = GetNumber <int>("pgNow");
        int pgSize = GetNumber <int>("pgSize");


        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_DocumentM_xGetDocViewList"
                                     , new Dictionary <string, object>()
        {
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });

        List <DocumentInfoVM> list = new List <DocumentInfoVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);

        rtn.message          = list;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");


        int pgNow  = GetNumber <int>("pgNow");
        int pgSize = GetNumber <int>("pgSize");

        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_CodeM_xGetEnabledSystemCodeCateList"
                                     , new Dictionary <string, object>()
        {
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });

        List <SystemCodeCateVM> list = new List <SystemCodeCateVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #9
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        ElementaryRecordID = GetNumber <int>("i");

        if (ElementaryRecordID == 0)
        {
            IsValid = false;
            string script = "<style>body{display:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }


        user = AuthServer.GetLoginUser();
        if (this.IsPostBack == false)
        {
            DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_RecordM_xGetElementaryRecordByID"
                                         , new Dictionary <string, object>()
            {
                { "@ElementaryRecordID", ElementaryRecordID }
            });

            ElementaryRecordVM VM = new ElementaryRecordVM();
            EntityS.FillModel(VM, ds.Tables[0]);
            List <ElementaryRecordDataVM> list = new List <ElementaryRecordDataVM>();
            EntityS.FillModel(list, ds.Tables[1]);

            for (int i = VM.AdmissionYear; i <= DateTime.Now.Year - 1911; i++)
            {
                ddlYear.Items.Add(new ListItem(i.ToString() + "年", i.ToString()));
            }


            var dict = SystemCode.GetDict("RecordM_StudentRecord_VaccineCate");
            if (dict.Count > 0)
            {
                tbAry = JsonConvert.SerializeObject(dict);
            }
            if (list.Count > 0)
            {
                tbAry2 = JsonConvert.SerializeObject(list);
            }

            ddlST.SelectedValue = VM.StudentYear.ToString();

            var slist = SystemElementarySchool.list.Where(item => item.OrgID == user.OrgID);
            ddlSchool.Items.Add(new ListItem("請選擇學校名稱", "0"));
            foreach (var item in slist)
            {
                ddlSchool.Items.Add(new ListItem(item.SchoolName, item.ElementarySchoolID.ToString()));
            }

            ddlSchool.SelectedValue = VM.ElementarySchoolID.ToString();
        }
    }
コード例 #10
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        string AccountOrName = GetString("an");
        string OrgName       = GetString("on");
        int    CheckState    = GetNumber <int>("cs");
        int    pgNow         = GetNumber <int>("pgNow");
        int    pgSize        = GetNumber <int>("pgSize");

        DataSet ds = MSDB.GetDataSet("ConnUser", "dbo.usp_AccountM_xGetUserListByMany"
                                     , new Dictionary <string, object>()
        {
            { "@AccountOrName", AccountOrName },
            { "@OrgName", OrgName },
            { "@CheckState", CheckState },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize },
        });

        List <UserInfoVM> list = new List <UserInfoVM>();
        PageVM            rtn  = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);

        var    IDs       = list.Select(item => item.ID);
        string IDsString = string.Join(",", IDs);

        DataTable dt = MSDB.GetDataTable("ConnUser", "dbo.usp_AccountM_xGetUserRolesByIDs"
                                         , new Dictionary <string, object>()
        {
            { "@IDs", IDsString.Length == 0 ? "0" : IDsString }
        });

        List <UserRoleVM> VMs = new List <UserRoleVM>();

        EntityS.FillModel(VMs, dt);

        foreach (var item in list)
        {
            foreach (var VM in VMs)
            {
                if (item.ID == VM.UserID)
                {
                    item.RoleIdList.Add(VM.RoleID);
                }
            }
        }

        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #11
0
ファイル: PageCL.cs プロジェクト: peter7788yes/NIIS2
    public string GetList <T>(List <T> list, string Conn, string SQL, Dictionary <string, object> dict)
    {
        DataSet ds = MSDB.GetDataSet(Conn, SQL
                                     , dict);
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);
        if (list.Count > 0)
        {
            rtn.message = list;
        }
        else
        {
            rtn.message = new List <string>();
        }

        return(JsonConvert.SerializeObject(rtn));
    }
コード例 #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        int pgNow  = GetNumber <int>("pgNow");
        int pgSize = GetNumber <int>("pgSize");

        int    OrgID         = GetNumber <int>("oid");
        int    SchoolCounty  = GetNumber <int>("sc");
        int    SchoolTown    = GetNumber <int>("st");
        int    SchoolVillage = GetNumber <int>("sv");
        int    EnableState   = GetNumber <int>("es");
        string SchoolName    = GetString("sn");


        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_CodeM_xGetSchoolListByMany"
                                     , new Dictionary <string, object>()
        {
            { "@OrgID", OrgID },
            { "@SchoolCounty", SchoolCounty },
            { "@SchoolTown", SchoolTown },
            { "@SchoolVillage", SchoolVillage },
            { "@EnableState", EnableState },
            { "@SchoolName", SchoolName },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize }
        });

        List <SchoolCodeVM> list = new List <SchoolCodeVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(rtn, ds.Tables[1]);
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(rtn));
        Response.End();
    }
コード例 #13
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);

        CaseUserID = GetNumber <int>("i");

        if (CaseUserID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_RecordM_xGetCaseUserByID"
                                     , new Dictionary <string, object>()
        {
            { "@CaseUserID", CaseUserID }
        });

        VM = new CaseUserVM();
        EntityS.FillModel(VM, ds.Tables[0]);
        uJson = JsonConvert.SerializeObject(VM);
    }
コード例 #14
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        //if (UpdatePower.HasPower)
        //{
        //    form1.DefaultButton = "btnSave";
        //}

        ID         = GetNumber <int>("i");
        ContractID = GetNumber <int>("i2");

        if (ID == 0)
        {
            IsValid = false;
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        if (UpdatePower.HasPower == false)
        {
            tbAddress.Enabled  = false;
            tbTel.Enabled      = false;
            tbVaccine.Enabled  = false;
            ddlAgState.Enabled = false;
            //tbDepartment.Enabled = false;
        }
        if (this.IsPostBack == false)
        {
            uc1.TableName = "O_OrgLog";
            uc1.WhereDict = new Dictionary <string, object>()
            {
                { "@OrgID", ID }
            };

            DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_ParameterM_xGetAgencyByID"
                                         , new Dictionary <string, object>()
            {
                { "@AgencyInfoID", ID }
            });

            AgencyInfoVM        VM        = new AgencyInfoVM();
            List <AddVaccineVM> list      = new List <AddVaccineVM>();
            OrgContractVM       VM2       = new OrgContractVM();
            List <DayTimeVM>    ddListIn  = new List <DayTimeVM>();
            List <DayTimeVM>    ddListOut = new List <DayTimeVM>();
            EntityS.FillModel(VM, ds.Tables[0]);
            EntityS.FillModel(list, ds.Tables[1]);
            EntityS.FillModel(VM2, ds.Tables[2]);
            EntityS.FillModel(ddListIn, ds.Tables[3]);

            foreach (var item in ddListIn)
            {
                DayTimeVM inVM = new DayTimeVM();
                inVM.ID        = item.ID;
                inVM.Monday    = item.Monday;
                inVM.Tuesday   = item.Tuesday;
                inVM.Wednesday = item.Wednesday;
                inVM.Thursday  = item.Thursday;
                inVM.Friday    = item.Friday;
                inVM.Saturday  = item.Saturday;
                inVM.Sunday    = item.Sunday;
                inVM.TimeAry   = new List <Dictionary <string, string> >();
                foreach (DataRow dr in ds.Tables[4].Rows)
                {
                    if (item.ID == Convert.ToInt32(dr["BusinesssDayID"].ToString()))
                    {
                        Dictionary <string, string> ssee = new Dictionary <string, string>();
                        ssee.Add("ss", dr["StartTime"].ToString().Substring(0, 5));
                        ssee.Add("ee", dr["StartTime"].ToString().Substring(0, 5));
                        inVM.TimeAry.Add(ssee);
                    }
                }

                ddListOut.Add(inVM);
            }


            if (ddListOut.Count > 0)
            {
                ddListOutAry = JsonConvert.SerializeObject(ddListOut);
            }

            if (VM2.ID > 0)
            {
                ContractID       = VM2.ID;
                tbDateStart.Text = VM2.ContractStart.ToShortTaiwanDate();
                tbDateEnd.Text   = VM2.ContractEnd.ToShortTaiwanDate();
                tbDateStop.Text  = VM2.ContractStop.ToShortTaiwanDate();

                if (tbDateStart.Text.Length == 0)
                {
                    tbDateStart.Text = DateTime.Now.ToShortTaiwanDate();
                }
            }

            var dict = SystemCode.GetDict("LocationSettingM_Divisions");

            StateListAry = JsonConvert.SerializeObject(dict);

            var codes = SystemCode.dict["ParameterM_LocationSetting_AgencyState"];

            ddlAgState.Items.Add(new ListItem("請選擇", ""));
            foreach (var item in codes)
            {
                ddlAgState.Items.Add(new ListItem(item.EnumName, item.EnumValue.ToString()));
            }

            ddlAgState.SelectedValue = VM.AgencyState.ToString();
            AgencyState = VM.AgencyState.ToString();

            lblBsState.Text = VM.BusinessStateString;
            //tbDepartment.Text = VM.Department;

            County  = VM.AgencyCounty;
            Town    = VM.AgencyTown;
            Village = VM.AgencyVillage;

            CountyName  = SystemAreaCode.GetName(VM.AgencyCounty);
            TownName    = SystemAreaCode.GetName(VM.AgencyTown);
            VillageName = SystemAreaCode.GetName(VM.AgencyVillage);

            tbAddress.Text              = VM.AgencyAddress;
            tbTelZone.Text              = VM.PhoneAreaCode;
            tbTel.Text                  = VM.AgencyPhoneNumber;
            tbSchedule.Text             = VM.InoculationSchedule;
            ddlAgencyCate.SelectedValue = VM.AgencyCate.ToString();

            lblName.Text  = VM.AgencyName;
            lblCode.Text  = VM.AgencyCode;
            tbOrg.Text    = VM.OrgName;
            hfOrgID.Value = VM.OrgID.ToString();
            //tbDepartment.Text = VM.Department;

            tbVaccine.Text = string.Join(",", list.Select(item => item.VaccineCName));
            tbOther        = VM.DepartmentOther;
            switch (VM.ReportingType)
            {
            case 1:
                rb1.Checked = true;
                break;

            case 2:
                rb2.Checked = true;
                break;

            case 3:
                rb3.Checked = true;
                break;

            case 4:
                rb4.Checked = true;
                break;
            }

            if (VM.IsSimpleFlu == false)
            {
                rbB1.Checked = true;
            }
            else
            {
                rbB2.Checked = true;
            }
            tbOtherIDs  = VM.DepartmentIDs;
            CountyJson  = JsonConvert.SerializeObject(SystemAreaCode.GetCountyList());
            TownJson    = JsonConvert.SerializeObject(SystemAreaCode.GetTownList(County));
            VillageJson = JsonConvert.SerializeObject(SystemAreaCode.GetVillageList(Town));
        }
    }
コード例 #15
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        ViewPower   = base.GetPower(PowerList[0]);
        UpdatePower = base.GetPower(PowerList[1]);

        if (Request.HttpMethod.Equals("POST"))
        {
            ID = GetNumber <int>("i");



            if (this.IsPostBack == false)
            {
                hfR.Value = ID.ToString();
                if (ID == 0)
                {
                    IsValid = false;
                    string script = "<style>body{display:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>";
                    Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
                    return;
                }
            }


            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@RoleCateID", ModuleCateID }
            };

            DataSet ds = MSDB.GetDataSet("ConnUser", "dbo.usp_PowerM_xGetRoleAndModuleByRoleID"
                                         , ref OutDict
                                         , new Dictionary <string, object>()
            {
                { "@RoleID", ID }
            });

            ModuleCateID = (int)OutDict["@RoleCateID"];

            MyTreeData = GetMenu();

            RolePowerSettingVM VM = new RolePowerSettingVM();

            List <RolePowerSettingPowerVM> list = new List <RolePowerSettingPowerVM>();
            EntityS.FillModel(VM, ds.Tables[0]);
            EntityS.FillModel(list, ds.Tables[1]);

            tbAry           = JsonConvert.SerializeObject(list);
            RoleName        = VM.RoleName;
            RoleDescription = VM.RoleDescription;

            switch (VM.RoleLevel)
            {
            case 1:
                RoleLevelName = "中央";
                break;

            case 2:
                RoleLevelName = "區管中心";
                break;

            case 3:
                RoleLevelName = "局";
                break;

            case 4:
                RoleLevelName = "所";
                break;
            }
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
コード例 #16
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        UpdatePower = base.GetPower(UpdatePower);
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);



        int.TryParse(GetString("i"), out BCGRecordID);

        if (BCGRecordID == 0)
        {
            string script = "<style>body{display:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }


        user = AuthServer.GetLoginUser();


        if (this.IsPostBack == false)
        {
            DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_RecordM_xGetBCGRecordByID"
                                         , new Dictionary <string, object>()
            {
                { "@BCGRecordID", BCGRecordID }
            });

            BCGRecordVM VM = new BCGRecordVM();
            EntityS.FillModel(VM, ds.Tables[0]);
            list = new List <BCGRecordDataVM>();
            EntityS.FillModel(list, ds.Tables[1]);

            if (list.Count > 0)
            {
                tbAry = JsonConvert.SerializeObject(list);
            }

            BirthNumber = VM.BirthNumber;
            Baby        = VM.InoculationBabyNumber;
            Kid         = VM.InoculationKidNumber;

            hf.Value = string.Join(",", list.ConvertAll <string>(item => item.ID.ToString()));



            tbOrg.Text = user.OrgName;
            int nowYear = DateTime.Now.Year - 1911;

            for (int i = VM.StatisticalYear; i <= DateTime.Now.Year - 1911; i++)
            {
                ddlYear.Items.Add(new ListItem(i.ToString() + "年", i.ToString()));
            }


            ddlSeason.Items.Add(new ListItem("第一季", "1"));
            ddlSeason.Items.Add(new ListItem("第二季", "2"));
            ddlSeason.Items.Add(new ListItem("第三季", "3"));
            ddlSeason.Items.Add(new ListItem("第四季", "4"));

            if (UpdatePower.HasPower == false)
            {
                ddlYear.Enabled         = false;
                ddlSeason.Enabled       = false;
                tbBirthNumber.Enabled   = false;
                tbKid.Enabled           = false;
                tbBaby.Enabled          = false;
                tbBabyNoScar1.Enabled   = false;
                tbBabyNoScar2.Enabled   = false;
                tbBabyNoScar3.Enabled   = false;
                tbKidNoScar1.Enabled    = false;
                tbKidNoScar2.Enabled    = false;
                tbKidNoScar3.Enabled    = false;
                tbOtherNoScar1.Enabled  = false;
                tbOtherHasScar1.Enabled = false;
                tbOtherNoScar2.Enabled  = false;
                tbOtherHasScar2.Enabled = false;
                tbOtherNoScar3.Enabled  = false;
            }
        }
    }
コード例 #17
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);

        if (Request.HttpMethod.Equals("POST"))
        {
            CaseUserID              = GetNumber <int>("c");
            RecordDataID            = GetNumber <int>("i");
            SystemRecordVaccineCode = GetString("r");
            SystemRecordVaccineID   = GetNumber <int>("ri");
            AppointmentDate         = GetString("a");

            UpdateUID = GetNumber <int>("uu");

            DateTime date    = default(DateTime);
            bool     success = DateTime.TryParse(AppointmentDate, out date);
            //AppointmentDate = date.ToShortTaiwanDate();

            //if (success==false || CaseUserID == 0 || RecordDataID == 0 )
            if (UpdateUID == 0)
            {
                if (CaseUserID == 0 || RecordDataID == 0)
                {
                    IsValid = false;
                    string script = "<script>alert('資料取得失敗');window.close();</script>";
                    Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
                    return;
                }
            }
            lblVC.Text = SystemRecordVaccineCode;
            lblAD.Text = success ? AppointmentDate : "";
            var user = AuthServer.GetLoginUser();

            Agency   = user.OrgName;
            AgencyID = user.OrgID;

            List <MyPartialDataVM> partialLst = new List <MyPartialDataVM>();
            if (SystemCode.dict.ContainsKey("RecordM_ApplyEffect_Partial"))
            {
                foreach (var item in SystemCode.dict["RecordM_ApplyEffect_Partial"])
                {
                    MyPartialDataVM VM = new MyPartialDataVM();
                    VM.EnumName  = item.EnumName;
                    VM.EnumValue = item.EnumValue;
                    string key = "RecordM_ApplyEffect_Partial" + "_Value" + item.EnumValue.ToString();
                    if (SystemCode.dict.ContainsKey(key))
                    {
                        VM.DataAry = SystemCode.dict[key];
                    }
                    partialLst.Add(VM);
                }

                MyPartialData = JsonConvert.SerializeObject(partialLst);
            }


            partialLst.Clear();
            if (SystemCode.dict.ContainsKey("RecordM_ApplyEffect_Body"))
            {
                foreach (var item in SystemCode.dict["RecordM_ApplyEffect_Body"])
                {
                    MyPartialDataVM VM = new MyPartialDataVM();
                    VM.EnumName  = item.EnumName;
                    VM.EnumValue = item.EnumValue;
                    string key = "RecordM_ApplyEffect_Body" + "_Value" + item.EnumValue.ToString();
                    if (SystemCode.dict.ContainsKey(key))
                    {
                        VM.DataAry = SystemCode.dict[key];
                    }
                    partialLst.Add(VM);
                }

                MyBodyData = JsonConvert.SerializeObject(partialLst);
            }


            ///Get ApplyEffectList
            //DataTable dt = new DataTable();

            //using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
            //{
            //    using (SqlCommand cmd = new SqlCommand("dbo.usp_RecordM_xGetApplyEffectByRecordDataID", sc))
            //    {
            //        cmd.CommandType = CommandType.StoredProcedure;
            //        cmd.Parameters.AddWithValue("@RecordDataID", RecordDataID);
            //        using (SqlDataAdapter da = new SqlDataAdapter(cmd))
            //        {
            //            sc.Open();
            //            da.Fill(dt);
            //        }
            //    }
            //}


            //List<ApplyEffectVM> list = new List<ApplyEffectVM>();
            //EntityS.FillModel(list, dt);

            //ApplyEffectJson = JsonConvert.SerializeObject(list);



            if (UpdateUID > 0)
            {
                var ds = MSDB.GetDataSet("ConnDB", "dbo.usp_RecordM_xGetApplyEffectID"
                                         , new Dictionary <string, object>()
                {
                    { "@ID", UpdateUID }
                });

                ApplyEffectVM VM = new ApplyEffectVM();
                List <ApplyEffectDetailVM> list = new List <ApplyEffectDetailVM>();
                EntityS.FillModel(VM, ds.Tables[0]);
                EntityS.FillModel(list, ds.Tables[1]);

                UpdateUserData     = JsonConvert.SerializeObject(VM);
                UpdateUserDataList = JsonConvert.SerializeObject(list);
            }
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
コード例 #18
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);

        CaseUserID = GetNumber <int>("i");

        if (CaseUserID == 0)
        {
            string script = "<style>body{disply:none;}</style><script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        ucCaseRemark1.CaseID = CaseUserID;
        var user = AuthServer.GetLoginUser();

        OrgName = user.OrgName;

        DataTable dt          = new DataTable();
        int       YCardMainID = 0;
        int       DeltaDays   = 0;
        Dictionary <string, object> OutDict = new Dictionary <string, object>()
        {
            { "@YCardMainID", YCardMainID },
            { "@DeltaDays", DeltaDays }
        };

        DataSet ds = MSDB.GetDataSet("ConnDB", "dbo.usp_RecordM_xGetCaseUserByIDAndGetOrAddYCardMain"
                                     , ref OutDict
                                     , new Dictionary <string, object>()
        {
            { "@CaseUserID", CaseUserID }
        });

        YCardMainID = (int)OutDict["@YCardMainID"];
        DeltaDays   = (int)OutDict["@DeltaDays"];

        List <RegisterStoolCardVM> scList = new List <RegisterStoolCardVM>();
        List <RegisterFluNotesVM>  fnList = new List <RegisterFluNotesVM>();
        string CapacityIDs = "";

        EntityS.FillModel(VM, ds.Tables[0]);
        if (ds.Tables[2].Rows.Count > 0)
        {
            EntityS.FillModel(VM, ds.Tables[2]);
            VM.HasYellowCardMessage = true;
        }
        EntityS.FillModel(scList, ds.Tables[3]);
        EntityS.FillModel(fnList, ds.Tables[4]);

        if (ds.Tables[1].Rows.Count > 0)
        {
            CapacityIDs = ds.Tables[1].Rows[0][0].ToString();
        }

        if (scList.Count > 0)
        {
            scAry = JsonConvert.SerializeObject(scList);
        }

        if (fnList.Count > 0)
        {
            fnAry = JsonConvert.SerializeObject(fnList);
        }

        List <string> CapacityList = new List <string>();

        foreach (var item in CapacityIDs.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
        {
            CapacityList.Add(SystemCode.GetName("CaseUser_Capacity", int.Parse(item)));
        }

        CapacityString = string.Join(",", CapacityList.ToArray());

        //if(ds.Tables[1].Rows.Count>0)
        //    YCardMainID = (int)ds.Tables[1].Rows[0][0];



        uJson = JsonConvert.SerializeObject(VM);

        AgeCalculatorT AT = new AgeCalculatorT();

        AgeString = AT.GetYearMonthAge(VM.BirthDate);


        DateTime birthDate = VM.BirthDate;

        dt = MSDB.GetDataTable("ConnDB", "dbo.usp_RecordM_xGetRecordDataByCaseUserID"
                               , new Dictionary <string, object>()
        {
            { "@CaseUserID", CaseUserID }
        });

        List <RecordDataVM> list = new List <RecordDataVM>();

        //List<RecordYellowDataVM> yellowList = new List<RecordYellowDataVM>();
        var yellowList = SystemYCard.GetDict(YCardMainID).Where(item => item.YCardDataType == 1);
        //var x = SystemYCard.dict;
        List <RecordUserDataVM> userList = new List <RecordUserDataVM>();

        //List<RecordYellowDataVM> yellowRemoveList = new List<RecordYellowDataVM>();
        List <RecordUserDataVM> userRemoveList = new List <RecordUserDataVM>();

        EntityS.FillModel(userList, dt);

        //EntityS.FillModel(yellowList, ds.Tables[0]);
        //EntityS.FillModel(userList, ds.Tables[1]);

        //var userVaccineCodes =userList.Select(item => item.SystemRecordVaccineCode).ToList();
        //var DoseIDs = yellowList.Select(item => item.DoseID).ToList();



        foreach (var yellow in yellowList)
        {
            var queryList = userList.FindAll(item => item.SystemRecordVaccineCode.Equals(yellow.DoseID));

            if (queryList.Count > 0)
            {
                foreach (var q in queryList)
                {
                    //yellowRemoveList.Add(yellow);
                    userRemoveList.Add(q);
                    RecordDataVM rVM = new RecordDataVM(birthDate);
                    rVM.InoculationDate       = q.InoculationDate;
                    rVM.IsRule                = true;
                    rVM.OrgID                 = q.OrgID;
                    rVM.VaccineBatchID        = q.VaccineBatchID;
                    rVM.SystemRecordVaccineID = q.SystemRecordVaccineID;
                    rVM.AgeEngilsh            = yellow.AgeEngilsh;
                    rVM.DoseID                = yellow.DoseID;
                    rVM.Period                = yellow.Period;
                    rVM.CreatedDate           = q.CreatedDate;
                    rVM.CreateType            = q.CreateType;
                    //rVM.ColorType = 1;
                    rVM.RecordDataID = q.RecordDataID;


                    //if (rVM.InoculationDate == null || DateTime.Equals(rVM.InoculationDate, new DateTime(2099, 1, 1, 1, 1, 1, 0)))
                    //{
                    //    rVM.OrgID = 0;
                    //    rVM.ColorType = 0;
                    //    rVM.CreatedDate = null;
                    //}
                    //else if(rVM.AppointmentDate!=null && DateTime.Equals(rVM.InoculationDate, new DateTime(2099, 1, 1, 1, 1, 1, 0))==false)
                    //{
                    //   if(DateTime.Compare(rVM.InoculationDate.Value, rVM.AppointmentDate.Value.AddDays(90))>0)
                    //    {
                    //        rVM.ColorType = 1;
                    //    }
                    //}

                    list.Add(rVM);
                }
            }
            else
            {
                RecordDataVM rVM = new RecordDataVM(birthDate);
                rVM.IsRule     = true;
                rVM.AgeEngilsh = yellow.AgeEngilsh;
                rVM.DoseID     = yellow.DoseID;
                //rVM.SystemRecordVaccineID = SystemRecordVaccine.GetID(yellow.DoseID);
                rVM.Period = yellow.Period;
                //rVM.ColorType = 0;
                list.Add(rVM);
            }
        }

        //yellowList.RemoveAll(item => yellowRemoveList.Contains(item));

        userList.RemoveAll(item => userRemoveList.Contains(item));

        list.OrderBy(item => item.AppointmentDate).ThenBy(item => item.Period).ThenBy(item => item.DoseID);

        foreach (var u in userList)
        {
            RecordDataVM rVM = new RecordDataVM(birthDate);
            rVM.InoculationDate       = u.InoculationDate;
            rVM.IsRule                = false;
            rVM.OrgID                 = u.OrgID;
            rVM.VaccineBatchID        = u.VaccineBatchID;
            rVM.SystemRecordVaccineID = u.SystemRecordVaccineID;
            rVM.RecordDataID          = u.RecordDataID;

            if (rVM.InoculationDate == null || DateTime.Equals(rVM.InoculationDate, new DateTime(2099, 1, 1, 1, 1, 1, 0)))
            {
                rVM.OrgID       = 0;
                rVM.CreatedDate = null;
            }

            //list.Add(VM);
            //find last InoculationDate
            var index = list.FindLastIndex(item => item.InoculationDateOut != null);
            if (index >= 0)
            {
                if (index + 1 <= list.Count)
                {
                    list.Insert(index + 1, rVM);
                }
                else
                {
                    list.Add(rVM);
                }
            }
            else
            {
                list.Insert(0, rVM);
            }
        }

        var LastInoculationDateIndex = list.FindLastIndex(item => item.InoculationDateOut != null);

        for (int i = LastInoculationDateIndex + 1; i <= list.Count - 1; i++)
        {
            list[i].DeltaDays = DeltaDays;
        }


        if (list.Count > 0)
        {
            tbAry = JsonConvert.SerializeObject(list);
        }
    }