private string GetMenu()
    {
        List <ModuleMenuVM> list = new List <ModuleMenuVM>();
        DataTable           dt   = GetDataTable("ConnUser", "dbo.usp_SystemM_xGetModuleMenu"
                                                , new Dictionary <string, object>()
        {
            { "@UserID", 1 },
            { "@ModuleCateID", RoleCateID }
        });

        EntityS.FillModel(list, dt);
        return(JsonConvert.SerializeObject(list));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");


        int pgNow;
        int pgSize;

        int.TryParse(Request.Form["ac"], out AgencyCounty);
        int.TryParse(Request.Form["at"], out AgencyTown);
        int.TryParse(Request.Form["av"], out AgencyVillage);
        int.TryParse(Request.Form["as"], out AgencyState);
        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        AgencyName = Request.Form["an"] ?? "";

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_ParameterM_xGetAgencyListByMany", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@AgencyCounty", AgencyCounty);
                cmd.Parameters.AddWithValue("@AgencyTown", AgencyTown);
                cmd.Parameters.AddWithValue("@AgencyVillage", AgencyVillage);
                cmd.Parameters.AddWithValue("@AgencyState", AgencyState);
                cmd.Parameters.AddWithValue("@AgencyName", AgencyName);
                cmd.Parameters.AddWithValue("@pgNow", pgNow == 0 ? 1 : pgNow);
                cmd.Parameters.AddWithValue("@pgSize", pgSize == 0 ? 10 : pgSize);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }

        List <AgencyInfoVM> list = new List <AgencyInfoVM>();
        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();
    }
Ejemplo n.º 3
0
    private string GetMenu(UserVM user)
    {
        //ModuleMenuVM lastNode = null;
        List <ModuleMenuVM> list = new List <ModuleMenuVM>();
        //List<ModuleMenuVM> Rtn = new List<ModuleMenuVM>();

        int ModuleCateID = 1;

        if (WebConfigurationManager.AppSettings["ModuleCateID"] != null)
        {
            ModuleCateID = Convert.ToInt32(WebConfigurationManager.AppSettings["ModuleCateID"]);
        }

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

        EntityS.FillModel(list, dt);

        //foreach (ModuleMenuVM item in list)
        //{

        //    if (item.PID == 0)
        //    {
        //        Rtn.Add(item);
        //        lastNode = item;
        //    }
        //    else
        //    {
        //        if (lastNode != null)
        //        {

        //            if (lastNode.ID == item.PID)
        //            {
        //                lastNode.children.Add(item);
        //            }
        //            else
        //            {

        //                GenMenuRecursive(item, lastNode);
        //            }
        //        }
        //    }
        //}

        //return JsonConvert.SerializeObject(Rtn);
        return(JsonConvert.SerializeObject(list));
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";

        int pgNow  = 0;
        int pgSize = 0;
        int OrgID  = 0;
        int StatisticalYearStart = 0;
        int StatisticalYearEnd   = 0;

        int.TryParse(Request.Form["lid"], out OrgID);
        int.TryParse(Request.Form["s"], out StatisticalYearStart);
        int.TryParse(Request.Form["e"], out StatisticalYearEnd);
        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_RecordM_xGetBCGRecordListByMany", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@OrgID", OrgID);
                cmd.Parameters.AddWithValue("@StatisticalYearStart", StatisticalYearStart);
                cmd.Parameters.AddWithValue("@StatisticalYearEnd", StatisticalYearEnd);
                cmd.Parameters.AddWithValue("@pgNow", pgNow == 0 ? 1 : pgNow);
                cmd.Parameters.AddWithValue("@pgSize", pgSize == 0 ? 10 : pgSize);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }

        List <BCGRecordVM> list = new List <BCGRecordVM>();
        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();
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    pgNow;
        int    pgSize = 5;
        string BirthDateS;
        string BirthDateE;
        int    SearchKind;
        int    OrgID = 0;

        BirthDateS = Request.Form["BirthDateS"] ?? "";
        BirthDateE = Request.Form["BirthDateE"] ?? "";
        if (BirthDateS != "")
        {
            BirthDateS = (Convert.ToInt32(BirthDateS.Substring(0, 3)) + 1911).ToString() + "/" + BirthDateS.Substring(3, 2) + "/" + BirthDateS.Substring(5, 2);
        }
        if (BirthDateE != "")
        {
            BirthDateE = (Convert.ToInt32(BirthDateE.Substring(0, 3)) + 1911).ToString() + "/" + BirthDateE.Substring(3, 2) + "/" + BirthDateE.Substring(5, 2);
        }



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



        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB"
                                                                   , "exec dbo.usp_CaseUser_xGetMergeUserList {0},{1},{2},{3},{4},{5} "
                                                                   , new string[] { pgNow.ToString()
                                                                                    , pgSize.ToString()
                                                                                    , BirthDateS
                                                                                    , BirthDateE
                                                                                    , OrgID.ToString()
                                                                                    , SearchKind.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);



        List <MergeCheckListVM> list = new List <MergeCheckListVM>();
        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();
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SearchPower = base.AddPower(SearchPower);

        int    pgNow;
        int    pgSize;
        int    QuestionType     = 0;
        string Question         = "";
        int    QAViewDateStatus = 0;

        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        if (SearchPower.HasPower == true)
        {
            int.TryParse(Request.Form["QuestionType"], out QuestionType);
            Question = Request.Form["Question"];
            int.TryParse(Request.Form["QAViewDateStatus"], out QAViewDateStatus);
        }
        DataSet ds = new DataSet();

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

        List <QnADataVM> list = new List <QnADataVM>();
        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();
    }
