protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        AddPower = base.GetPower(list[1]);

        if (Request.HttpMethod.Equals("POST"))
        {
            ID = GetNumber <int>("i");
        }
        else
        {
            ID = GetNumber <int>("i", MyHttpMethod.GET);
        }

        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;
        }

        DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_CodeM_xGetSystemCodeListByCateID"
                                         , new Dictionary <string, object>()
        {
            { "@SystemCodeCateID", ID }
        });

        EntityS.FillModel(VM, dt);
    }
Esempio n. 2
0
    public static void Update()
    {
        List <SystemYCardVM> list = new List <SystemYCardVM>();
        DataTable            dt   = new DataTable();

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

        EntityS.FillModel(list, dt);


        SystemYCard.dict = list.OrderBy(item => item.Period).ThenBy(item => item.DoseID)
                           .GroupBy(item => item.YCardMID)
                           .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());
    }
Esempio n. 3
0
    public static void Update()
    {
        SystemAreaCode.Update();

        List <SystemOrgRegionVM> Regionlist = new List <SystemOrgRegionVM>();
        DataTable dt = DB.GetDataTable("SELECT ID,[OrgID],[RegionID]  FROM [dbo].[R_RegionAndOrg]", "ConnDB");

        EntityS.FillModel(Regionlist, dt);
        SystemOrgRegion.dictOrgRegion = Regionlist.OrderBy(item => item.OrgID)
                                        .GroupBy(item => item.OrgID)
                                        .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());
        dt.Dispose();

        List <SystemOrgRegionCountyVM> Countylist = new List <SystemOrgRegionCountyVM>();

        dt = DB.GetDataTable(" SELECT [id] ,[OrgID] ,[CountyID] FROM [dbo].[R_RegionCountyAndOrg] ", "ConnDB");
        EntityS.FillModel(Countylist, dt);
        SystemOrgRegion.dictOrgCounty = Countylist.OrderBy(item => item.OrgID)
                                        .GroupBy(item => item.OrgID)
                                        .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());

        dt.Dispose();


        List <SystemRegionSettingVM> Settinglist = new List <SystemRegionSettingVM>();

        dt = DB.GetDataTable(" SELECT [RegionID] , [CountyID] ,[TownID] ,[VillageID],SettingID FROM [dbo].[R_RegionSetting] ", "ConnDB");
        EntityS.FillModel(Settinglist, dt);
        SystemOrgRegion.dictRegionSetting = Settinglist.OrderBy(item => item.RegionID)
                                            .GroupBy(item => item.RegionID)
                                            .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());

        dt.Dispose();
    }
Esempio n. 4
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);

        if (Request.HttpMethod.Equals("POST"))
        {
            Dictionary <string, DateTime> dict = new Dictionary <string, DateTime>();
            dict.Add("nowLogin", AuthServer.GetLoginUser().LoginDate);
            nowLogin = JsonConvert.SerializeObject(dict);

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

            DataTable dt = MSDB.GetDataTable("ConnUser", "dbo.usp_AccountM_xGetAccountDetailByID"
                                             , new Dictionary <string, object>()
            {
                { "@UserID", UserID }
            });

            VM = new AccountDetailVM();
            EntityS.FillModel(VM, dt);
            ApplyDate = VM.ApplyDate.ToShortTaiwanDate();
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";

        int.TryParse(Request.Form["o"], out OrgID);

        DataTable dt = new DataTable();

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


        CertificateSignVM VM = new CertificateSignVM();

        EntityS.FillModel(VM, dt);
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
        Response.End();
    }
Esempio n. 6
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);

        user = AuthServer.GetLoginUser();

        if (this.IsPostBack == false)
        {
            DataTable dt = MSDB.GetDataTable("ConnUser", "dbo.usp_AccountM_xGetUserInfoByID"
                                             , new Dictionary <string, object>()
            {
                { "@UserID", user.ID }
            });

            UserVM user2 = new UserVM();
            EntityS.FillModel(user2, dt);

            lblAccount.Text = user.LoginName;
            tbDept.Text     = user.OrgName;
            tbIDF.Text      = user2.RocID;
            tbName.Text     = user2.UserName;
            tbEmail.Text    = user2.Email;
            tbTitle.Text    = user2.Title;
            tbTel.Text      = user2.PhoneNumber;
        }
    }
