コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];

            if (nUserLogin != null)
            {
                nUserLogin.CheckRole("CU0008");
                DataTable dt = HandlingPackaging_Data.GetTreatmentList();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Treatment += "\"" + dt.Rows[i]["Treatment"].ToString() + "\",";
                }
                string nKey = this.Request["key"];
                txtKey.Text = "0";
                int _nKey = 0;
                if (nKey != null)
                {
                    if (int.TryParse(nKey, out _nKey))
                    {
                        txtKey.Text = nKey;
                    }
                    if (!IsPostBack)
                    {
                        LoadInfo(_nKey);
                        if (!nUserLogin.Role.Edit && nKey != "0")
                        {
                            //cmdSave.Visible = false;
                            txtDatetime.Enabled  = false;
                            txtPlace.Enabled     = false;
                            txtTreatment.Enabled = false;
                            txtType.Enabled      = false;
                        }
                        else if (!nUserLogin.Role.Add && nKey == "0")
                        {
                            //cmdSave.Visible = false;
                            txtDatetime.Enabled  = false;
                            txtPlace.Enabled     = false;
                            txtTreatment.Enabled = false;
                            txtType.Enabled      = false;
                        }
                    }
                }
            }
        }