Ejemplo n.º 7
0
    private string GetMenu(UserVM user)
    {
        ModuleMenuVM        lastNode = null;
        List <ModuleMenuVM> list     = new List <ModuleMenuVM>();
        List <ModuleMenuVM> Rtn      = new List <ModuleMenuVM>();

        DataTable dt = new DataTable();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_SystemM_xGetModuleMenu", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@UserID", user.ID);

                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(dt);
                }
            }
        }

        EntityS.FillModel(list, dt);
        foreach (ModuleMenuVM item in list)
        {
            if (item.PID == 0)
            {
                Rtn.Add(item);
                lastNode = item;
            }
            else
            {
                if (lastNode != null)
                {
                    if (lastNode.ID == item.PID)
                    {
                        lastNode.Children.Add(item);
                    }
                    else
                    {
                        GenMenuRecursive(item, lastNode);
                    }
                }
            }
        }

        return(JsonConvert.SerializeObject(Rtn));
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);

        user = AuthServer.GetLoginUser();

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

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


            if (this.IsPostBack == false)
            {
                if (FluNotesID == 0)
                {
                    tbDate.Text = DateTime.Now.ToShortTaiwanDate();
                }
                else
                {
                    DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_RecordM_xGetFluNotesByID"
                                                     , new Dictionary <string, object>()
                    {
                        { "@FluNotesID", FluNotesID }
                    });

                    RegisterFluNotesVM VM = new RegisterFluNotesVM();
                    EntityS.FillModel(VM, dt);

                    tbDate.Text = VM.InoculationDate.ToShortTaiwanDate();
                }
            }
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");

        int pgNow;
        int pgSize;

        string NameOrIdNo;

        NameOrIdNo = Request.Form["NameOrIdNo"] ?? "";

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



        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_CaseUser_xGetConcactList", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@pgNow", pgNow == 0 ? 1 : pgNow);
                cmd.Parameters.AddWithValue("@pgSize", pgSize == 0 ? 10 : pgSize);
                cmd.Parameters.AddWithValue("@NameOrIdNo", NameOrIdNo);



                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }

        List <UserProfileListVM> list = new List <UserProfileListVM>();
        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();
    }
