Пример #1
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);
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");
        //base.DisableTop(true);
        int pgNow;
        int pgSize;
        //int UrgeType=0;
        //int UrgeStatus=0;
        //string CreateDateS;
        string IdNo;


        IdNo = Request.Form["IdNo"] ?? "";
        //CreateDateE = Request.Form["CreateDateE"] ?? "";
        //if (CreateDateS != "") CreateDateS = (Convert.ToInt32(CreateDateS.Substring(0, 3)) + 1911).ToString() + "/" + CreateDateS.Substring(3, 2) + "/" + CreateDateS.Substring(5, 2);
        //if (CreateDateE != "") CreateDateE = (Convert.ToInt32(CreateDateE.Substring(0, 3)) + 1911).ToString() + "/" + CreateDateE.Substring(3, 2) + "/" + CreateDateE.Substring(5, 2);


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


        SystemCode.Update();
        DataSet ds = new DataSet();

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

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

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

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Пример #3
0
    protected void dllInit()
    {
        SystemCode.Update();
        if (SystemCode.dict.ContainsKey("CaseUser_ContactRelationShip"))
        {
            List <SystemCodeVM> SystemCodeList = SystemCode.dict["CaseUser_ContactRelationShip"];

            foreach (SystemCodeVM sc in SystemCodeList)
            {
                ddlRS.Items.Add(new ListItem(sc.EnumName, sc.EnumValue.ToString()));
            }
        }
    }
Пример #4
0
    protected void btnRemove_Click(object sender, EventArgs e)
    {
        if (IsValid == false)
        {
            return;
        }

        int Chk = 0;

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

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_CodeM_xDeleteSystemCodeByID"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@SystemCodeID", 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_Detail.aspx?i=" + CateID
                                   , HttpUtility.HtmlDecode(GetString("hash") ?? "")
                                   );

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

        Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //long Process_MemoryStart = 0;
        //long Process_MemoryEnd = 0;
        //System.Diagnostics.Process MyProcess = System.Diagnostics.Process.GetCurrentProcess();
        //Process_MemoryStart = MyProcess.PrivateMemorySize64;

        //Response.Write(Process_MemoryStart);
        //Console.WriteLine(Process_MemoryStart);

        //Console.WriteLine(GC.GetTotalMemory(true).ToString());

        SystemCode.Update();
        SystemRole.Update();
        SystemRoleOrg.Update();
        SystemAreaCode.Update();


        //Process_MemoryEnd = MyProcess.PrivateMemorySize64;
        //Response.Write(Process_MemoryEnd);
        //Console.WriteLine(Process_MemoryEnd);
        //HomeUrlVM vm =new HomeUrlVM();
        //vm.PageUrl = "/System/CodeM/CodeSetting.aspx";
        //vm.date = DateTime.Now;
        //string s = JsonConvert.SerializeObject(vm);
        //s=QueryStringEncryptToolS.Encrypt(s);
        //s = HttpUtility.UrlEncode(s);
        //Response.Write(s);
        //Response.End();

        //HomeUrlSecret secret = new HomeUrlSecret();
        //secret.RedirectUrl = "Home";

        //string s=JsonConvert.SerializeObject(secret);

        //UrlParameterEncryptT EncryptT = new UrlParameterEncryptT();
        //UrlParameterDecryptT DecryptT = new UrlParameterDecryptT();

        //s = EncryptT.GetOutSecretJsonWithEncrypt(secret);
        //string ss = s;
        //int cc = s.Length;
        //Response.Write(s);
        //Response.Write("<br/>");
        //Response.Write(s.Length);
        //s = HttpUtility.UrlEncode(s);
        //Response.Write("<br/>");
        //Response.Write(s);
        //Response.Write("<br/>");
        //Response.Write(s.Length);
        //Response.Write("<br/>");
        //string a = Request["o"]??"";
        //int b = 0;
        //int.TryParse(Request["c"] ?? "0", out b);
        //HomeUrlSecret secret2 = new HomeUrlSecret();
        //secret2 = DecryptT.GetUrlSecret<HomeUrlSecret>(ss, TimeSpan.FromDays(1), cc);
        //if(secret2.IsValid==true)
        //    Response.Write("2Checksum驗證成功");
        //else
        //    Response.Write("2Checksum驗證失敗");
        //Response.End();
    }