Esempio n. 7
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        UC_OpenSelectSingleOrg.PageUrl  = "/Vaccination/CertificateM/SignSetting.aspx";
        UC_OpenSelectSingleOrg.callback = "onSelectSingleOrg();";

        user = AuthServer.GetLoginUser();

        if (this.IsPostBack == false)
        {
            DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_RecordM_xGetCertificateSignByOrgID"
                                             , new Dictionary <string, object>()
            {
                { "@OrgID", user.OrgID }
            });

            if (dt.Rows.Count > 0)
            {
                CertificateSignVM VM = new CertificateSignVM();
                EntityS.FillModel(VM, dt);
                tbP.Text = VM.PhysicianSignature;
                tbE.Text = VM.EnglishFullTitle;
                tbC.Text = VM.ChineseFullTitle;
                tbD.Text = VM.UnitDirector;
                tbS.Text = VM.UnitStamp;

                UC_OpenSelectSingleOrg.DefaultName = VM.OrgName;
                UC_OpenSelectSingleOrg.DefaultID   = VM.OrgID;
                //tbLocation.Text = VM.OrgName;
                //hfLocationID.Value = VM.OrgID.ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SearchPower = base.AddPower(SearchPower);
        string Para = "";

        if (SearchPower.HasPower == true)
        {
            Para = Request.Form["Para"];
        }

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("usp_SysParameter_xSearchTable", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Para", Para);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }
        List <SystemParametersVM> list = new List <SystemParametersVM>();
        AnyDataVM rtn = new AnyDataVM();

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

        rtn.message          = list;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Esempio n. 9
0
    public static void Update()
    {
        DataTable dt = new DataTable();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_PowerM_xGetAllOrg", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(dt);
                }
            }
        }

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

        EntityS.FillModel(list, dt);
        SystemOrg.list = list;
        if (list.Count > 0)
        {
            SystemOrg.JsonList = JsonConvert.SerializeObject(list.Where(item => item.OrgCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["OrgCateID"])));
        }
    }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");
        //base.DisableTop(true);
        int pgNow;
        int pgSize         = 10;
        int LogCheckMainID = 0;

        int.TryParse(Request.Form["LogCheckMainID"], out LogCheckMainID);
        int.TryParse(Request.Form["pgNow"], out pgNow);
        pgNow = (pgNow == 0 ? 1 : pgNow);

        DataSet ds = new DataSet();

        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB", "exec dbo.usp_Log_xLogMainList {0},{1},{2} ", new string[] { pgNow.ToString(), pgSize.ToString(), LogCheckMainID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);

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

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

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

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



        DataTable dt = GetDataTable("ConnUser", "dbo.usp_AccountM_xGetAccountCheckListByMany"
                                    , new Dictionary <string, object>()
        {
            { "@OrgName", AccountOrName },
            { "@CheckYear", 0 },
            { "@YearSeason", 0 },
            { "@CheckProgress", 1 },
            { "@pgNow", pgNow == 0 ? 1 : pgNow },
            { "@pgSize", pgSize == 0 ? 10 : pgSize },
        });



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

        EntityS.FillModel(list, dt);
        rtn.message = list;


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

        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;
        }


        DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_CodeM_xGetAgencyInfoByID"
                                         , new Dictionary <string, object>()
        {
            { "@OrgID", ID }
        });

        EntityS.FillModel(VM, dt);

        //PageCL CL = new PageCL();
        //tbData = CL.GetList(new List<MedicalCodeVM>(), "ConnUser", "dbo.usp_CodeM_xGetOrgChangeLogListByID",
        //                             new Dictionary<string, object>()
        //                             {
        //                                   { "@OrgID", ID }
        //                            });
    }
Esempio n. 13
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();
    }
Esempio n. 14
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");
            List <string> VaccineList = GetList <string>("a");

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

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

            var listDiff = list.Where(item => (VaccineList.Contains(item.VaccineID) == false));
            if (listDiff.Count() > 0)
            {
                tbAry = JsonConvert.SerializeObject(listDiff);
            }
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
    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();
    }
Esempio n. 16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);


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

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


        if (this.IsPostBack == false)
        {
            DataTable dt = GetDataTable("ConnDB", "dbo.usp_CodeM_xGetSystemCodeByID"
                                        , new Dictionary <string, object>()
            {
                { "@SystemCodeCateID", ID }
            });
            SystemCodeCateVM VM = new SystemCodeCateVM();
            EntityS.FillModel(VM, dt);
            lblCate.Text = VM.CodeDescription;
        }
    }
    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();
        }
    }
Esempio n. 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int VaccineOutID;

        int.TryParse(Request.Form["ID"], out VaccineOutID);

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("usp_VaccineIn_xGetLoginData", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ID", VaccineOutID);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }
        List <VaccineInPendingVM>  list  = new List <VaccineInPendingVM>();
        List <VaccineInPendDataVM> list1 = new List <VaccineInPendDataVM>();
        StockManagementVM          rtn   = new StockManagementVM();

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

        rtn.DataInfo         = list;
        rtn.ListInfo         = list1;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
    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();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");

        int pgNow;
        int pgSize;
        int CaseID;

        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        int.TryParse(Request.Form["CaseID"], out CaseID);


        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB"
                                                                   , "exec dbo.usp_CaseUser_xGetUserModifyLog {0},{1},{2} "
                                                                   , new string[] { pgNow.ToString()
                                                                                    , pgSize.ToString()
                                                                                    , CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);

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

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

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Esempio n. 21
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        UC_OpenSelectSingleOrg.PageUrl    = "/Report/WorkloadM/WorkloadStatistics.aspx";
        UC_OpenSelectSingleOrg.IsRequired = true;

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

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

        EntityS.FillModel(list, dt);

        if (list.Count > 0)
        {
            foreach (var item in list)
            {
                var li = new ListItem();
                li.Text  = string.Format("{0} ({1})", item.VaccineID, item.VaccineCName);
                li.Value = item.VaccineID;
                ddlVaccSelect.Items.Add(li);
            }
        }
    }