Ejemplo n.º 10
0
    public static void Update()
    {
        List <SystemAreaCodeVM> list = new List <SystemAreaCodeVM>();
        DataTable dt = new DataTable();

        SqlCommand cmd = new SqlCommand("dbo.usp_CodeM_xGetSystemAreaCode");

        cmd.CommandType = CommandType.StoredProcedure;

        dt = DB.GetDataTable(cmd, "ConnDB");
        EntityS.FillModel(list, dt);
        SystemAreaCode.dict = list.OrderBy(item => item.OrderNumber)
                              .GroupBy(item => item.CodeKey)
                              .ToDictionary(IGrouping => IGrouping.Key, IGrouping => IGrouping.ToList());
        dt.Dispose();
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    pgNow      = 1;
        int    pgSize     = 10;
        string NameOrIdNo = Request.Form["NameOrIdNo"] ?? "";

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

        string SearchName  = "";
        string SearchIdNo  = "";
        string SearchResNo = "";

        if (NumberValidate.IsIdNo(NameOrIdNo) || (NameOrIdNo.StartsWith("99") && NameOrIdNo.Length == 10))
        {
            SearchIdNo = NameOrIdNo;
        }
        else

        if (NumberValidate.IsResNo(NameOrIdNo))
        {
            SearchResNo = NameOrIdNo;
        }
        else
        {
            SearchName = NameOrIdNo;
        }


        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB"
                                                                   , " exec dbo.usp_CaseUser_xGetContactList {0},{1},{2},{3},{4}  "
                                                                   , new string[] { pgNow.ToString(), pgSize.ToString(), SearchName, SearchIdNo, SearchResNo }
                                                                   , NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);

        List <UserProfileListVM> list = new List <UserProfileListVM>();
        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();
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SearchPower = base.AddPower(SearchPower);
        UserVM user = AuthServer.GetLoginUser();
        int    pgNow;
        int    pgSize;
        int    VaccineID = 0;

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

        if (SearchPower.HasPower == true)
        {
            int.TryParse(Request.Form["VaccineID"], out VaccineID);
        }

        DataSet ds = new DataSet();

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

        List <StockQueryVM> list = new List <StockQueryVM>();
        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();
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    pgNow     = GetNumber <int>("pgNow");
        int    pgSize    = GetNumber <int>("pgSize");
        string StartDate = "";
        string EndDate   = "";
        string Status    = "";

        StartDate = GetString("StartDate");
        EndDate   = GetString("EndDate");
        Status    = GetString("Status");
        Status    = Status.Equals("2") ? "" : Status;

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("usp_ImportMaster_xImmiSearchTable", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@pgNow", pgNow);
                cmd.Parameters.AddWithValue("@pgSize", pgSize);
                cmd.Parameters.AddWithValue("@StartDate", StartDate);
                cmd.Parameters.AddWithValue("@EndDate", EndDate);
                cmd.Parameters.AddWithValue("@CatID", 9);
                cmd.Parameters.AddWithValue("@IsSuccess", Status);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }

        List <ImportMasterVM> list = new List <ImportMasterVM>();
        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();
    }
Ejemplo n.º 14
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);

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

            List <string> VaccineList = (Request.Form["a"] ?? "").Split(',').ToList();

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

            //var listLookup = list.ToLookup(item => item.VaccineID);
            var listDiff = list.Where(item => (VaccineList.Contains(item.VaccineID) == false));
            if (list.Count > 0)
            {
                tbAry = JsonConvert.SerializeObject(listDiff);
            }
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";

        int.TryParse(Request.Form["i"], out VaccineID);

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



        DataTable dt = new DataTable();

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



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

        EntityS.FillModel(list, dt);

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(list));
        Response.End();
    }
