コード例 #1
0
    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 }
        //                            });
    }
コード例 #2
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

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

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

        if (this.IsPostBack == false)
        {
            DataTable dt = MSDB.GetDataTable("ConnDB", "dbo.usp_CodeM_xGetSystemCodeCateByID"
                                             , new Dictionary <string, object>()
            {
                { "@SystemCodeCateID", ID }
            });
            SystemCodeCateVM VM = new SystemCodeCateVM();
            EntityS.FillModel(VM, dt);
            lblCate.Text = VM.CodeDescription;
        }
    }
コード例 #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 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);
            }
        }
    }
コード例 #5
0
    protected bool CheckPower(string pageUrl, MyPowerEnum myPowerEnum)
    {
        UserVM user     = AuthServer.GetLoginUser();
        bool   HasPower = false;

        if (user != null)
        {
            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@HasPower", HasPower }
            };

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_SystemM_xCheckPower"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@UserID", user.ID },
                { "@PageUrl", pageUrl },
                { "@FunctionIndex", myPowerEnum },
                { "@ModuleCateID", Convert.ToInt32(WebConfigurationManager.AppSettings["ModuleCateID"]) }
            });

            HasPower = (bool)OutDict["@HasPower"];
        }

        return(HasPower);
    }
コード例 #6
0
    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);
    }
コード例 #7
0
ファイル: SystemViewLog.cs プロジェクト: peter7788yes/NIIS2
 /// <summary>
 /// 瀏覽/下載 log紀錄
 /// </summary>
 /// <param name="datatype">資料類型</param>
 /// <param name="ViewDate">瀏覽/下載時間</param>
 /// <param name="UserID">操作者ID</param>
 /// <param name="DataID">個案ID / 催種資料ID</param>
 /// <param name="FileID">催種通知檔案ID,若為個案基本資料、個人訪查資料、預注資料則填0</param>
 /// <param name="Cnt">催種通知數量,若為個案基本資料、個人訪查資料、預注資料則填0</param>
 public static void AddLog(DataType datatype, DateTime ViewDate, String UserID, String DataID, int FileID, int Cnt)
 {
     if ((int)datatype < 4)
     {
         MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_SystemViewLog_xAddLog",
                              new Dictionary <string, object>()
         {
             { "@ViewDate", ViewDate.ToString("yyyy/MM/dd HH:mm:ss") },
             { "@UserID", UserID },
             { "@DataType", (int)datatype },
             { "@DataID", DataID },
             { "@FileID", DBNull.Value },
             { "@Cnt", DBNull.Value },
         });
     }
     else
     {
         MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_SystemViewLog_xAddLog",
                              new Dictionary <string, object>()
         {
             { "@ViewDate", ViewDate.ToString("yyyy/MM/dd HH:mm:ss") },
             { "@UserID", UserID },
             { "@DataType", (int)datatype },
             { "@DataID", DataID },
             { "@FileID", FileID },
             { "@Cnt", Cnt },
         });
     }
 }
コード例 #8
0
ファイル: SignSetting.aspx.cs プロジェクト: peter7788yes/NIIS
    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();
            }
        }
    }
コード例 #9
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int CaseUserID = GetNumber <int>("c");
        int FluNotes   = GetNumber <int>("f");
        int Chk        = 0;

        var user = AuthServer.GetLoginUser();

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

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_RecordM_xAddRegisterDataByFluNotes"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@UserID", user.ID },
            { "@CaseUserID", CaseUserID },
            { "@FluNotes", FluNotes }
        });

        Chk = (int)OutDict["@Chk"];

        OPVM VM = new OPVM();

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

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

        DownloadVM VM = new DownloadVM(ID);

        var user = AuthServer.GetLoginUser();

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

        if (dt.Rows.Count > 0)
        {
            string Json = JsonConvert.SerializeObject(VM);
            string code = QueryStringEncryptToolS.Encrypt(Json);
            Response.Redirect(WebConfigurationManager.AppSettings["FileServerURL"] + "/livestorage.aspx?o=" + HttpUtility.UrlEncode(code));
            Response.End();
        }
        else
        {
            Response.Redirect("~/html/ErrorPage/NoPower.html");
        }
    }
