示例#1
0
        protected override void Render(HtmlTextWriter w)
        {
            try
            {
                EnsureChildControls();

                Table t = new Table();
                t.BorderWidth = 0;
                t.CellPadding = 0;
                t.CellSpacing = 0;

                TableRow  r = null;
                TableCell c = null;

                r = new TableRow();
                c = new TableCell();
                c.Controls.Add(gv);
                r.Cells.Add(c);
                t.Rows.Add(r);

                t.RenderControl(w);
            }
            catch (Exception ex)
            {
                UWeb.Error(w, ex);
            }
        }
示例#2
0
        public RsListItems(string[] dataKeyNames)
        {
            DataKeyNames = dataKeyNames;

            LoadXsdRes(UWeb.ResNameCtrl(typeof(RsList), "RsListItem.xsd"));

            UData.AddColumns(base.DataTable, dataKeyNames);
        }
示例#3
0
        private string GetIconFileName(string url)
        {
            switch (UWeb.GetExtension(url))
            {
            case ".bmp": return("bmp.ico");

            case ".doc": return("doc.ico");

            case ".docx": return("docx.ico");

            case ".exe": return("exe.ico");

            case ".gif": return("gif.ico");

            case ".hlp": return("hlp.ico");

            case ".img": return("img.ico");

            case ".jpg": return("jpg.ico");

            case ".lnk": return("lnk.ico");

            case ".mdb": return("mdb.ico");

            case ".mdf": return("mdf.ico");

            case ".msg": return("msg.ico");

            case ".msi": return("msi.ico");

            case ".pdf": return("pdf.ico");

            case ".pic": return("pic.ico");

            case ".png": return("png.ico");

            case ".ppt": return("ppt.ico");

            case ".ra": return("ra.ico");

            case ".rar": return("rar.ico");

            case ".reg": return("reg.ico");

            case ".rtf": return("rtf.ico");

            case ".tif": return("tif.ico");

            case ".wmv": return("wmv.ico");

            case ".xls": return("xls.ico");

            case ".txt": return("txt.ico");

            default:
                return("_f.ico");
            }
        }
示例#4
0
        protected override void OnLoad(EventArgs e)
        {
            if (ShowCheckBox)
            {
                UWeb.ResJs(this, "JScript.js");
            }

            base.OnLoad(e);
        }
示例#5
0
        private void ShowToolBar()
        {
            if (bs.Visible)
            {
                return;
            }

            bd.Visible = ShowDeleteButton && UWeb.UrlExists(Url);
            be.Visible = ShowEditButton;
        }