Ejemplo n.º 16
0
    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));
    }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";


        user = AuthServer.GetLoginUser();

        if (this.IsPostBack == false)
        {
            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", user.OrgID);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(dt);
                    }
                }
            }


            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;
                tbLocation.Text    = VM.OrgName;
                hfLocationID.Value = VM.OrgID.ToString();
            }
        }
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int CheckID;

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


        DataSet ds = new DataSet();

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

        List <QnADataVM>      list  = new List <QnADataVM>();
        List <CreateInfoVM>   list1 = new List <CreateInfoVM>();
        List <ModifyInfoVM>   list2 = new List <ModifyInfoVM>();
        List <DocumentFileVM> list3 = new List <DocumentFileVM>();
        HasFileDataVM         rtn   = new HasFileDataVM();

        EntityS.FillModel(list, ds.Tables[0]);
        EntityS.FillModel(list1, ds.Tables[1]);
        EntityS.FillModel(list2, ds.Tables[2]);
        EntityS.FillModel(list3, ds.Tables[3]);

        rtn.Datalist         = list;
        rtn.CreateInfo       = list1;
        rtn.ModifyInfo       = list2;
        rtn.Filelist         = list3;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Ejemplo n.º 19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        NewPower    = base.AddPower(list[0]);
        UploadPower = base.AddPower(list[1]);
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);

        if (this.IsPostBack == false)
        {
            ReleaseDate.Text    = DateTime.Now.ToShortTaiwanDate();
            ReleaseDate.Enabled = false;
            QnAType.PostBackUrl = "/System/FrequentlyAskedQuestionM/QnAData/New_QnAType.aspx?PageView=add1";
            QnAType.Text        = "新增類別";

            DataSet ds = new DataSet();

            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("usp_QnAType_xGetQnATypeAllData", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(ds);
                    }
                }
            }
            List <SystemCodeVM> TableList = new List <SystemCodeVM>();
            EntityS.FillModel(TableList, ds.Tables[0]);
            if (ds.Tables.Count > 0)
            {
                List <SystemCodeVM> SystemCodeList = TableList;
                foreach (SystemCodeVM sc in SystemCodeList)
                {
                    QuestionType.Items.Add(new ListItem(sc.EnumName, sc.EnumValue.ToString()));
                }
            }
            PublishedStatus1.Checked = true;
        }
    }
Ejemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserVM user = AuthServer.GetLoginUser();

        MyLevel = SystemOrg.GetVM(user.OrgID).OrgLevel;

        DataTable dt = new DataTable();

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

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

        EntityS.FillModel(list, dt);

        if (Convert.ToInt32(WebConfigurationManager.AppSettings["OrgAreaSet"]) == 0)
        {
            OrgArea = false;
            list.RemoveAll(item => item.OrgLevel == 2);
            for (var i = 0; i < list.Count; i++)
            {
                if (list[i].OrgLevel == 3)
                {
                    list[i].PID = 1;
                }
            }
        }

        MyTreeData = JsonConvert.SerializeObject(list.Where(item => item.OrgCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["OrgCateID"])));
    }
Ejemplo n.º 21
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);


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

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

        if (ID == 0 || CateID == 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;
        }

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

            EntityS.FillModel(VM, dt);
            lblCate.Text  = VM.CodeDescription;
            lblValue.Text = VM.EnumValue.ToString();
            tbName.Text   = VM.EnumName;
            if (VM.IsEnabled)
            {
                rb1.Checked = true;
            }
            else
            {
                rb2.Checked = true;
            }
        }
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

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

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

        CertificateSignVM VM = new CertificateSignVM();

        EntityS.FillModel(VM, dt);
        VM.OrgID             = OrgID;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(VM));
        Response.End();
    }
Ejemplo n.º 23
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_xGetAllRole", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(dt);
                }
            }
        }

        AllList = new List <SystemRoleVM>();
        EntityS.FillModel(AllList, dt);
        SystemRole.list = AllList.Where(item => item.RoleCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["RoleCateID"])).ToList();
    }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");

        int pgNow;
        int pgSize;

        int CapacityID = 1;
        int CaseID     = 0;

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


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


        List <CapacityModifyLogVM> list = new List <CapacityModifyLogVM>();
        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();
    }