コード例 #11
0
    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}
        //                                });
    }
コード例 #12
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();
        }
    }
コード例 #13
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();
    }
コード例 #14
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(true);
        base.BodyClass = "top";

        UserVM user = AuthServer.GetLoginUser();

        txtLogin1 = string.Format("{0}({1}, {2})"
                                  , user.UserName
                                  , user.LoginName
                                  , user.OrgName);
        txtLogin2 = string.Format("於{0} 由 {1} 登入"
                                  , user.LoginDate.ToShortTaiwanDateTime()
                                  , IpAddressS.GetIP());

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

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

        if (dt.Rows.Count > 0)
        {
            txtLogin3 = "線上人數: " + dt.Rows[0][0].ToString() + " 人";
        }
    }
コード例 #15
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();
    }
コード例 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

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


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


        List <UserLoginVM> list = new List <UserLoginVM>();
        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();
    }
コード例 #17
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;
        }
    }
コード例 #18
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();
    }
コード例 #19
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();
        }
    }
コード例 #20
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();
    }
コード例 #21
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();
        }
    }
コード例 #22
0
    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();
    }
コード例 #23
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (IsValid == false)
        {
            return;
        }

        int State = 0;

        int.TryParse(ddEnState.SelectedValue, out State);

        string Address = PureString(tbAddress.Text);
        string Tel     = PureString(tbTel.Text);

        int Address1 = GetNumber <int>("SelectCounty");
        int Address2 = GetNumber <int>("SelectTown");
        int Address3 = GetNumber <int>("SelectVillage");

        string Name = PureString(tbName.Text);
        string Code = PureString(tbCode.Text);

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

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

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_CodeM_xAddElementarySchool"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@SchoolName", Name },
            { "@EnableState", State },
            { "@SchoolCounty", Address1 },
            { "@SchoolTown", Address2 },
            { "@SchoolVillage", Address3 },
            { "@SchoolAddress", Address },
            { "@SchoolPhoneNumber", Tel },
            { "@SchoolCode", Code },
            { "@OrgID", user.OrgID }
        });

        Chk = (int)OutDict["@Chk"];

        string script = "";

        if (Chk > 0)
        {
            script = "<script>alert('儲存成功');location.href = '/System/CodeM/SchoolCode.aspx';</script><style>body{display:none;}</style>";
        }
        else
        {
            script = "<script>alert('儲存失敗');</script>";
        }

        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
    }
コード例 #24
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int ID          = GetNumber <int>("i");
        int OrgLevel    = GetNumber <int>("ol");
        int AgencyState = GetNumber <int>("as");
        int OrderNumber = GetNumber <int>("on");

        string AgencyCode         = GetString("ac");
        string OrgAgencyName      = GetString("n");
        string OrgAgencyEnName    = GetString("en");
        string OrgAgencyShortName = GetString("sn");
        string IPs = GetString("ips");

        IPs = HttpUtility.UrlDecode(IPs);
        var list    = JsonConvert.DeserializeObject <List <OrgAllowIPVM> >(IPs);
        var IpSList = list.Select(item => PureString(item.IpStart)).ToList();
        var IpEList = list.Select(item => PureString(item.IpEnd)).ToList();

        if (ID > 0)
        {
            int Chk = 0;

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

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_OrgM_xUpdateOrgDetailByID"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@OrgID", ID },
                { "@AgencyCode", AgencyCode },
                { "@OrgAgencyName", OrgAgencyName },
                { "@OrgAgencyEnName", OrgAgencyEnName },
                { "@OrgAgencyShortName", OrgAgencyShortName },
                { "@OrgLevel", OrgLevel },
                { "@AgencyState", AgencyState },
                { "@OrderNumber", OrderNumber },
                { "@IpStart", string.Join(",", IpSList) },
                { "@IpEnd", string.Join(",", IpEList) }
            });

            Chk = (int)OutDict["@Chk"];

            OPVM VM = new OPVM();
            VM.chk = Chk;

            if (Chk > 0)
            {
                SystemOrg.Update();
            }
            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