Пример #6
0
    public CaseUserProfile(int CaseUserID) : base()
    {
        DataTable dt = (DataTable)DBUtil.DBOp("ConnDB",
                                              "dbo.usp_CaseUser_xGetCaseUserWithMother {0}",
                                              new string[] { CaseUserID.ToString() },
                                              NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

        SystemCode.Update();
        SystemAreaCode.Update();

        if (dt.Rows.Count > 0)
        {
            CaseID       = CaseUserID;
            BirthDate    = dt.Rows[0]["BirthDateSimple"].ToString();
            IdNo         = dt.Rows[0]["IdNo"].ToString();
            PassportNo   = dt.Rows[0]["PassportNo"].ToString();
            ResNo        = dt.Rows[0]["ResNo"].ToString();
            OtherNo      = dt.Rows[0]["OtherNo"].ToString();
            Name         = dt.Rows[0]["ChName"].ToString();
            EngName      = dt.Rows[0]["EnName"].ToString();
            Gender       = dt.Rows[0]["Gender"].ToString();
            GenderName   = SystemCode.GetName("CaseUser_Gender", Convert.ToInt32(Gender));
            HouseNo      = dt.Rows[0]["HouseNo"].ToString();
            ONationality = dt.Rows[0]["ONationality"].ToString();

            Language = dt.Rows[0]["Language"].ToString().Split(',');
            foreach (string s in Language)
            {
                if (s != "")
                {
                    LanguageName += SystemCode.GetName("CaseUser_Language", Convert.ToInt32(s)) + ",";
                }
            }

            LanguageName = (LanguageName != null ? LanguageName.TrimEnd(',') :"");

            Capacity = dt.Rows[0]["Capacity"].ToString().Split(',');
            foreach (string s in Capacity)
            {
                if (s != "")
                {
                    CapacityName += SystemCode.GetName("CaseUser_Capacity", Convert.ToInt32(s)) + ",";
                }
            }
            CapacityName = (CapacityName != null ? CapacityName.TrimEnd(',') : "");

            ConCounty = dt.Rows[0]["ConCounty"].ToString();
            if (ConCounty != "")
            {
                ConCountyName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConCounty"]));
            }

            ConTown = dt.Rows[0]["ConTown"].ToString();
            if (ConTown != "")
            {
                ConTownName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConTown"]));
            }

            ConVillage = dt.Rows[0]["ConVillage"].ToString();
            if (ConVillage != "")
            {
                ConVillageName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ConVillage"]));
            }

            ConAddr = dt.Rows[0]["ConAddr"].ToString();

            ResCounty = dt.Rows[0]["ResCounty"].ToString();
            if (ResCounty != "")
            {
                ConCountyName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResCounty"]));
            }

            ResTown = dt.Rows[0]["ResTown"].ToString();
            if (ResTown != "")
            {
                ResTownName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResTown"]));
            }

            ResVillage = dt.Rows[0]["ResVillage"].ToString();
            if (ResVillage != "")
            {
                ResVillageName = SystemAreaCode.GetName(Convert.ToInt32(dt.Rows[0]["ResVillage"]));
            }

            ResAddr = dt.Rows[0]["ResAddr"].ToString();

            MotherName      = dt.Rows[0]["MotherName"].ToString();
            MotherIdNo      = dt.Rows[0]["MotherIdNo"].ToString();
            MotherBirthDate = dt.Rows[0]["MotherBirthDateSimple"].ToString();



            // PregWeek = dt.Rows[0]["PregWeek"].ToString();
            // BirthNum = dt.Rows[0]["BirthNum"].ToString();
            // BirthSeq = dt.Rows[0]["BirthSeq"].ToString();
            //BirthWeight  = dt.Rows[0]["BirthWeight"].ToString();
            //BirthPlace = dt.Rows[0]["BirthPlace"].ToString();
            // Deliver  = dt.Rows[0]["Deliver"].ToString();
            //  DeliverOrg = dt.Rows[0]["DeliverOrg"].ToString();
            //  MarryStatus  = dt.Rows[0]["MarryStatus"].ToString();

            //  EduLevel = dt.Rows[0]["EduLevel"].ToString();
            //  ElemSchool = dt.Rows[0]["ElemSchool"].ToString();
            //Occupation = dt.Rows[0]["Occupation"].ToString();
            // EduLevel = dt.Rows[0]["EduLevel"].ToString();
            //EduLevel = dt.Rows[0]["EduLevel"].ToString();

            //  ResAddr  = dt.Rows[0]["ResAddr"].ToString();

            //  BirthMulti = dt.Rows[0]["BirthMulti"].ToString();
        }
    }