Ejemplo n.º 25
0
    public static void Update(int OrgID)
    {
        DataTable dt = new DataTable();

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

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

        EntityS.FillModel(list, dt);

        if (Convert.ToInt32(WebConfigurationManager.AppSettings["OrgAreaSet"]) == 0)
        {
            list.RemoveAll(item => item.OrgLevel == 2);
            for (var i = 0; i < list.Count; i++)
            {
                if (list[i].OrgLevel == 3)
                {
                    list[i].PID = 1;
                }
            }
        }

        SystemOrgByOrgID.list = list;
        if (list.Count > 0)
        {
            SystemOrgByOrgID.JsonList = JsonConvert.SerializeObject(list.Where(item => item.OrgCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["OrgCateID"])));
        }
    }
Ejemplo n.º 26
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);
                }
            }
        }

        AllList = new List <SystemOrgVM>();
        EntityS.FillModel(AllList, dt);
        SystemOrg.list = AllList.Where(item => item.OrgCateID == Convert.ToInt32(WebConfigurationManager.AppSettings["OrgCateID"])).ToList();

        if (Convert.ToInt32(WebConfigurationManager.AppSettings["OrgAreaSet"]) == 0)
        {
            SystemOrg.list.RemoveAll(item => item.OrgLevel == 2);
            for (var i = 0; i < SystemOrg.list.Count; i++)
            {
                if (SystemOrg.list[i].OrgLevel == 3)
                {
                    SystemOrg.list[i].PID = 1;
                }
            }
        }

        ZoneList = list.Where(item => item.OrgLevel < 5).ToList();

        if (SystemOrg.list.Count > 0)
        {
            SystemOrg.JsonList = JsonConvert.SerializeObject(ZoneList);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserVM user = AuthServer.GetLoginUser();

        string PageType;
        int    ID;
        int    SelectID;

        PageType = Request.Form["Page"];
        int.TryParse(Request.Form["ID"], out ID);
        int.TryParse(Request.Form["SelectID"], out SelectID);

        DataSet ds = new DataSet();

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("usp_StockManagementM_xGetVaccineBatch", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PageType", PageType);
                cmd.Parameters.AddWithValue("@DataID", ID);
                cmd.Parameters.AddWithValue("@VaccID", SelectID);
                cmd.Parameters.AddWithValue("@OrgID", user.OrgID);
                using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                {
                    sc.Open();
                    da.Fill(ds);
                }
            }
        }
        List <ChooseVaccineBatchVM> list = new List <ChooseVaccineBatchVM>();
        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();
    }
Ejemplo n.º 28
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();
    }
Ejemplo n.º 29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");
        //base.DisableTop(true);
        int pgNow       = 0;
        int pgSize      = 0;
        int CheckStatus = 0;

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


        string FileDateS = Request.Form["FileDateS"] ?? "";
        string FileDateE = Request.Form["FileDateE"] ?? "";



        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB"
                                                                   , "exec dbo.usp_Log_xCheckFileList {0},{1},{2},{3},{4}  "
                                                                   , new string[] { pgNow.ToString()
                                                                                    , pgSize.ToString()
                                                                                    , FileDateS
                                                                                    , FileDateE
                                                                                    , CheckStatus.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);


        List <CheckFileLogListVM> list = new List <CheckFileLogListVM>();
        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();
    }
Ejemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);
        base.BodyClass = "class='bodybg'";

        user  = AuthServer.GetLoginUser();
        user2 = new UserVM();

        if (this.IsPostBack == false)
        {
            DataTable dt = new DataTable();
            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnUser"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.usp_AccountM_xGetUserInfoByID", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@UserID", user.ID);
                    using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                    {
                        sc.Open();
                        da.Fill(dt);
                    }
                }
            }


            EntityS.FillModel(user2, dt);

            lblAccount.Text = user.LoginName;
            tbDept.Text     = user.RoleName;

            tbIDF.Text   = user2.RocID;
            tbName.Text  = user2.UserName;
            tbEmail.Text = user2.Email;
            tbTitle.Text = user2.Title;
            tbTel.Text   = user2.PhoneNumber;
        }
    }