コード例 #25
0
ファイル: SystemAlert.cs プロジェクト: peter7788yes/NIIS
 /// <summary>
 /// 把alert標示為已處理
 /// </summary>
 /// <param name="AlertID"></param>
 public static void Finished(int AlertID)
 {
     MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_SystemAlert_xFinish",
                          new Dictionary <string, object>()
     {
         { "@ID", AlertID },
     });
 }
コード例 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");



        int ID          = GetNumber <int>("i");
        int OrgLevel    = GetNumber <int>("ol");
        int AgencyState = GetNumber <int>("as");
        int OrderNumber = GetNumber <int>("on");


        string AgencyCode         = GetString("ac");
        string OrgAgencyName      = GetString("n");
        string OrgAgencyEnName    = GetString("en");
        string OrgAgencyShortName = GetString("sn");
        string IpStart            = GetString("is");
        string IpEnd = GetString("ie");

        if (ID > 0)
        {
            int Chk = 0;

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

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_OrgM_xUpdateOrgDetailByID"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@OrgID", ID },
                { "@AgencyCode", AgencyCode },
                { "@OrgAgencyName", OrgAgencyName },
                { "@OrgAgencyEnName", OrgAgencyEnName },
                { "@OrgAgencyShortName", OrgAgencyShortName },
                { "@OrgLevel", OrgLevel },
                { "@AgencyState", AgencyState },
                { "@OrderNumber", OrderNumber },
                { "@IpStart", IpStart },
                { "@IpEnd", IpEnd }
            });

            Chk = (int)OutDict["@Chk"];

            OPVM VM = new OPVM();
            VM.chk = Chk;

            if (Chk > 0)
            {
                SystemOrg.Update();
            }
            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
コード例 #27
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();
        }
    }
コード例 #28
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string IDF      = PureString(tbIDF.Text);
        string UserName = PureString(tbName.Text);
        string Email    = PureString(tbEmail.Text);
        string Title    = PureString(tbTitle.Text);
        string Tel      = PureString(tbTel.Text);

        string PWD  = PureString(tbPWD.Text);
        string PWD2 = PureString(tbPWD2.Text);

        if (PWD.Equals(PWD2) == false || tbPWD.Enabled == false || tbPWD2.Enabled == false || btnChange.Text.Trim().Equals("變更密碼"))
        {
            PWD = "";
        }
        else
        {
            EncryptT enc = new EncryptT();
            PWD = enc.ToSHA256(PWD);
        }

        int Chk = 0;


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

        MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_AccountM_xUpdateUserInfo"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@UserID", user.ID },
            { "@RocID", IDF },
            { "@UserName", UserName },
            { "@Email", Email },
            { "@Title", Title },
            { "@PhoneNumber", Tel },
            { "@LoginPassword", PWD }
        });

        Chk = (int)OutDict["@Chk"];

        string script = "";

        if (Chk > 0)
        {
            script = "<script>alert('儲存成功');location.href='';</script><style>body{display:none;}</style>";
        }
        else
        {
            script = "<script>alert('儲存失敗');</script>";
        }

        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
    }
コード例 #29
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();
    }
コード例 #30
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (IsValid == false)
        {
            return;
        }

        int    EnumValue   = 0;
        string EnumName    = PureString(tbName.Text);
        int    OrderNumber = 0;

        int.TryParse(tbValue.Text, out EnumValue);
        int.TryParse(tbSort.Text, out OrderNumber);

        UserVM user = AuthServer.GetLoginUser();
        int    Chk  = 0;

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

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_CodeM_xAddSystemCode"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@SystemCodeCateID", ID },
            { "@EnumValue", EnumValue },
            { "@EnumName", EnumName },
            { "@CanEdit", 0 },
            { "@OrderNumber", OrderNumber },
            { "@CreatedUserID", user.ID }
        });

        Chk = (int)OutDict["@Chk"];

        string script = "";

        if (Chk > 0)
        {
            script = string.Format("{0}<script>alert('儲存成功');location.href='{1}#{2}';</script>",
                                   "<style>body{display:none;}</style>"
                                   , "/System/CodeM/CodeSetting.aspx"
                                   , HttpUtility.HtmlDecode(GetString("hash") ?? "")
                                   );

            SystemCode.Update();
        }
        else
        {
            script = "<script>alert('儲存失敗');</script>";
        }

        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
    }