Esempio n. 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int pgNow    = GetNumber <int>("pgNow");
        int pgSize   = GetNumber <int>("pgSize");
        int MasterID = GetNumber <int>("MasterID");

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("usp_ImportEmi_EmiLog_xSearchTable", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@pgNow", pgNow);
                cmd.Parameters.AddWithValue("@pgSize", pgSize);
                cmd.Parameters.AddWithValue("@MasterID", MasterID);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }

        List <EmiLogVM> list = new List <EmiLogVM>();
        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();
    }
Esempio n. 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int pgNow;
        int pgSize;
        int CaseID = 0;

        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        int.TryParse(Request.Form["CaseID"], out CaseID);
        pgNow  = (pgNow == 0 ? 1 : pgNow);
        pgSize = (pgSize == 0 ? 10 : pgSize);

        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB", "exec dbo.usp_CaseUser_GetUpdateLogList {0},{1},{2}  ", new string[] { pgNow.ToString(), pgSize.ToString(), CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);


        PageVM rtn = new PageVM();

        rtn.message = dtc[0];
        EntityS.FillModel(rtn, dtc[1]);



        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
    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();
    }
Esempio n. 25
0
    public static void Update()
    {
        List <SystemCodeVM> list = new List <SystemCodeVM>();
        DataTable           dt   = new DataTable();

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

        //list.Add(new RoleVM() {ID=0,RoleName="全部" });
        EntityS.FillModel(list, dt);


        SystemCode.dict = list.OrderBy(item => item.OrderNumber)
                          .GroupBy(item => item.CodeKey)
                          .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());
    }
Esempio n. 26
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();
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        AddPower = base.GetPower(list[1]);

        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;
        }

        DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_CodeM_xGetSystemCodeListByCateID"
                                         , new Dictionary <string, object>()
        {
            { "@SystemCodeCateID", ID }
        });

        EntityS.FillModel(VM, dt);

        //PageCL CL = new PageCL();
        //tbData = CL.GetList(new List<SystemCodeVM>(), "ConnDB", "dbo.usp_CodeM_xGetEnabledSystemCodeList",
        //                                 new Dictionary<string, object>()
        //                                 {
        //                                       { "@SystemCodeCateID",  ID },
        //                                       { "@EnState",  0 },
        //                                       { "@pgNow",1},
        //                                       { "@pgSize", 10}
        //                                });
    }
Esempio n. 28
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();
    }
Esempio n. 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);
        base.BodyClass = "class='bodybg'";


        if (Request.HttpMethod.Equals("POST"))
        {
            int.TryParse(Request.Form["c"], out CaseUserID);
            int.TryParse(Request.Form["i"], out RecordDataID);
            VaccineCode     = Request.Form["r"] ?? "";
            AppointmentDate = Request.Form["a"] ?? "";
            DateTime date    = default(DateTime);
            bool     success = DateTime.TryParse(AppointmentDate, out date);
            //AppointmentDate = date.ToShortTaiwanDate();

            if (success == false || CaseUserID == 0 || RecordDataID == 0)
            {
                string script = "<script>alert('資料取得失敗');window.close();</script>";
                Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
                return;
            }


            if (SystemCode.dict.ContainsKey("RecordM_ApplyHealthCate"))
            {
                StateListAry = JsonConvert.SerializeObject(SystemCode.dict["RecordM_ApplyHealthCate"].OrderBy(item => item.OrderNumber));
            }

            var user = AuthServer.GetLoginUser();
            UserName = user.UserName;

            DataTable dt = new DataTable();
            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.usp_AccountM_xGetUserListByOrgID", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@OrgID", user.OrgID);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(dt);
                    }
                }
            }

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

            EntityS.FillModel(list, dt);

            Users = Newtonsoft.Json.JsonConvert.SerializeObject(list);
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

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

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

        DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_ParameterM_xGetDefaultBatchByVaccineDataID"
                                         , new Dictionary <string, object>()
        {
            { "@VaccineDataID", VaccineID }
        });

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

        EntityS.FillModel(list, dt);

        List <BatchSettingVM> outList = new List <BatchSettingVM>();
        var indexList = new List <Tuple <int, int> >();

        foreach (var item in list)
        {
            bool HasValue = false;
            int  index    = 0;
            indexList.ForEach((innerItem) => {
                if (HasValue == false)
                {
                    if (innerItem.Item1 == item.VaccineBatchID)
                    {
                        HasValue = true;
                    }
                    else
                    {
                        index++;
                    }
                }
            });
            if (HasValue == false)
            {
                outList.Add(item);
                indexList.Add(Tuple.Create(item.VaccineBatchID, outList.Count - 1));
            }
            else
            {
                outList[index].StorageBottle += item.StorageBottle;
            }
        }

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(outList));
        Response.End();
    }