示例#6
0
 public void LoadXsdRes(string xsdResourceName)
 {
     try
     {
         LoadXsdText(UWeb.ResText(xsdResourceName));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#7
0
        protected override void CreateChildControls()
        {
            img          = new RsImageButton();
            img.ID       = UWeb.GetUniqueName(this, "img");
            img.ImageUrl = UWeb.ResUrl(this, "img.ico");
            Controls.Add(img);

            lnk             = new RsHyperLink();
            lnk.ID          = UWeb.GetUniqueName(this, "lnk");
            lnk.NavigateUrl = UWeb.ResUrl(this, "lnk.ico");
            Controls.Add(img);
        }
示例#8
0
        public static bool IsMovie(string url)
        {
            switch (UWeb.GetExtension(url))
            {
            case ".mov":
            case ".flv":
            case ".wmv":
            case ".mpeg":
            case ".rm":
            case ".ram":
                return(true);

            default:
                return(false);
            }
        }
示例#9
0
        private void Delete()
        {
            if (BeforeDelete != null)
            {
                BeforeDelete(this, EventArgs.Empty);
            }

            UFile.Delete(UWeb.MapPath(Url));

            SetValue(Url, ToolTip);

            if (AfterDelete != null)
            {
                AfterDelete(this, EventArgs.Empty);
            }
        }
示例#10
0
        private void InitWaterMarkText()
        {
            if (!ShowWaterMarkText)
            {
                return;
            }

            Page.ClientScript.RegisterClientScriptInclude(this.GetType().ToString(), UWeb.ResUrl(this, "Script.js"));

            Text = WaterMarkText;

            CssClass = CssClassWaterMarkTextBlur;

            Attributes.Add("onfocus", "RsTextBox_onfocus(this, " + UStr.Quote(CssClassWaterMarkTextFocus) + ", " + UStr.Quote(WaterMarkText) + ");");
            Attributes.Add("onblur", "RsTextBox_onblur(this, " + UStr.Quote(CssClassWaterMarkTextBlur) + ", " + UStr.Quote(WaterMarkText) + ");");
            Attributes.Add("onkeypress", "return RsTextBox_onkeypress(event, " + UStr.Quote(ClickOnEnterButtonClientID) + ")");
        }
示例#11
0
        public static bool IsImage(string url)
        {
            switch (UWeb.GetExtension(url))
            {
            case ".bmp":
            case ".hlp":
            case ".img":
            case ".jpg":
            case ".jpeg":
            case ".pic":
            case ".png":
            case ".tif":
            case ".tiff":
                return(true);

            default:
                return(false);
            }
        }
示例#12
0
        private void SetUi(string url, string toolTip)
        {
            img.ImageUrl = UrlFile(url);

            if (img.ImageUrl == "" && url != "")
            {
                if (toolTip == "")
                {
                    toolTip = UWeb.GetFileName(url);
                }

                img.ImageUrl = UWeb.ResUrl(this, GetIconFileName(url));
                img.ToolTip  = toolTip;
            }

            lnk.Text        = toolTip;
            lnk.NavigateUrl = url;
            lnk.ToolTip     = toolTip;
        }
示例#13
0
        private string UrlFile(string url)
        {
            if (!UWeb.UrlExists(url) && ShowNoImage)
            {
                if (NoImageUrl == "")
                {
                    return(UWeb.ResUrl(this, "nis.jpg"));
                }

                return(NoImageUrl);
            }

            if (UWeb.IsImage(url))
            {
                return(url);
            }

            return("");
        }
示例#14
0
        protected override void CreateChildControls()
        {
            v    = new RsFileViewer();
            v.ID = UWeb.GetUniqueName(this, "v");
            Controls.Add(v);

            be             = new RsImageButton();
            be.ID          = UWeb.GetUniqueName(this, "be");
            be.CommandName = be.ToolTip = "Edit";
            be.ImageUrl    = UWeb.ResUrl(this, "be.ico");
            be.Click      += new ImageClickEventHandler(be_Click);
            Controls.Add(be);

            bd             = new RsImageButton();
            bd.ID          = UWeb.GetUniqueName(this, "bd");
            bd.CommandName = bd.ToolTip = "Delete";
            bd.ImageUrl    = UWeb.ResUrl(this, "bd.ico");
            bd.Click      += new ImageClickEventHandler(bd_Click);
            bd.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');");
            Controls.Add(bd);

            bs             = new RsImageButton();
            bs.ID          = UWeb.GetUniqueName(this, "bs");
            bs.CommandName = bs.ToolTip = "Save";
            bs.ImageUrl    = UWeb.ResUrl(this, "bs.ico");
            bs.Click      += new ImageClickEventHandler(bs_Click);
            bs.Visible     = false;
            Controls.Add(bs);

            bc             = new RsImageButton();
            bc.ID          = UWeb.GetUniqueName(this, "bc");
            bc.CommandName = bc.ToolTip = "Cancel";
            bc.ImageUrl    = UWeb.ResUrl(this, "bc.ico");
            bc.Click      += new ImageClickEventHandler(bc_Click);
            bc.Visible     = false;
            Controls.Add(bc);

            fu         = new FileUpload();
            fu.Width   = new Unit(200, UnitType.Pixel);
            fu.ID      = UWeb.GetUniqueName(this, "fu");
            fu.Visible = false;
            Controls.Add(fu);
        }
示例#15
0
        public virtual void SetValue(string url, string toolTip)
        {
            EnsureChildControls();

            Url     = url;
            ToolTip = toolTip;

            if (!UWeb.UrlExists(url) && !ShowNoImage)
            {
                img.Visible = false;
            }
            else
            {
                img.Visible = true;
                img.ToolTip = toolTip;
                SetUi(url, toolTip);
            }

            ShowToolBar();
        }
示例#16
0
        private void AddControl(string id, Control container)
        {
            Literal c = new Literal();

            string groupName = GroupName(parent);

            id = UWeb.GetUniqueName(parent, "ctl" + rowIndex + id);

            c.Text = "<input type='radio' id='" + id + "' name='" + groupName + "' value='" + rowIndex + "'";

            if (RsRadioButtonListTemplate.SelectedIndex(parent) == rowIndex)
            {
                c.Text += " checked='checked'";
            }

            c.Text += "/>";

            container.Controls.Add(c);

            rowIndex++;
        }
示例#17
0
        private void Save()
        {
            if (BeforeSave != null)
            {
                BeforeSave(this, EventArgs.Empty);
            }

            bs.Visible = bc.Visible = false;
            be.Visible = bd.Visible = true;
            fu.Visible = false;

            if (PostedFileName != "")
            {
                string path = UWeb.MapPath(Url);

                if (path == "")
                {
                    path = UrlFolder;
                }
                {
                    UFile.Delete(path);
                }

                if (!RetainFileNameInEdit)
                {
                    path = UFile.GetFolder(path) + PostedFileName;
                }

                SaveAs(path);
            }

            SetValue(Url, ToolTip);

            if (AfterSave != null)
            {
                AfterSave(this, EventArgs.Empty);
            }
        }
示例#18
0
 public static bool QsBool(string name, bool defaultValue)
 {
     return(BaseItem.ToBool(UWeb.Qs(name, defaultValue)));
 }
示例#19
0
 public static int SelectedIndex(Control parent)
 {
     return(UWeb.RfInt32(GroupName(parent), -1));
 }
示例#20
0
        protected override void OnRowDataBound(GridViewRowEventArgs e)
        {
            base.OnRowDataBound(e);

            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            if (!ShowCheckBox || dataSourceSelected == null)
            {
                return;
            }

            if (UData.Contains((DataTable)dataSourceSelected, DataKeyNames.GetValue(0).ToString(), UWeb.ToString(e, DataKeyNames.GetValue(0).ToString())))
            {
                CheckBox chk = e.Row.FindControl("chk") as CheckBox;

                chk.Checked = true;
            }
        }
示例#21
0
 public static int RfInt32(string name, int defaultValue)
 {
     return(BaseItem.ToInt32(UWeb.GetRf(name, defaultValue)));
 }
示例#22
0
 public virtual void SetValue(string url)
 {
     SetValue(url, UWeb.GetFileName(url));
 }
示例#23
0
 public static string Rf(string name)
 {
     return(UWeb.GetRf(name, "").ToString());
 }
示例#24
0
 public static string GetUrlActivateAccount(string userName)
 {
     return(UWeb.GetUrl("http://RafeySoft.com/Web/Page/Account/Register.aspx", "rt", AccountRequestTypeE.ActivateAccount.ToString("d"), "rid", UCrypto.ToBase64(userName)));
 }
示例#25
0
 public static bool Exists(string url)
 {
     return(File.Exists(UWeb.MapPath(url)));
 }
示例#26
0
 public static string GetFileName(string url)
 {
     return(UFile.GetFileName(UWeb.MapPath(url)));
 }
示例#27
0
 public RsListFields()
 {
     LoadXsdRes(UWeb.ResNameCtrl(typeof(RsList), "RsListField.xsd"));
 }
示例#28
0
 public static string GetExtension(string url)
 {
     return(UFile.GetExtension(UWeb.MapPath(url)));
 }
示例#29
0
 public static string Qs(string name)
 {
     return(UWeb.Qs(name, "").ToString());
 }