protected void Page_Load(object sender, EventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\git\web-application-dev\online_album\App_Data\Database1.mdf;Integrated Security=True"); //创建连接对象 con.Open(); SqlCommand cmd = new SqlCommand("select * from [photo]", con); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Panel box = new Panel(); box.CssClass = "box"; Panel1.Controls.Add(box); Image photo = new Image(); photo.CssClass = "photo"; photo.ImageUrl = "~/Images/" + dr["uid"].ToString() + "/" + dr["filename"].ToString(); ; box.Controls.Add(photo); box.Controls.Add(new Literal() { Text = "<br />" }); Label uid = new Label(); uid.Text = dr["uid"].ToString(); box.Controls.Add(uid); box.Controls.Add(new Literal() { Text = "<br />" }); Label datetime = new Label(); datetime.Text = dr["datetime"].ToString(); box.Controls.Add(datetime); } }
/// <summary> /// Must create and return the control /// that will show the administration interface /// If none is available returns null /// </summary> public Control GetAdministrationInterface(Style controlStyle) { this._adminTable = new Table(); this._adminTable.ControlStyle.CopyFrom(controlStyle); this._adminTable.Width = Unit.Percentage(100); TableCell cell = new TableCell(); TableRow row = new TableRow(); cell.ColumnSpan = 2; cell.Text = ResourceManager.GetString("NSurveySecurityAddinDescription", this.LanguageCode); row.Cells.Add(cell); this._adminTable.Rows.Add(row); cell = new TableCell(); row = new TableRow(); CheckBox child = new CheckBox(); child.Checked = new Surveys().NSurveyAllowsMultipleSubmissions(this.SurveyId); Label label = new Label(); label.ControlStyle.Font.Bold = true; label.Text = ResourceManager.GetString("MultipleSubmissionsLabel", this.LanguageCode); cell.Width = Unit.Percentage(50); cell.Controls.Add(label); row.Cells.Add(cell); cell = new TableCell(); child.CheckedChanged += new EventHandler(this.OnCheckBoxChange); child.AutoPostBack = true; cell.Controls.Add(child); Unit.Percentage(50); row.Cells.Add(cell); this._adminTable.Rows.Add(row); return this._adminTable; }
/// <summary> /// Returns the proper edit ascx Control. Uses the current Page to load the Control. /// If the user has no right a error control is returned /// </summary> /// <param name="p">The current Page</param> /// <returns>Edit ascx Control</returns> internal static Control GetEditControl(Page p) { PortalDefinition.Tab tab = PortalDefinition.GetCurrentTab(); PortalDefinition.Module m = tab.GetModule(p.Request["ModuleRef"]); if(!UserManagement.HasEditRights(HttpContext.Current.User, m.roles)) { // No rights, return a error Control Label l = new Label(); l.CssClass = "Error"; l.Text = "Access denied!"; return l; } m.LoadModuleSettings(); Module em = null; if(m.moduleSettings != null) { // Module Settings are present, use custom ascx Control em = (Module)p.LoadControl(Config.GetModuleVirtualPath(m.type) + m.moduleSettings.editCtrl); } else { // Use default ascx control (Edit[type].ascx) em = (Module)p.LoadControl(Config.GetModuleVirtualPath(m.type) + "Edit" + m.type + ".ascx"); } // Initialize the control em.InitModule( tab.reference, m.reference, Config.GetModuleVirtualPath(m.type), true); return em; }
protected override void CreateChildControls() { base.CreateChildControls(); Label lblQuestion = new Label(); _ddAnswer = new DropDownList(); RequiredFieldValidator valQuestion = new RequiredFieldValidator(); lblQuestion.ID = "lbl" + _question.QuestionGuid.ToString().Replace("-", String.Empty); _ddAnswer.ID = "dd" + _question.QuestionGuid.ToString().Replace("-", String.Empty); valQuestion.ID = "val" + _question.QuestionGuid.ToString().Replace("-", String.Empty); lblQuestion.Text = _question.QuestionText; lblQuestion.AssociatedControlID = _ddAnswer.ID; valQuestion.ControlToValidate = _ddAnswer.ID; valQuestion.Enabled = _question.AnswerIsRequired; _ddAnswer.Items.Add(new ListItem(Resources.SurveyResources.DropDownPleaseSelectText, String.Empty)); foreach (QuestionOption option in _options) { ListItem li = new ListItem(option.Answer); if (li.Value == _answer) li.Selected = true; _ddAnswer.Items.Add(li); } valQuestion.Text = _question.ValidationMessage; Controls.Add(lblQuestion); Controls.Add(_ddAnswer); Controls.Add(valQuestion); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { LinkButton child = new LinkButton(); child.Text = "All"; child.CssClass = "noUnderLine"; child.Font.Bold = true; //child.Click += new EventHandler(this.btnAlpha_Click); this.phdAlphaBar.Controls.Add(child); char ch = 'A'; for (int i = 0; i < 26; i++) { Label label = new Label(); label.Text = " | "; this.phdAlphaBar.Controls.Add(label); LinkButton button2 = new LinkButton(); button2.Text = Convert.ToChar((int)(ch + i)).ToString(); button2.CssClass = "noUnderLine"; button2.Font.Bold = true; //button2.Click += new EventHandler(this.btnAlpha_Click); this.phdAlphaBar.Controls.Add(button2); } } }
/// ----------------------------------------------------------------------------- /// <summary> /// This class allows us to render the design time mode with custom HTML /// </summary> /// <remarks> /// </remarks> /// <history> /// [Jon Henning] 9/20/2006 Commented /// </history> /// ----------------------------------------------------------------------------- public override string GetDesignTimeHtml() { string strText; DNNToolBar objToolbar = (DNNToolBar)base.Component; StringWriter sw = new StringWriter(); HtmlTextWriter tw = new HtmlTextWriter(sw); Label objLabel; Label objPanelTB; objPanelTB = new Label(); //objPanelTB.Text = "[" & objToolbar.Target & " toolbar]" if (!String.IsNullOrEmpty(objToolbar.CssClass)) objPanelTB.CssClass = objToolbar.CssClass; foreach (DNNToolBarButton objBtn in objToolbar.Buttons) { objLabel = new Label(); if (!String.IsNullOrEmpty(objBtn.CssClass)) objLabel.CssClass = objBtn.CssClass; if (!String.IsNullOrEmpty(objBtn.Text)) objLabel.Text = objBtn.Text; objPanelTB.Controls.Add(objLabel); } objPanelTB.Style.Add("position", ""); objPanelTB.Style.Add("top", "0px"); objPanelTB.Style.Add("left", "0px"); objPanelTB.RenderControl(tw); return sw.ToString(); return strText; }
protected void Registration_Click(object sender, EventArgs e) { var firstName = new Label(); firstName.Text = "FirstName: " + this.firstName.Text + "<br/>"; this.MainForm.Controls.Add(firstName); var lastName = new Label(); lastName.Text = "LastName: " + this.lastName.Text + "<br/>"; this.MainForm.Controls.Add(lastName); var number = new Label(); number.Text = "Faculty Number: " + this.fNumber.Text + "<br/>"; this.MainForm.Controls.Add(number); var university = new Label(); university.Text = "University: " + this.DropDownListUniversity.Text + "<br/>"; this.MainForm.Controls.Add(university); var specialy = new Label(); specialy.Text = "Specialy: " + this.DropDownListSpecialy.Text + "<br/>"; this.MainForm.Controls.Add(specialy); var courses = new Label(); var selectedItems = new List<string>(); foreach (var index in this.ListBoxCourses.GetSelectedIndices()) { selectedItems.Add(this.ListBoxCourses.Items[index].Text); } courses.Text = "Courses: " + string.Join(", ", selectedItems) + "<br/>"; this.MainForm.Controls.Add(courses); }
/// <summary> /// Initializes a new instance of the <see cref="View" /> class. /// </summary> protected View() : base(HtmlTextWriterTag.Div) { Presenter = new Presenter(this); _answerCountLabel = new Label() { Text = ResourceHelper.GetString("AnswerCountDropDownLabel") }; _answerCountDropDown = new DropDownList() { AutoPostBack = true }; QuestionComposerControl = new QuestionComposer() { QuestionLabelText = ResourceHelper.GetString("QuestionLabelText"), AnswerLabelText = ResourceHelper.GetString("AnswerLabelText"), FractionLabelText = ResourceHelper.GetString("FractionLabelText"), ValidatorErrorMessage = ResourceHelper.GetString("FractionValidatorErrorMessage"), IsVisibleLabelText = ResourceHelper.GetString("IsVisibleLabelText") }; _generateXmlButton = new Button() { Text = ResourceHelper.GetString("GenerateXMLButtonText") }; _generateXmlButton.Click += GenerateXmlButton_Click; }
protected void gvwKorisnici_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row != null && e.Row.RowType == DataControlRowType.Header) { foreach (TableCell cell in e.Row.Cells) { if (cell.HasControls()) { LinkButton button = cell.Controls[0] as LinkButton; HtmlGenericControl gv = new HtmlGenericControl("div"); Label lnkName = new Label(); lnkName.Text = button.Text; if (button != null) { //Image imageSort = new Image(); imageSort.ImageUrl = "~/Content/arrows.ico"; gv.Controls.Add(lnkName); //gv.Controls.Add(imageSort); button.Controls.Add(gv); //cell.Controls.Add(imageSort); } } } } }
public void MsgBox(string Message) { Label strScript = new Label(); strScript.Text = "<SCRIPT LANGUAGE='JavaScript'>" + Environment.NewLine + "window.alert('" + Message + "')</script>"; Page.Controls.Add(strScript); }
public static void Flip(Label lbl, ListControl lst, bool blnReadOnly) { lbl.Visible = blnReadOnly; lst.Visible = !blnReadOnly; if (blnReadOnly) { lbl.Text = ""; foreach (ListItem item in lst.Items) { if (item.Selected) { lbl.Text = lbl.Text + "<br>" + item.Text; } } if (lbl.Text != "") { lbl.Text = lbl.Text.Remove(0, 4); } } else { string str = lbl.Text.Replace("<br>", ","); if (str != "") { foreach (string str2 in str.Split(new char[] { ',' })) { SelectedByText(lst, str2); } } } }
protected void Page_Load(object sender, EventArgs e) { pnlAttrtype = new Panel(); pnlAttrtype.ID = "pnl" + _ProfileAttributeType.Type; lblAtriTypeName = new Label(); System.Web.UI.HtmlControls.HtmlGenericControl br = new System.Web.UI.HtmlControls.HtmlGenericControl("br"); lblAtriTypeName.Text = _ProfileAttributeType.Type; pnlAttrtype.Controls.Add(lblAtriTypeName); pnlAttrtype.Controls.Add(br); this.Controls.Add(pnlAttrtype); _ProfileAttribute = _Repository.GetProfileAttributesByProfileIDAndType(_profile.ProfileID, _ProfileAttributeType.ProfileAttributeTypeID); foreach (ProfileAttribute attribute in _ProfileAttribute) { System.Web.UI.HtmlControls.HtmlGenericControl brTab = new System.Web.UI.HtmlControls.HtmlGenericControl("br"); Label label = new Label(); label.Width = 200; label.Height = 20; label.ID = "lbl" + attribute.ProfileAttributeName; label.Text = attribute.ProfileAttributeName; TextBox textbox = new TextBox(); textbox.Width = 250; textbox.Height = 20; textbox.ID = "txt" + attribute.ProfileAttributeName; textbox.Text = attribute.Response; pnlAttrtype.Controls.Add(label); pnlAttrtype.Controls.Add(textbox); pnlAttrtype.Controls.Add(brTab); } }
private void AddUpdatePanel(Panel p) { this.messageLabel = new Label(); this.updatePanel = new UpdatePanel(); this.updatePanel.ID = "ScrudUpdatePanel"; this.updatePanel.ChildrenAsTriggers = true; this.updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional; this.updatePanel.ContentTemplateContainer.Controls.Add(this.topCommandPanel.GetCommandPanel("top")); this.updatePanel.ContentTemplateContainer.Controls.Add(this.messageLabel); this.updatePanel.ContentTemplateContainer.Controls.Add(this.gridPanel); this.updatePanel.ContentTemplateContainer.Controls.Add(this.formPanel); this.updatePanel.ContentTemplateContainer.Controls.Add(this.bottomCommandPanel.GetCommandPanel("bottom")); //Bottom command panel. this.userIdHidden = new HiddenField(); this.userIdHidden.ID = "UserIdHidden"; this.userIdHidden.Value = this.UserId.ToString(CultureInfo.InvariantCulture); this.officeCodeHidden = new HiddenField(); this.officeCodeHidden.ID = "OfficeCodeHidden"; this.officeCodeHidden.Value = this.OfficeCode; this.updatePanel.ContentTemplateContainer.Controls.Add(this.userIdHidden); this.updatePanel.ContentTemplateContainer.Controls.Add(this.officeCodeHidden); p.Controls.Add(this.updatePanel); }
/// <summary> /// Creates the checkbox control "layout" and adds /// it to the overall control tree /// </summary> protected override void CreateChildControls() { if (this.ShowAnswerText) { if ((this.ImageUrl != null) && (this.ImageUrl.Length != 0)) { Image child = new Image(); child.ImageUrl = this.ImageUrl; child.ImageAlign = ImageAlign.Middle; child.ToolTip = this.Text; this.Controls.Add(child); } else { //JJ this.Controls.Add(new LiteralControl(this.Text)); Label label = new Label(); label.Text = this.Text; label.CssClass = "AnswerTextRender"; this.Controls.Add(label); } } if (this.DefaultText != null) { bool flag = true; if (this.DefaultText == flag.ToString()) { this._boolCheckBox.Checked = true; } } this.Controls.Add(this._boolCheckBox); PostedAnswerDataCollection postedAnswers = new PostedAnswerDataCollection(); postedAnswers.Add(new PostedAnswerData(this, this.AnswerId, base.SectionContainer.SectionNumber, this._boolCheckBox.Checked.ToString(), AnswerTypeMode.Custom)); this.OnAnswerPublisherCreated(new AnswerItemEventArgs(postedAnswers)); }
public static void AddLabel(string labelScript, Default page) { Label label = new Label(); label.Text = string.Format("{0}", labelScript); label.Visible = true; page.Controls.Add(label); }
protected void AgregarControles(Label nombreContr, CheckBox chB, TextBox tbox, HiddenField nuevoHidF, Label hrReg, Label observ) { try { PanelConVisita.Controls.Add(new LiteralControl("<tr>")); PanelConVisita.Controls.Add(new LiteralControl("<td>")); PanelConVisita.Controls.Add(nombreContr); PanelConVisita.Controls.Add(new LiteralControl("</td><td>")); PanelConVisita.Controls.Add(new LiteralControl(" ")); PanelConVisita.Controls.Add(new LiteralControl("</td><td>")); if (hrReg == null) { PanelConVisita.Controls.Add(chB); } else { PanelConVisita.Controls.Add(hrReg); } PanelConVisita.Controls.Add(new LiteralControl("</td><td>")); if (hrReg == null) { PanelConVisita.Controls.Add(tbox); } else { PanelConVisita.Controls.Add(observ); } PanelConVisita.Controls.Add(new LiteralControl("</td></tr>")); } catch (Exception ex) { return; } }
private void SetAddModifyTitle(Label addModifyTitle) { string addModifyString = null; if (entityKey.HasValue) { if (addModifyTitle != null) { addModifyString = string.Format(addModifyTitle.Text, "Modificar"); } if (Request["view"] != null) { if (addModifyTitle != null) { addModifyString = string.Format(addModifyTitle.Text, "Ver"); } } } else { if (addModifyTitle != null) { addModifyString = string.Format(addModifyTitle.Text, "Crear"); } } if(!string.IsNullOrEmpty(addModifyString)) addModifyTitle.Text = addModifyString; }
protected void AgregarControles(Label nombreContr, TextBox txt, DropDownList cmb, HiddenField nhf, int cont) { try { /* pnlSeleccionarDatos.Controls.Add(nombreContr); pnlSeleccionarDatos.Controls.Add(new LiteralControl(" ")); pnlSeleccionarDatos.Controls.Add(cmb); pnlSeleccionarDatos.Controls.Add(new LiteralControl(" ")); pnlSeleccionarDatos.Controls.Add(txt); pnlSeleccionarDatos.Controls.Add(new LiteralControl(" ")); */ Panel1.Controls.Add(new LiteralControl("<tr>")); Panel1.Controls.Add(new LiteralControl("<td>")); Panel1.Controls.Add(nombreContr); Panel1.Controls.Add(new LiteralControl("</td><td>")); Panel1.Controls.Add(cmb); Panel1.Controls.Add(new LiteralControl("</td><td>")); Panel1.Controls.Add(txt); Panel1.Controls.Add(nhf); Panel1.Controls.Add(new LiteralControl("</td></tr>")); } catch (Exception ex) { return; } }
private void showProjects() { List<ProjectInfo> projects = ProjectInfo.getUserProjects(Membership.GetUser(false).UserName, activeProjectsOnly); TableRow row = new TableRow(); Label cell = new Label(); cell.Text = "<div class = \"tblProjects\">"; int i = 0; foreach (ProjectInfo info in projects) { if (i != 2) { cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"section.aspx?id=" + info.ProjectID + "\"><div class = projName>" + info.Name + "</div></a>" + "<div class = projDesc>" + info.Description + "</div>"; TableCell cell1 = new TableCell(); cell1.Text = cell.Text.ToString(); row.Cells.Add(cell1); i++; } else { cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"section.aspx?id=" + info.ProjectID + "\"><div class = projName>" + info.Name + "</div></a>" + "<div class = projDesc>" + info.Description + "</div></tr><tr>"; TableCell cell1 = new TableCell(); cell1.Text = cell.Text.ToString(); row.Cells.Add(cell1); i = 0; } } tblProjects.Rows.Add(row); cell.Text += "</div>"; }
public override void AddValidatorSettingsView(Control parentCtrl) { int minLength = 0; bool minExist = TryGetProperty("MinimumLength", ref minLength); int maxLength = 0; bool maxExist = TryGetProperty("MaximumLength", ref maxLength); if (minExist) { Portal.API.Controls.Label lbl = new Portal.API.Controls.Label(); lbl.LanguageRef = "MinimumLength"; parentCtrl.Controls.Add(lbl); Label val = new Label(); val.Text = minLength.ToString(); parentCtrl.Controls.Add(val); if (maxExist) parentCtrl.Controls.Add(new LiteralControl("</br>")); } if (maxExist) { Portal.API.Controls.Label lbl = new Portal.API.Controls.Label(); lbl.LanguageRef = "MaximumLength"; parentCtrl.Controls.Add(lbl); Label val = new Label(); val.Text = maxLength.ToString(); parentCtrl.Controls.Add(val); } }
protected void LogoSourceSelectionList_SelectedIndexChanged(object sender, EventArgs e) { if (LogoSourceSelectionList.SelectedValue == "Computer") { Label LogoLabel = new Label(); Label BreakLine = new Label(); FileUpload LogotypeFileUpload = new FileUpload(); BreakLine.Text = "<br />"; LogoLabel.Text = "Please select an image from your computer:"; LogotypePlaceHolder.Controls.Add(LogoLabel); LogotypePlaceHolder.Controls.Add(BreakLine); LogotypePlaceHolder.Controls.Add(LogotypeFileUpload); } if (LogoSourceSelectionList.SelectedValue == "Internet") { Label LogoLabel = new Label(); Label BreakLine = new Label(); TextBox LogoUrlTextBox = new TextBox(); BreakLine.Text = "<br />"; LogoLabel.Text = "Please specify the URL to the location of your logotype. Please make sure to specify an absolute path such as: http://www.something.com/image.png"; LogoUrlTextBox.Text = "http://"; LogotypePlaceHolder.Controls.Add(LogoLabel); LogotypePlaceHolder.Controls.Add(BreakLine); LogotypePlaceHolder.Controls.Add(LogoUrlTextBox); } }
public override void Ini() { CssClass = "_devices"; burnerList = new Dictionary<string, Devices>(); burnerList = ((Bake)deviceList[name]).GetBurnerList(); bakeOvenList = ((Bake)deviceList[name]).GetBakeOvenList(); panelName = new Panel(); panelName.CssClass = "_bakePanelName"; labelName = new Label(); labelName.Text = name; panelName.Controls.Add(labelName); buttonDelete = new Button(); buttonDelete.Text = "X"; buttonDelete.CssClass = "_buttonDelete"; buttonDelete.Click += Delete_Click; Controls.Add(panelName); Controls.Add(buttonDelete); foreach (var burner in burnerList) { Controls.Add(((IDraw)burner.Value).Draw(burner.Key, burnerList)); } foreach (var oven in bakeOvenList) { Controls.Add(((IDraw)oven.Value).Draw(oven.Key, bakeOvenList)); } }
public MultipleSelectControl(MultipleSelect item, RepeatDirection direction) { this.item = item; l = new Label(); l.Text = item.Title; l.CssClass = "label"; l.AssociatedControlID = item.Name; this.Controls.Add(l); list = new CheckBoxList(); list.RepeatDirection = direction; list.ID = item.Name; list.CssClass = "alternatives"; list.DataSource = item.GetChildren(); list.DataTextField = "Title"; list.DataValueField = "ID"; list.DataBind(); this.Controls.Add(list); if (item.Required) { cv = new CustomValidator { Display = ValidatorDisplay.Dynamic, Text = "*" }; cv.ErrorMessage = item.Title + " is required"; cv.ServerValidate += (s, a) => a.IsValid = !string.IsNullOrEmpty(AnswerText); cv.ValidationGroup = "Form"; this.Controls.Add(cv); } }
protected override void CreateChildControls() { lbl = new Label(); lbl.EnableViewState = false; lbl.Text = UserGreeting; this.Controls.Add(lbl); }
private TableRow BuildOptionRow(string label, Control optionControl, string comment, string controlComment) { TableRow row = new TableRow(); TableCell cell = new TableCell(); TableCell cell2 = new TableCell(); cell.Wrap = false; if (label != null) { Label child = new Label(); child.ControlStyle.Font.Bold = true; child.Text = label; child.CssClass = "AnswerTextRender";//JJ cell.Controls.Add(child); cell.VerticalAlign = VerticalAlign.Top; if (comment != null) { cell.Controls.Add(new LiteralControl("<br />" + comment)); } row.Cells.Add(cell); } else { cell2.ColumnSpan = 2; } cell2.Controls.Add(optionControl); if (controlComment != null) { cell2.Controls.Add(new LiteralControl("<br />" + controlComment)); } row.Cells.Add(cell2); return row; }
protected override void CreateChildControls() { Random random = new Random(); _firstInt = random.Next(0, 20); _secondInt = random.Next(0, 20); ResourceManager rm = new ResourceManager("SystemWebExtensionsAUT.LocalizingClientResourcesWalkthrough.VerificationResources", this.GetType().Assembly); Controls.Clear(); _firstLabel = new Label(); _firstLabel.ID = "firstNumber"; _firstLabel.Text = _firstInt.ToString(); _secondLabel = new Label(); _secondLabel.ID = "secondNumber"; _secondLabel.Text = _secondInt.ToString(); _answer = new TextBox(); _answer.ID = "userAnswer"; _button = new Button(); _button.ID = "Button"; _button.Text = rm.GetString("Verify"); _button.OnClientClick = "return CheckAnswer();"; Controls.Add(_firstLabel); Controls.Add(new LiteralControl(" + ")); Controls.Add(_secondLabel); Controls.Add(new LiteralControl(" = ")); Controls.Add(_answer); Controls.Add(_button); }
public override Control DataEditorControls(XmlNode xml, Dictionary<string, object> properties) { //properties should be multiType properties ie. Name, Description, Mandatory, Validation Panel pnlDataEditor = new Panel(); Label lblDataEditor = new Label() { Text = properties["Name"].ToString() }; Literal litDescription = new Literal() { Text = properties["Description"].ToString() }; dtpDataEditor = new umbraco.uicontrols.DatePicker.DateTimePicker(); if (properties.ContainsKey("ShowTime")) { boolShowTime = bool.Parse(properties["ShowTime"].ToString()); dtpDataEditor.ShowTime = boolShowTime; } if (xml != null) { //Anything special about the xml? no - just do innertext dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText); } pnlDataEditor.Controls.Add(lblDataEditor); pnlDataEditor.Controls.Add(litDescription); pnlDataEditor.Controls.Add(dtpDataEditor); if (xml != null) { //Anything special about the xml? no - just do innertext dtpDataEditor.DateTime = Convert.ToDateTime(xml.InnerText); } return pnlDataEditor; }
protected void Page_Load(object sender, EventArgs e) { var nearby = client.Nearby(client.ClientIdentifier, client.ClientSecret, new Decimal(41.58454600), new Decimal(-93.63416700)); if (!nearby.Any()) { var l = new Label(); l.Text = "No spots found."; this.nearbyHolder.Controls.Add(l); } else { foreach (NearbyResult spot in nearby) { var table = WebUIUtility.BuildFieldDescTable( new Tuple<string, string>[] { Tuple.Create("Id", spot.Id), Tuple.Create("Name", spot.Name), Tuple.Create("Latitude", spot.Latitude.ToString()), Tuple.Create("Longitude", spot.Longitude.ToString()), Tuple.Create("Address", spot.Address), Tuple.Create("City", spot.City), Tuple.Create("State", spot.State), Tuple.Create("PostalCode", spot.PostalCode), Tuple.Create("Group", string.Join(",", spot.Group)), Tuple.Create("Image", spot.Image) } ); this.nearbyHolder.Controls.Add(table); this.nearbyHolder.Controls.Add(WebUIUtility.HorizontalLine()); } } }
//--- This class allows us to render the design time mode with custom HTML ---' public override string GetDesignTimeHtml() { // Component is the instance of the component or control that // this designer object is associated with. This property is // inherited from System.ComponentModel.ComponentDesigner. DNNMenu objMenu = (DNNMenu)Component; if (objMenu.ID.Length > 0) { StringWriter sw = new StringWriter(); HtmlTextWriter tw = new HtmlTextWriter(sw); Label objText = new Label(); objText.CssClass = objMenu.MenuBarCssClass + " " + objMenu.DefaultNodeCssClass; objText.Text = objMenu.ID; if (objMenu.Orientation == Orientation.Horizontal) { objText.Width = new Unit("100%"); } //objText.Height = New Unit(objMenu) else { objText.Height = new Unit(500); //---not sure why 100% doesn't work here ---' 'Unit("100%") //objText.Width = Unit.Empty } objText.RenderControl(tw); return sw.ToString(); } else { return null; } }
public static void setLabel(System.Web.UI.WebControls.Label Object, string text) { if (Object != null) { Object.Text = text; } }
//Override the Create Child Controls event protected override void CreateChildControls() { base.CreateChildControls(); //label for radio button list lblTFQuestion = new Label(); lblTFQuestion.ID = "lblTFQuestion"; lblTFQuestion.AssociatedControlID = "uxTFQuestion"; lblTFQuestion.Text = QuestionText; //create radio button list uxTFQuestion = new RadioButtonList(); uxTFQuestion.ID = "uxTFQuestion"; //create validation for radio button list reqTFQuestion = new RequiredFieldValidator(); reqTFQuestion.ID = "reqTFQuestion"; reqTFQuestion.Display = ValidatorDisplay.Dynamic; reqTFQuestion.Text = "*"; reqTFQuestion.ControlToValidate = "uxTFQuestion"; reqTFQuestion.ErrorMessage = "No radio selection"; //create and add list items true and false ListItem listTrue = new ListItem("true", "true"); ListItem listFalse = new ListItem("False", "False"); uxTFQuestion.Items.Add(listTrue); uxTFQuestion.Items.Add(listFalse); //add label, radio button list and validator to controls Controls.Add(lblTFQuestion); Controls.Add(uxTFQuestion); Controls.Add(reqTFQuestion); }
static public void ErrorLog_Display(Exception ex, String error, System.Web.UI.WebControls.Label lbl) { String DisplayMessage = String.Format("<div class='error_div'>" + "<table class='error_table'>" + "<tr><td>Error<td/><td>{0}</td></tr>" + "<tr><td>Message<td/><td>{1}</td></tr>" + "<tr><td>StackTrace<td/><td>{2}</td></tr>" + "<tr><td>Source<td/><td>{3}</td></tr>" + "<tr><td>InnerException<td/><td>{4}</td></tr>" + "<tr><td>Data<td/><td>{5}</td></tr>" + "</table>" + "</div>" , error //0 , ex.Message //1 , ex.StackTrace //2 , ex.Source //3 , ex.InnerException //4 , ex.Data //5 , ex.HelpLink , ex.TargetSite ); lbl.Text = DisplayMessage; }
protected void purchaseplan_start_list_Repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { string sqltext = ""; string ptcode = ""; string code = ""; string cstate = ""; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ptcode = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PTCODE")).Text; cstate = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_CSTATE")).Text; //占用库存 sqltext = "select PUR_PCODE from TBPC_MARSTOUSEALL where PUR_PTCODE='" + ptcode + "'"; System.Data.DataTable dt = DBCallCommon.GetDTUsingSqlText(sqltext); if (dt.Rows.Count > 0 && cstate == "1") { code = dt.Rows[0]["PUR_PCODE"].ToString(); ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_ZY")).ForeColor = System.Drawing.Color.Red; ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_ZY")).Text = "是"; ((HyperLink)e.Item.FindControl("HyperLink3")).NavigateUrl = "PC_TBPC_Purchaseplan_check_detail.aspx?sheetno=" + Server.UrlEncode(code) + "&ptc=" + Server.UrlEncode(ptcode) + ""; } else { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_ZY")).Text = "否"; } //相似代用 sqltext = "select MP_CODE from TBPC_MARREPLACEALL where MP_PTCODE='" + ptcode + "' and substring(MP_CODE,5,1)='0'"; dt = DBCallCommon.GetDTUsingSqlText(sqltext); if (dt.Rows.Count > 0 && cstate == "1") { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_SSDY")).ForeColor = System.Drawing.Color.Red; ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_SSDY")).Text = "是"; ((HyperLink)e.Item.FindControl("HyperLink1")).NavigateUrl = "~/PC_Data/PC_TBPC_PLAN_PLACE.aspx?ptc=" + Server.UrlEncode(ptcode) + ""; } else { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_SSDY")).Text = "否"; } //代用 sqltext = "select MP_CODE from TBPC_MARREPLACEALL where MP_PTCODE='" + ptcode + "' and substring(MP_CODE,5,1)='1' "; dt = DBCallCommon.GetDTUsingSqlText(sqltext); if (dt.Rows.Count > 0 && cstate == "0") { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_DY")).ForeColor = System.Drawing.Color.Red; ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_DY")).Text = "是"; ((HyperLink)e.Item.FindControl("HyperLink2")).NavigateUrl = "~/PC_Data/PC_TBPC_PLAN_PLACE.aspx?ptc=" + Server.UrlEncode(ptcode) + ""; } else { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_DY")).Text = "否"; } System.Web.UI.WebControls.Label purstate = (System.Web.UI.WebControls.Label)e.Item.FindControl("purstate"); if (purstate.Text.ToString().Trim() == "是") { ((HtmlTableRow)e.Item.FindControl("row")).BgColor = "#00E600"; } string ptccode1 = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PTCODE")).Text.ToString(); string zybz = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_ZY")).Text.ToString(); string xszybz = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_SSDY")).Text.ToString(); string sqlifck = "select * from View_SM_OUT where PTC='" + ptccode1 + "'"; System.Data.DataTable dtifck = DBCallCommon.GetDTUsingSqlText(sqlifck); if (dt.Rows.Count > 0 && (zybz == "是")) { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_ZY")).BackColor = System.Drawing.Color.Blue; } else if (dt.Rows.Count > 0 && (xszybz == "是")) { ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_SSDY")).BackColor = System.Drawing.Color.Blue; } string PUR_IFFAST = ((System.Web.UI.WebControls.Label)e.Item.FindControl("PUR_IFFAST")).Text.Trim(); if (PUR_IFFAST == "1") { ((System.Web.UI.WebControls.Label)e.Item.FindControl("rownum")).ForeColor = System.Drawing.Color.Red; ((System.Web.UI.WebControls.Label)e.Item.FindControl("rownum")).ToolTip = "该物料为加急物料"; } } //foreach(RepeaterItem item in purchaseplan_start_list_Repeater.Items) //{ // Label purstate = (Label)item.FindControl("purstate"); // if (purstate.Text.ToString().Trim() == "是") // { // ((HtmlTableRow)e.Item.FindControl("row")).BgColor = "Yellow"; // } //} }
// ********************************************************************* // DisplayNumericalPaging // /// <summary> /// Controls how the numerical link buttons get rendered /// </summary> // ********************************************************************/ private void DisplayNumericalPaging() { int itemsToDisplay = 30; int lowerBoundPosition = 1; int upperBoundPosition = (TotalPages - 1); System.Web.UI.WebControls.Label label; // Clear out the controls numericalPaging.Controls.Clear(); // If we have less than 6 items we don't need the fancier paging display if ((upperBoundPosition + 1) < (itemsToDisplay + 3)) { for (int i = 0; i < (upperBoundPosition + 1); i++) { // Don't display a link button for the existing page if (i == PageIndex) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = "[" + (PageIndex + 1).ToString("n0") + "]"; numericalPaging.Controls.Add(label); } else { numericalPaging.Controls.Add(numericalLinkButtons[i]); } if (i + 1 != numericalLinkButtons.Length) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = ", "; numericalPaging.Controls.Add(label); } } return; } // Always display the first 3 if available if (numericalLinkButtons.Length < itemsToDisplay) { itemsToDisplay = numericalLinkButtons.Length; } for (int i = 0; i < itemsToDisplay; i++) { numericalPaging.Controls.Add(numericalLinkButtons[i]); if (i + (itemsToDisplay / 2) != itemsToDisplay) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = ", "; numericalPaging.Controls.Add(label); } } // Handle the lower end first if ((PageIndex - lowerBoundPosition) <= (upperBoundPosition - PageIndex)) { for (int i = itemsToDisplay; i < PageIndex + 2; i++) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = ", "; numericalPaging.Controls.Add(label); numericalPaging.Controls.Add(numericalLinkButtons[i]); } } // Insert the ellipses or a trailing comma if necessary label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; if (upperBoundPosition == 3) { label.Text = ", "; } else if (upperBoundPosition >= 4) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = " ... "; } numericalPaging.Controls.Add(label); // Handle the upper end if ((PageIndex - lowerBoundPosition) > (upperBoundPosition - PageIndex)) { for (int i = PageIndex - 1; i < upperBoundPosition; i++) { label = new System.Web.UI.WebControls.Label(); label.CssClass = "normalTextSmallBold"; label.Text = ", "; if (i > PageIndex - 1) { numericalPaging.Controls.Add(label); } numericalPaging.Controls.Add(numericalLinkButtons[i]); } } // Always display the last 2 if available if ((numericalLinkButtons.Length > 3) && (TotalPages > 5)) { itemsToDisplay = 2; for (int i = itemsToDisplay; i > 0; i--) { numericalPaging.Controls.Add(numericalLinkButtons[(upperBoundPosition + 1) - i]); if (i + 1 != itemsToDisplay) { System.Web.UI.WebControls.Label tmp = new System.Web.UI.WebControls.Label(); tmp.CssClass = "normalTextSmallBold"; tmp.Text = ", "; numericalPaging.Controls.Add(tmp); } } } }
protected void rp_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; i20 += SafeValue.SafeInt(dr["i20"], 0); i40 += SafeValue.SafeInt(dr["i40"], 0); e20 += SafeValue.SafeInt(dr["e20"], 0); e40 += SafeValue.SafeInt(dr["e40"], 0); o20 += SafeValue.SafeInt(dr["o20"], 0); o40 += SafeValue.SafeInt(dr["o40"], 0); oe += SafeValue.SafeInt(dr["oe"], 0); t20 += SafeValue.SafeInt(dr["i20"], 0) + SafeValue.SafeInt(dr["e20"], 0) + SafeValue.SafeInt(dr["o20"], 0); t40 += SafeValue.SafeInt(dr["i40"], 0) + SafeValue.SafeInt(dr["e40"], 0) + SafeValue.SafeInt(dr["o40"], 0); teu += SafeValue.SafeInt(dr["teu"], 0); fee += SafeValue.SafeDecimal(dr["fee"], 0); Trips += SafeValue.SafeInt(dr["Trips"], 0); Incentive += SafeValue.SafeDecimal(dr["Incentive"]); Claim += SafeValue.SafeDecimal(dr["Claim"]); inv += SafeValue.SafeDecimal(dr["inv"]); psaRB += SafeValue.SafeDecimal(dr["psaRB"]); } else { if (e.Item.ItemType == ListItemType.Footer) { System.Web.UI.WebControls.Label lb_i20 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_i20"); System.Web.UI.WebControls.Label lb_i40 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_i40"); System.Web.UI.WebControls.Label lb_e20 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_e20"); System.Web.UI.WebControls.Label lb_e40 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_e40"); System.Web.UI.WebControls.Label lb_o20 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_o20"); System.Web.UI.WebControls.Label lb_o40 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_o40"); System.Web.UI.WebControls.Label lb_oe = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_oe"); System.Web.UI.WebControls.Label lb_t20 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_t20"); System.Web.UI.WebControls.Label lb_t40 = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_t40"); System.Web.UI.WebControls.Label lb_te = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_te"); System.Web.UI.WebControls.Label lb_teu = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_teu"); System.Web.UI.WebControls.Label lb_fee = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_fee"); System.Web.UI.WebControls.Label lb_Trips = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_Trips"); System.Web.UI.WebControls.Label lb_Incentive = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_Incentive"); System.Web.UI.WebControls.Label lb_Claim = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_Claim"); System.Web.UI.WebControls.Label lb_inv = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_inv"); System.Web.UI.WebControls.Label lb_psaRB = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_psaRB"); lb_i20.Text = i20.ToString(); lb_i40.Text = i40.ToString(); lb_e20.Text = e20.ToString(); lb_e40.Text = e40.ToString(); lb_o20.Text = o20.ToString(); lb_o40.Text = o40.ToString(); lb_oe.Text = oe.ToString(); lb_t20.Text = t20.ToString(); lb_t40.Text = t40.ToString(); lb_te.Text = oe.ToString(); lb_teu.Text = teu.ToString(); lb_fee.Text = fee.ToString(); lb_Trips.Text = Trips.ToString(); lb_Incentive.Text = Incentive.ToString(); lb_Claim.Text = Claim.ToString(); lb_inv.Text = inv.ToString(); lb_psaRB.Text = psaRB.ToString(); } } }
public void InstantiateIn(System.Web.UI.Control container) { AspNet.Label labGender = new AspNet.Label(); labGender.DataBinding += new EventHandler(labGender_DataBinding); container.Controls.Add(labGender); }
public static void paging(string clinktail, int sumpage, int page, System.Web.UI.WebControls.Label page_view) { if (sumpage > 0) { int n = sumpage; //总页数 int x = page; //得到当前页 int i; int endpage; string pageview = "", pageviewtop = ""; if (x > 1) { pageview += " <a class='pl' href='?page=1" + clinktail + "'>第1页</a> | "; pageviewtop += " <a class='pl' href='?page=1" + clinktail + "'>第1页</a> | "; } else { pageview += " <font color='#666666'> 第1页 </font> | "; pageviewtop += " <font color='#666666'> 第1页 </font> | "; } if (x > 1) { pageviewtop += " <a class='pl' href='?page=" + (x - 1) + "" + clinktail + "'>上1页</a> "; } else { pageviewtop += " <font color='#666666'>上1页</font> "; } if (x > ((x - 1) / 10) * 10 && x > 10) { pageview += "<a class='pl' href='?page=" + ((x - 1) / 10) * 10 + "" + clinktail + "' onclink='return false;'>上10页</a>"; } //if (((x-1) / 10) * 10 + 10) >= n ) if (((x - 1) / 10) * 10 + 10 >= n) { endpage = n; } else { endpage = ((x - 1) / 10) * 10 + 10; } for (i = ((x - 1) / 10) * 10 + 1; i <= endpage; ++i) { if (i == x) { pageview += " <font color='#FF0000'><b>" + i + "</b></font>"; } else { pageview += " <a class='pl' href='?page=" + i + "" + clinktail + "'>" + i + "</a>"; } } if (x < n) { pageviewtop += " <a class='pl' href='?page=" + (x + 1) + "" + clinktail + "'>下1页</a> "; } else { pageviewtop += " <font color='#666666'>下1页</font> "; } if (endpage != n) { pageview += " <a class='pl' href='?page=" + (endpage + 1) + "" + clinktail + "' class='pl' onclink='return false;'>下10页</a> | "; } else { pageview += " | "; } if (x < n) { pageview += " <a class='pl' href='?page=" + n + "" + clinktail + "' class='pl'>第" + n + "页</a> "; pageviewtop += " | <a class='pl' href='?page=" + n + "" + clinktail + "' class='pl'>第" + n + "页</a> "; } else { pageview += "<font color='#666666'> 第" + n + "页 </font>"; pageviewtop += " | <font color='#666666'> 第" + n + "页 </font>"; } page_view.Text = pageview.ToString(); } else { page_view.Text = ""; } }
private object CType(object p, System.Web.UI.WebControls.Label label) { throw new Exception("The method or operation is not implemented."); }
public void AddControl(Screen Screen, Section Section, Control parent, Widget control) { try { bool IsControlVisible = true; bool IsControlEditable = true; ControlType controlType = null; ControlType labelControlType = null; BaseFieldTemplate ctrl = null; BaseFieldTemplate readOnlyCtrl = null; System.Web.UI.WebControls.BaseValidator val = null; HtmlGenericControl group = null; HtmlGenericControl labelContainer = null; System.Web.UI.WebControls.Label label = null; HtmlGenericControl controlContainer = null; PlaceHolder groupContainer = null; Control help = null; IsControlVisible = DetermineControlVisibility(control, IsControlVisible); IsControlEditable = DetermineIfControlIsEditable(control, IsControlVisible, IsControlEditable); //setup overall container groupContainer = new PlaceHolder(); groupContainer.ID = String.Format("{0}_GroupContainer", control.Name); groupContainer.Visible = IsControlVisible; //setup control group if needed if (!String.IsNullOrEmpty(control.ControlGroupElement)) { group = new HtmlGenericControl(control.ControlGroupElement); group.ID = String.Format("{0}_FormGroup", control.Name); if (!String.IsNullOrEmpty(control.ControlGroupCssClass)) { group.Attributes.Add("class", control.ControlGroupCssClass); } } //setup label container if needed if (!String.IsNullOrEmpty(control.LabelContainerElement)) { labelContainer = new HtmlGenericControl(control.LabelContainerElement); labelContainer.ID = String.Format("{0}_LabelContainer", control.Name); if (!String.IsNullOrEmpty(control.LabelContainerCssClass)) { labelContainer.Attributes.Add("class", control.LabelContainerCssClass); } } //setup control container if needed if (!String.IsNullOrEmpty(control.ControlContainerElement)) { controlContainer = new HtmlGenericControl(control.ControlContainerElement); controlContainer.ID = String.Format("{0}_ControlContainer", control.Name); if (!String.IsNullOrEmpty(control.ControlContainerCssClass)) { controlContainer.Attributes.Add("class", control.ControlContainerCssClass); } } //setup actual control controlType = ControlType.GetControlType(control); if (controlType == null) { throw new ApplicationException(String.Format("Control of type {0} could not be found in configuration", control.Type)); } if (!IsControlEditable) { labelControlType = ControlType.GetControlType("Label"); } if (controlType != null) { //main edit control ctrl = LoadBaseFieldTemplateFromControlType(controlType); ctrl.ID = control.Name; ctrl.ResourceKeyPrefix = String.Format("Screen.Sections.{0}.Control", Section.Name); BaseFieldTemplate renderControl = null; //alternate edit control in read only mode if (!IsControlEditable) { readOnlyCtrl = LoadBaseFieldTemplateFromControlType(labelControlType); readOnlyCtrl.ID = String.Format("{0}_ReadOnly_Label", control.Name); } if (IsControlEditable) { renderControl = ctrl; } else { renderControl = readOnlyCtrl; } //label label = new System.Web.UI.WebControls.Label(); label.ID = String.Format("{0}_Label", control.Name); if (!String.IsNullOrEmpty(control.LabelCssClass)) { string labelCss = String.Format("{0}", control.LabelCssClass); if (control.IsRequired) { labelCss += " required required-label"; } label.CssClass = labelCss; } if (!String.IsNullOrEmpty(control.Label)) { string labelText = GetGlobalResourceString(String.Format("Control.{0}.Label", control.Name), control.Label); labelText += ":"; label.Controls.Add(new LiteralControl(labelText)); } //help text if (!String.IsNullOrEmpty(control.HelpText)) { string helpText = GetGlobalResourceString(String.Format("Control.{0}.HelpText", control.Name), control.HelpText); if (String.IsNullOrEmpty(control.HelpTextElement)) { help = new LiteralControl(control.HelpText); } else { HtmlGenericControl helpControl = new HtmlGenericControl(control.HelpTextElement); helpControl.InnerHtml = control.HelpText; if (!String.IsNullOrEmpty(control.HelpTextCssClass)) { helpControl.Attributes.Add("class", control.HelpTextCssClass); } help = helpControl; } } //validation controls List <System.Web.UI.WebControls.BaseValidator> validators = new List <System.Web.UI.WebControls.BaseValidator>(); if (IsControlEditable) { //custom validators foreach (CodeTorch.Core.BaseValidator validator in control.Validators) { System.Web.UI.WebControls.BaseValidator validatorControl = GetValidator(control, validator); validators.Add(validatorControl); } } //assign base control, section and screen references ctrl.Widget = control; if (!IsControlEditable) { readOnlyCtrl.Widget = CreateLabelControlFromWidget(control); readOnlyCtrl.Value = ctrl.Value; readOnlyCtrl.SetDisplayText(ctrl.DisplayText); } ctrl.Section = Section; ctrl.Screen = Screen; //now that all controls have been defined we now need to render table html based on rendering mode if (group != null) { if (control.LabelWrapsControl) { AssignControl(group, labelContainer, label); AssignControl(label, controlContainer, renderControl, help); } else { label.AssociatedControlID = renderControl.ClientID; if (control.LabelRendersBeforeControl) { AssignControl(group, labelContainer, label); AssignControl(group, controlContainer, renderControl, help); } else { AssignControl(group, controlContainer, renderControl, help); AssignControl(group, labelContainer, label); } } } else { Control g = groupContainer;// (parent != null) ? (Control)parent : (Control)this.ContentPlaceHolder; if (control.LabelWrapsControl) { AssignControl(g, labelContainer, label); AssignControl(label, controlContainer, renderControl, help); } else { label.AssociatedControlID = renderControl.ClientID; if (control.LabelRendersBeforeControl) { AssignControl(g, labelContainer, label); AssignControl(g, controlContainer, renderControl, help); } else { AssignControl(g, controlContainer, renderControl, help); AssignControl(g, labelContainer, label); } } } if (parent != null) { if (group != null) { groupContainer.Controls.Add(group); } parent.Controls.Add(groupContainer); } else { if (group != null) { groupContainer.Controls.Add(group); } this.ContentPlaceHolder.Controls.Add(groupContainer); } string requiredErrorMessage = String.Format("{0} is required.", control.Label); string requiredErrorMessageResourceValue = GetGlobalResourceString(String.Format("Control.{0}.IsRequired.ErrorMessage", control.Name), requiredErrorMessage); //get container for validation Control valContainer = ((Control)controlContainer ?? ( (Control)group ?? ( ((Control)parent ?? (Control)this.ContentPlaceHolder) ) ) ); if (!String.IsNullOrEmpty(control.Name)) { if (ctrl.SupportsValidation()) { val = ctrl.GetRequiredValidator(control, IsControlEditable, requiredErrorMessageResourceValue); valContainer.Controls.Add(val); if (IsControlEditable) { //custom validators foreach (System.Web.UI.WebControls.BaseValidator validator in validators) { valContainer.Controls.Add(validator); } } } } } else { string ErrorMessageFormat = "<span style='color:red'>ERROR - Could not load control {0} - {1} - control type returned null object</span>"; string ErrorMessages = String.Format(ErrorMessageFormat, control.Name, control.Type); this.ContentPlaceHolder.Controls.Add(new LiteralControl(ErrorMessages)); } } catch (Exception ex) { this.ContentPlaceHolder.Controls.Add(new LiteralControl(ex.Message)); } }
protected void Rules_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { String id = Rules.DataKeys[e.Row.RowIndex].Value.ToString(); PackageRule rule = Settings.CostingRules[id]; Int32 rowIndex = (Rules.PageIndex * Rules.PageSize) + e.Row.RowIndex; if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) { if (rowIndex == Settings.CostingRules.Count - 1) { e.Row.FindControl("DeleteRow").Visible = false; e.Row.FindControl("MoveRuleUp").Visible = false; e.Row.FindControl("MoveRuleDown").Visible = false; } if (rowIndex == Settings.CostingRules.Count - 2) { e.Row.FindControl("MoveRuleDown").Visible = false; } if (rowIndex == 0) { e.Row.FindControl("MoveRuleUp").Visible = false; } } else if ((e.Row.RowState & DataControlRowState.Edit) == DataControlRowState.Edit) { DropDownList packagePropertyList = (DropDownList)e.Row.FindControl("ValuePackagePropertyField"); DropDownList itemPropertyList = (DropDownList)e.Row.FindControl("ValueItemPropertyField"); DropDownList customPropertyList = (DropDownList)e.Row.FindControl("ValueCustomPropertyField"); HelpLabel customPropertyLabel = (HelpLabel)e.Row.FindControl("ValueCustomPropertyLabel"); Label multiplierLabel = (Label)e.Row.FindControl("ValueMultiplierLabel"); HelpLabel valueLabel = (HelpLabel)e.Row.FindControl("ValueLabel"); TextBox valueField = (TextBox)e.Row.FindControl("ValueField"); BaseValidator valueRequired = (BaseValidator)e.Row.FindControl("ValueRequired"); BaseValidator valueNumeric = (BaseValidator)e.Row.FindControl("ValueNumeric"); packagePropertyList.Items.Clear(); packagePropertyList.Items.AddRange(GetPackageProperties()); itemPropertyList.Items.Clear(); itemPropertyList.Items.AddRange(GetItemProperties()); itemPropertyList.Visible = false; if (rule.ValuePackageProperty == PackageProperties.ItemProperty) { itemPropertyList.Visible = true; PrepareCustomPropertyField(customPropertyLabel, customPropertyList, rule.ValueItemProperty); PrepareValueField(multiplierLabel, valueLabel, valueField, valueRequired, valueNumeric, rule.ValueItemProperty); } else { PrepareCustomPropertyField(customPropertyLabel, customPropertyList, rule.ValuePackageProperty); PrepareValueField(multiplierLabel, valueLabel, valueField, valueRequired, valueNumeric, rule.ValuePackageProperty); } if (customPropertyList.Items.Count == 0) { customPropertyList.Items.Add(new ListItem("", rule.ValueCustomProperty)); } if (customPropertyList.Items.FindByValue(rule.ValueCustomProperty) == null) { rule.ValueCustomProperty = customPropertyList.Items[0].Value; } } } }
}//public static void PageBuild() /// <summary>PageBuildTextBox().</summary> public void PageBuildTextBox() { int dataTableCount = -1; int dataTableTotal = -1; int theWordIdColumnIndex = 0; DateTime dated = DateTime.Now; System.Web.UI.WebControls.Label label = null; String columnNameForeignKey = null; String exceptionMessage = null; String[] sourceName = null; String[] sourceSQL = null; String tableName = null; System.Web.UI.WebControls.TextBox textBox = null; XmlNodeList sourceXML = null; TheWord.SourceSQLQuery ( filenameConfigurationXml, ref exceptionMessage, ref sourceXML, ref sourceSQL, ref sourceName ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) if ( !Page.IsPostBack ) { theWord.DataSetInitialize ( databaseConnectionString, ref exceptionMessage, nodeRoot, sourceSQL, sourceName ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) }//if ( Page.IsPostBack ) UtilityXml.XmlDocumentNodeInnerText ( filenameConfigurationXml, ref exceptionMessage, TheWord.XPathColumnForeign, ref columnNameForeignKey ); dataTableTotal = theWord.DataSetTheWord.Tables.Count; linkButtonAdd = new System.Web.UI.WebControls.LinkButton[ dataTableTotal ]; for( dataTableCount = 0; dataTableCount < theWord.DataSetTheWord.Tables.Count; ++dataTableCount ) { theWord.DataSetTheWord.Tables[dataTableCount].TableName = sourceName[dataTableCount]; } dataTableCount = -1; foreach( DataTable dataTable in theWord.DataSetTheWord.Tables ) { ++dataTableCount; tableName = dataTable.TableName; PlaceHolderGridView.Controls.Add ( new LiteralControl ( "<b>" + tableName + "</b>" ) ); foreach(DataRow dataRow in dataTable.Rows) { foreach(DataColumn dataColumn in dataTable.Columns) { label = new System.Web.UI.WebControls.Label(); label.Id = "Label" + dataColumn.ColumnName; label.Text = dataColumn.ColumnName + ": "; PlaceHolderGridView.Controls.Add( label ); textBox = new System.Web.UI.WebControls.TextBox(); textBox.ID = "TextBox" + dataColumn.ColumnName; textBox.Text = dataRow[dataColumn].ToString(); PlaceHolderGridView.Controls.Add( textBox ); label = new System.Web.UI.WebControls.Label(); label.Text = "<br />"; PlaceHolderGridView.Controls.Add( label ); }//foreach(DataColumn dataColumn in dataTable.Columns) }//foreach(DataRow dataRow in dataTable.Rows) if ( dataTableCount == 0 ) { PlaceHolderGridView.Controls.Add ( new LiteralControl( "<br />" ) ); } else { linkButtonAdd[dataTableCount] = new System.Web.UI.WebControls.LinkButton(); linkButtonAdd[dataTableCount].ID = dataTableCount + "|" + tableName + "|" + "Add"; linkButtonAdd[dataTableCount].Text = " Add <br />"; // Register the event-handling method for the Click event. linkButtonAdd[dataTableCount].Click += new EventHandler(this.LinkButtonAdd_Click); PlaceHolderGridView.Controls.Add( linkButtonAdd[dataTableCount] ); } }//foreach( DataTable dataTable in theWord.DataSetTheWord.Tables ) }//public static void PageBuildTextBox()
protected void Btn_Simpan_Click(object sender, EventArgs e) { if (txt_nopo.Text != "") { if (txt_nodo.Text != "") { DataTable DDPO = new DataTable(); DDPO = DBCon.Ora_Execute_table("select acp_po_no,acp_do_no from ast_acceptance where acp_po_no='" + txt_nopo.Text.Trim() + "' and acp_do_no='" + txt_nodo.Text + "'"); if (DDPO.Rows.Count == 0) { string rcount = string.Empty; int count = 0; foreach (GridViewRow gvrow in GridView2.Rows) { var rb = (System.Web.UI.WebControls.TextBox)gvrow.Cells[1].FindControl("txt_simp"); if (rb.Text == "0") { count++; } rcount = count.ToString(); } if (rcount == "0") { DataTable ddicno = new DataTable(); foreach (GridViewRow grdRow in GridView2.Rows) { System.Web.UI.WebControls.TextBox abc = (System.Web.UI.WebControls.TextBox)grdRow.Cells[1].FindControl("TextBox2"); System.Web.UI.WebControls.TextBox def = (System.Web.UI.WebControls.TextBox)grdRow.Cells[1].FindControl("TextBox3"); System.Web.UI.WebControls.Label lab = (System.Web.UI.WebControls.Label)grdRow.Cells[1].FindControl("Label2"); System.Web.UI.WebControls.Label lab_sno = (System.Web.UI.WebControls.Label)grdRow.Cells[1].FindControl("Label4"); System.Web.UI.WebControls.CheckBox chk_cb = (System.Web.UI.WebControls.CheckBox)grdRow.Cells[1].FindControl("CheckBox1"); System.Web.UI.WebControls.TextBox IND = (System.Web.UI.WebControls.TextBox)grdRow.Cells[1].FindControl("TextBox4"); string EmployeeID = ((System.Web.UI.WebControls.TextBox)grdRow.FindControl("TextBox4")).Text.ToString(); string ind1 = string.Empty; if (EmployeeID == "0") { ind1 = "01"; } else { ind1 = "00"; } ddicno = DBCon.Ora_Execute_table("select pur_asset_cat_cd,pur_asset_sub_cat_cd,pur_asset_type_cd,pur_asset_cd,pur_asset_qty,pur_verify_remark,pur_verify_sts_cd,pur_verify_id,format(pur_verify_dt,'yyyy/MM/dd hh:mm:ss') pur_verify_dt,pur_verify_qty,pur_supplier_id from ast_purchase where pur_po_no='" + txt_nopo.Text.Trim() + "' and pur_asset_id='" + lab_sno.Text + "' "); DBCon.Execute_CommamdText("insert into ast_acceptance(acp_po_no,acp_do_no,acp_seq_no,acp_asset_cat_cd,acp_asset_sub_cat_cd,acp_asset_type_cd,acp_asset_cd,acp_receive_qty,acp_receive_remark,acp_complete_ind,acp_receive_id,acp_receive_dt,acp_tot_qty,acp_crt_id,acp_crt_dt,acp_supplier_id,acp_all_qty,acp_bal_qty) values('" + txt_nopo.Text + "','" + txt_nodo.Text + "','" + lab_sno.Text + "','" + ddicno.Rows[0]["pur_asset_cat_cd"].ToString() + "','" + ddicno.Rows[0]["pur_asset_sub_cat_cd"].ToString() + "','" + ddicno.Rows[0]["pur_asset_type_cd"].ToString() + "','" + ddicno.Rows[0]["pur_asset_cd"].ToString() + "','" + abc.Text + "','" + def.Text.Replace("'", "''") + "','" + ind1 + "','" + ddicno.Rows[0]["pur_verify_id"].ToString() + "','" + ddicno.Rows[0]["pur_verify_dt"].ToString() + "','" + ddicno.Rows[0]["pur_verify_qty"].ToString() + "','" + Session["New"].ToString() + "','" + DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss") + "','" + ddicno.Rows[0]["pur_supplier_id"].ToString() + "','0','" + EmployeeID + "')"); if (ind1 == "01") { DataTable DDPO1 = new DataTable(); DDPO1 = DBCon.Ora_Execute_table("select * from ast_acceptance where acp_po_no='" + txt_nopo.Text.Trim() + "' and acp_asset_cat_cd='" + ddicno.Rows[0]["pur_asset_cat_cd"].ToString() + "' and acp_asset_sub_cat_cd='" + ddicno.Rows[0]["pur_asset_sub_cat_cd"].ToString() + "' and acp_asset_type_cd='" + ddicno.Rows[0]["pur_asset_type_cd"].ToString() + "' and acp_asset_cd='" + ddicno.Rows[0]["pur_asset_cd"].ToString() + "' and acp_seq_no='" + lab_sno.Text + "'"); if (DDPO1.Rows.Count > 1) { DBCon.Execute_CommamdText("UPDATE ast_acceptance set acp_complete_ind='" + ind1 + "' where acp_po_no='" + txt_nopo.Text.Trim() + "' and acp_asset_cat_cd='" + ddicno.Rows[0]["pur_asset_cat_cd"].ToString() + "' and acp_asset_sub_cat_cd='" + ddicno.Rows[0]["pur_asset_sub_cat_cd"].ToString() + "' and acp_asset_type_cd='" + ddicno.Rows[0]["pur_asset_type_cd"].ToString() + "' and acp_asset_cd='" + ddicno.Rows[0]["pur_asset_cd"].ToString() + "' and acp_seq_no='" + lab_sno.Text + "'"); } DBCon.Execute_CommamdText("UPDATE ast_purchase set pur_complete_ind='" + ind1 + "' where pur_po_no='" + txt_nopo.Text.Trim() + "' and pur_asset_id='" + lab_sno.Text + "'"); } } txt_nodo.Text = ""; ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Rekod Berjaya Disimpan',{'type': 'confirmation','title': 'Success','auto_close': 2000});", true); grid(); grid1(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukan Kuantiti Diterima.',{'type': 'warning','title': 'warning','auto_close': 2000});", true); } } else { // fgrd.Attributes.Remove("Style"); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('No DO Telah Wujud.',{'type': 'warning','title': 'warning','auto_close': 2000});", true); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan No DO.',{'type': 'warning','title': 'warning','auto_close': 2000});", true); } } else { grid(); grid1(); ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Sila Masukkan No PO.',{'type': 'warning','title': 'warning','auto_close': 2000});", true); } }
protected void GridviewKonular_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "aktif") { int userID = Convert.ToInt32(e.CommandArgument); Subject c = subislem.TekGetir(userID); if (c.IsActive == true) { if (subislem.DurumGuncelle(userID, false)) { Doldur(); } } else { if (subislem.DurumGuncelle(userID, true)) { Doldur(); } } } GridViewRow secilenSatir; int id; switch (e.CommandName) { case "duzenle": secilenSatir = (e.CommandSource as LinkButton).Parent.Parent as GridViewRow; id = Convert.ToInt32(e.CommandArgument); GridviewKonular.EditIndex = secilenSatir.RowIndex; Doldur(); break; case "guncelle": secilenSatir = (e.CommandSource as LinkButton).Parent.Parent as GridViewRow; id = Convert.ToInt32(e.CommandArgument); System.Web.UI.WebControls.Label lbl4 = (System.Web.UI.WebControls.Label)(secilenSatir.FindControl("Label1")); System.Web.UI.WebControls.TextBox txt4 = (System.Web.UI.WebControls.TextBox)(secilenSatir.FindControl("txtAd")); System.Web.UI.WebControls.TextBox txt5 = (System.Web.UI.WebControls.TextBox)(secilenSatir.FindControl("txtAcilis")); System.Web.UI.WebControls.DropDownList ddl1 = (System.Web.UI.WebControls.DropDownList)(secilenSatir.FindControl("dropdownBolum")); Subject konu = subislem.TekGetir(id); konu.CreatedDate = Convert.ToDateTime(txt5.Text); konu.Name = txt4.Text; konu.SectionID = Convert.ToInt32(ddl1.SelectedValue); if (subislem.Guncelle(konu)) { GridviewKonular.EditIndex = -1; Doldur(); } break; case "iptal": GridviewKonular.EditIndex = -1; Doldur(); break; default: break; } }
private void BindChart(Chart chart , DataTable dt , string titleName , System.Web.UI.WebControls.Label lbl) { DundasCharts.DundasChartBase(chart , ChartImageType.Flash , 330 , 300 , BorderSkinStyle.Emboss , Color.FromArgb(181, 64, 1) , 2 , Color.FromArgb(0xFF, 0xFF, 0xFE) , Color.FromArgb(0xFF, 0xFF, 0xFE) , Color.FromArgb(0x20, 0x80, 0xD0) , ChartDashStyle.Solid , -1 , ChartHatchStyle.None , GradientType.TopBottom , AntiAliasing.None); Series series1 = DundasCharts.CreateSeries(chart , "Series1" , "Default" , null , null , SeriesChartType.Doughnut , 1 , GetChartColor(0) , Color.FromArgb(0x4A, 0x58, 0x7E) , Color.FromArgb(64, 0, 0, 0) , 1 , 9 , Color.FromArgb(64, 64, 64)); //series1.Label = "#VALY{N0}"; series1.ToolTip = "#VALY{N0}"; //series1.ShowLabelAsValue = true; //series1.ShowInLegend = true; chart.ChartAreas["Default"].AxisY.LabelStyle.Format = "N0"; DundasAnimations.DundasChartBase(chart, AnimationTheme.None, -1, -1, false, 1); DundasAnimations.GrowingAnimation(chart, series1, 0.5, 1.5, true); //for (int i = 0; i < dt.Rows.Count; i++) //{ // series1.Points[i].AxisLabel = dt.Rows[i]["ALIAS"].ToString(); //} //for (int i = 0; i < dt.Rows.Count; i++) //{ // series1.Points.AddY(dt.Rows[i]["RESULT_TS"]); //} DataTable dtData = DataTypeUtility.FilterSortDataTable(dt, "KPI_REF_ID > 0"); for (int i = 0; i < dtData.Rows.Count; i++) { series1.Points.AddXY(dt.Rows[i]["TEXT"].ToString(), dt.Rows[i]["RESULT_TS"]); } if (series1.Type == SeriesChartType.Pie || series1.Type == SeriesChartType.Doughnut) { for (int p = 0; p < series1.Points.Count; p++) { DataPoint point = series1.Points[p]; point.Color = GetChartColor(p); } } //series1.ToolTip = "#VALY{#,##0,00}"; //series2.ToolTip = "#VALY{#,##0}"; //series2.MarkerStyle = MarkerStyle.Circle; //series2.MarkerColor = Color.FromArgb(0xFF, 0xAA, 0x20); //series2.MarkerBorderColor = Color.FromArgb(0xD7, 0x41, 0x01); Font font = new Font("Gulim", 11, FontStyle.Regular); Dundas.Charting.WebControl.Title title = DundasCharts.CreateTitle(chart , "Title1" , titleName , font , Color.FromArgb(26, 59, 105) , Color.Empty , Color.Empty , ContentAlignment.TopCenter , null , Color.FromArgb(32, 0, 0, 0) , 3 , false , 5 , 7 , 91 , 6); Legend legend = DundasCharts.CreateLegend(chart , "Default" , Color.Transparent , Color.Empty , Color.Empty); series1.Font = new Font("굴림", 8, FontStyle.Regular); series1["PieLabelStyle"] = "Outside"; legend.LegendStyle = LegendStyle.Table; legend.AutoFitText = false; legend.Docking = LegendDocking.Bottom; //legend.Alignment = StringAlignment.Near; //legend.Position = new ElementPosition(60, 7, 50, 24); //legend.Enabled = false; //legend.DockInsideChartArea = true; //chart.ChartAreas["Default"].AlignOrientation = AreaAlignOrientation.Horizontal; DundasCharts.SetChartArea(chart.ChartAreas["Default"], true); DataRow[] drCol = dt.Select(string.Format("KPI_REF_ID < 0")); if (drCol.Length > 0) { lbl.Text = DataTypeUtility.GetToDouble(drCol[0]["RESULT_TS"]).ToString("#,##0"); } else { lbl.Text = "0"; } }
protected void btnZonas_Click(object sender, EventArgs e) { string repetidos = ""; int cantZonas = 0; int conteo = 0; try { if (txtZonas.Text.Length <= 0) { System.Web.UI.WebControls.Label l = new System.Web.UI.WebControls.Label(); l.Text = "<div class='alert' style='margin-bottom: 5px;'>" + "<button type='button' class='close' data-dismiss='alert'>×</button>" + "<strong>Advertencia!!</strong>" + " Favor de colocar el número de zonas que desea crear" + ".</div>"; logerror.Controls.Add(l); } else { cantZonas = Convert.ToInt32(txtZonas.Text.ToString()); for (int x = 0; x < cantZonas; x++) { if (con.getInt("select count(*) from Zonas where ClaveZona ='" + ABC[x] + "'") == 1) { repetidos += " " + ABC[x].ToString(); } else { conteo += con.insert("INSERT INTO Zonas VALUES('" + ABC[x] + "','')"); } } if (conteo == 0) { System.Web.UI.WebControls.Label l = new System.Web.UI.WebControls.Label(); l.Text = "<div class='alert alert-info' style='margin-bottom: 5px;'>" + "<button type='button' class='close' data-dismiss='alert'>×</button>" + "<strong>Informacion!!</strong>" + " No se creó ninguna zona, dado a que existian previamente. \nLas zonas " + repetidos + " ya existian en el almacén.</div>"; logerror.Controls.Add(l); btnSiguiente.Visible = true; } else { if (conteo == cantZonas) { System.Web.UI.WebControls.Label l = new System.Web.UI.WebControls.Label(); l.Text = "<div class='alert alert-success' style='margin-bottom: 5px;'>" + "<button type='button' class='close' data-dismiss='alert'>×</button>" + "<strong>Correcto!! </strong>Se han creado las " + cantZonas + " zonas correctamente.</div>"; logsuccess.Controls.Add(l); btnZonas.Enabled = false; btnSiguiente.Visible = true; } else { System.Web.UI.WebControls.Label l = new System.Web.UI.WebControls.Label(); l.Text = "<div class='alert alert-success' style='margin-bottom: 5px;'>" + "<button type='button' class='close' data-dismiss='alert'>×</button>" + "<strong>Correcto!! </strong> Se han creado " + conteo + " de las " + cantZonas + " zonas correctamente.</div>"; logsuccess.Controls.Add(l); btnZonas.Enabled = false; btnSiguiente.Visible = true; if (repetidos.Length > 0) { System.Web.UI.WebControls.Label m = new System.Web.UI.WebControls.Label(); m.Text = "<div class='alert alert-info' style='margin-bottom: 5px;'>" + "<button type='button' class='close' data-dismiss='alert'>×</button>" + "<strong>Información!! </strong> Las zonas " + repetidos + " ya existian en el almacén.</div>"; logerror.Controls.Add(m); } } } } } catch (Exception ex) { }; }
public void getAllInvItems() { objPRReq.OID = oid; objPRReq.Status = "Active"; PRResp r = objPRIBC.getItemTypes(objPRReq); DataTable dt = r.GetTable; if (dt.Rows.Count > 0) { rptr_Inventory.DataSource = dt; rptr_Inventory.DataBind(); lbl_Count.Text = "No.of Items Listed :" + dt.Rows.Count.ToString(); lbl_ItemCount.Text = "No.of Items Listed : " + dt.Rows.Count.ToString(); lbl_Dated.Text = DateTime.Now.ToString(); for (int i = 0; i < dt.Rows.Count; i++) { Label lbl_active = rptr_Inventory.Items[i].FindControl("lbl_active") as Label; Label lbl_idle = rptr_Inventory.Items[i].FindControl("lbl_idle") as Label; Label lbl_inactive = rptr_Inventory.Items[i].FindControl("lbl_inactive") as Label; Label lbl_abandoned = rptr_Inventory.Items[i].FindControl("lbl_abandoned") as Label; Label lbl_Total = rptr_Inventory.Items[i].FindControl("lbl_total") as Label; objPRReq.ItemName = dt.Rows[i]["ItemType"].ToString(); objPRReq.Status = "Active"; PRResp rname = objPRIBC.getAllItemInventory_ITemName_Status(objPRReq); DataTable dtname = rname.GetTable; if (dtname.Rows.Count > 0) { active = int.Parse(dtname.Rows.Count.ToString()); lbl_active.Text = active.ToString(); tactive += active; } else { lbl_active.Text = "0"; } objPRReq.Status = "Idle"; PRResp rw = objPRIBC.getAllItemInventory_ITemName_Status(objPRReq); DataTable dtw = rw.GetTable; if (dtw.Rows.Count > 0) { idle = int.Parse(dtw.Rows.Count.ToString()); lbl_idle.Text = idle.ToString(); tidle += idle; } else { lbl_idle.Text = "0"; } objPRReq.Status = "Inactive"; PRResp rww = objPRIBC.getAllItemInventory_ITemName_Status(objPRReq); DataTable dtww = rww.GetTable; if (dtww.Rows.Count > 0) { inactive = int.Parse(dtww.Rows.Count.ToString()); lbl_inactive.Text = inactive.ToString(); tinactive += inactive; } else { lbl_inactive.Text = "0"; } objPRReq.Status = "Abandoned"; rww = objPRIBC.getAllItemInventory_ITemName_Status(objPRReq); dtww = rww.GetTable; if (dtww.Rows.Count > 0) { abandoned = int.Parse(dtww.Rows.Count.ToString()); lbl_abandoned.Text = abandoned.ToString(); tabandoned += abandoned; } else { lbl_abandoned.Text = "0"; } tot = active + idle + inactive + abandoned; if (objPRReq.ItemName == "Printer") { printer.Text = "Total: " + tot + " Active: " + active + " Idle: " + idle + " Inactive: " + inactive; } if (objPRReq.ItemName == "Laptop") { laptop.Text = "Total: " + tot + " Active: " + active + " Idle: " + idle + " Inactive: " + inactive; } if (objPRReq.ItemName == "Desktop") { desktop.Text = "Total: " + tot + " Active: " + active + " Idle: " + idle + " Inactive: " + inactive; } if (objPRReq.ItemName == "Scanner") { scanner.Text = "Total: " + tot + " Active: " + active + " Idle: " + idle + " Inactive: " + inactive; } lbl_Total.Text = tot.ToString(); active = 0; idle = 0; inactive = 0; abandoned = 0; ttot += tot; } System.Web.UI.WebControls.Label lbl_tactive = rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("lbl_tactive") as System.Web.UI.WebControls.Label; lbl_tactive.Text = tactive.ToString(); System.Web.UI.WebControls.Label lbl_tidle = rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("lbl_tidle") as System.Web.UI.WebControls.Label; lbl_tidle.Text = tidle.ToString(); System.Web.UI.WebControls.Label lbl_tinactive = rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("lbl_tinactive") as System.Web.UI.WebControls.Label; lbl_tinactive.Text = tinactive.ToString(); System.Web.UI.WebControls.Label lbl_tabandoned = rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("lbl_tabandoned") as System.Web.UI.WebControls.Label; lbl_tabandoned.Text = tabandoned.ToString(); System.Web.UI.WebControls.Label lbl_gTot = rptr_Inventory.Controls[rptr_Inventory.Controls.Count - 1].Controls[0].FindControl("lbl_GTotal") as System.Web.UI.WebControls.Label; lbl_gTot.Text = ttot.ToString(); } else { rptr_Inventory.DataSource = dt; rptr_Inventory.DataBind(); lbl_Count.Text = "No.of Items Listed :" + dt.Rows.Count.ToString(); } }
/// <summary> /// rpt内容控制 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void rptGZQD_ItemDataBound(object sender, RepeaterItemEventArgs e) { string sqltext = "select sum(QD_JCGZ) as QD_JCGZhj,sum(QD_GZGL) as QD_GZGLhj,sum(QD_GDGZ) as QD_GDGZhj,sum(QD_JXGZ) as QD_JXGZhj,sum(QD_JiangLi) as QD_JiangLihj,sum(QD_BingJiaGZ) as QD_BingJiaGZhj,sum(QD_JiaBanGZ) as QD_JiaBanGZhj,sum(QD_BFJB) as QD_BFJBhj,sum(QD_ZYBF) as QD_ZYBFhj,sum(QD_BFZYB) as QD_BFZYBhj,sum(QD_NianJiaGZ) as QD_NianJiaGZhj,sum(QD_YKGW) as QD_YKGWhj,sum(QD_TZBF) as QD_TZBFhj,sum(QD_TZBK) as QD_TZBKhj,sum(QD_JTBT) as QD_JTBThj,sum(QD_FSJW) as QD_FSJWhj,sum(QD_CLBT) as QD_CLBThj,sum(QD_QTFY) as QD_QTFYhj,(sum(QD_JCGZ)+sum(QD_GZGL)+sum(QD_GDGZ)+sum(QD_JXGZ)+sum(QD_JiangLi)+sum(QD_BingJiaGZ)+sum(QD_JiaBanGZ)+sum(QD_BFJB)+sum(QD_ZYBF)+sum(QD_BFZYB)+sum(QD_NianJiaGZ)+sum(QD_YKGW)+sum(QD_TZBF)+sum(QD_TZBK)+sum(QD_JTBT)+sum(QD_FSJW)+sum(QD_CLBT)+sum(QD_QTFY)) as QD_YFHJhj,sum(QD_YLBX) as QD_YLBXhj,sum(QD_SYBX) as QD_SYBXhj,sum(QD_YiLiaoBX) as QD_YiLiaoBXhj,sum(QD_DEJZ) as QD_DEJZhj,sum(QD_BuBX) as QD_BuBXhj,sum(QD_GJJ) as QD_GJJhj,sum(QD_BGJJ) as QD_BGJJhj,sum(QD_ShuiDian) as QD_ShuiDianhj,sum(QD_GeShui) as QD_GeShuihj,(sum(QD_YLBX)+sum(QD_SYBX)+sum(QD_YiLiaoBX)+sum(QD_DEJZ)+sum(QD_BuBX)+sum(QD_GJJ)+sum(QD_BGJJ)+sum(QD_ShuiDian)+sum(QD_GeShui)+sum(QD_KOUXIANG)) as QD_DaiKouXJhj,((sum(QD_JCGZ)+sum(QD_GZGL)+sum(QD_GDGZ)+sum(QD_JXGZ)+sum(QD_JiangLi)+sum(QD_BingJiaGZ)+sum(QD_JiaBanGZ)+sum(QD_BFJB)+sum(QD_ZYBF)+sum(QD_BFZYB)+sum(QD_NianJiaGZ)+sum(QD_YKGW)+sum(QD_TZBF)+sum(QD_TZBK)+sum(QD_JTBT)+sum(QD_FSJW)+sum(QD_CLBT)+sum(QD_QTFY))-(sum(QD_YLBX)+sum(QD_SYBX)+sum(QD_YiLiaoBX)+sum(QD_DEJZ)+sum(QD_BuBX)+sum(QD_GJJ)+sum(QD_BGJJ)+sum(QD_ShuiDian)+sum(QD_GeShui)+sum(QD_KOUXIANG))) as QD_ShiFaJEhj,((sum(QD_JCGZ)+sum(QD_GZGL)+sum(QD_GDGZ)+sum(QD_JXGZ)+sum(QD_JiangLi)+sum(QD_BingJiaGZ)+sum(QD_JiaBanGZ)+sum(QD_BFJB)+sum(QD_ZYBF)+sum(QD_BFZYB)+sum(QD_NianJiaGZ)+sum(QD_YKGW)+sum(QD_TZBF)+sum(QD_TZBK)+sum(QD_JTBT)+sum(QD_FSJW)+sum(QD_QTFY))-(sum(QD_YLBX)+sum(QD_SYBX)+sum(QD_YiLiaoBX)+sum(QD_DEJZ)+sum(QD_BuBX)+sum(QD_GJJ)+sum(QD_BGJJ))-sum(QD_KOUXIANG)) as QD_KOUSJShj from (select * from View_OM_GZQDeditJL left join OM_KQTJ on (View_OM_GZQDeditJL.QD_STID=OM_KQTJ.KQ_ST_ID and View_OM_GZQDeditJL.QD_YEARMONTH=OM_KQTJ.KQ_DATE))t where " + StrWhere(); System.Data.DataTable dt000 = DBCallCommon.GetDTUsingSqlText(sqltext); if (e.Item.ItemType == ListItemType.Header) { if (cbxBumen.Checked) { HtmlTableCell Bumen = e.Item.FindControl("tdBumen") as HtmlTableCell; Bumen.Visible = false; } if (cbxbanzu.Checked) { HtmlTableCell Banzu = e.Item.FindControl("tdBanzu") as HtmlTableCell; Banzu.Visible = false; } if (cbxgh.Checked) { HtmlTableCell gonghao = e.Item.FindControl("tdgonghao") as HtmlTableCell; gonghao.Visible = false; } if (cbxgw.Checked) { HtmlTableCell gangwei = e.Item.FindControl("tdgangwei") as HtmlTableCell; gangwei.Visible = false; } if (cbxKaoqin.Checked) { HtmlTableCell YCQHJ = e.Item.FindControl("tdYCQHJ") as HtmlTableCell; HtmlTableCell JRwork = e.Item.FindControl("tdJRwork") as HtmlTableCell; HtmlTableCell Zhouwork = e.Item.FindControl("tdZhouwork") as HtmlTableCell; HtmlTableCell Riwork = e.Item.FindControl("tdRiwork") as HtmlTableCell; HtmlTableCell Yeban = e.Item.FindControl("tdYeban") as HtmlTableCell; HtmlTableCell Bingjia = e.Item.FindControl("tdBingjia") as HtmlTableCell; HtmlTableCell Shijia = e.Item.FindControl("tdShijia") as HtmlTableCell; HtmlTableCell Nianjia = e.Item.FindControl("tdNianjia") as HtmlTableCell; YCQHJ.Visible = false; JRwork.Visible = false; Zhouwork.Visible = false; Bingjia.Visible = false; Yeban.Visible = false; Shijia.Visible = false; Nianjia.Visible = false; Riwork.Visible = false; } if (cbxWXYJ.Checked) { HtmlTableCell YangLBX = e.Item.FindControl("tdYangLBX") as HtmlTableCell; HtmlTableCell SYBX = e.Item.FindControl("tdSYBX") as HtmlTableCell; HtmlTableCell YiLBX = e.Item.FindControl("tdYiLBX") as HtmlTableCell; HtmlTableCell DEJiuZhu = e.Item.FindControl("tdDEJiuZhu") as HtmlTableCell; HtmlTableCell BuBX = e.Item.FindControl("tdBuBX") as HtmlTableCell; HtmlTableCell GJJ = e.Item.FindControl("tdGJJ") as HtmlTableCell; HtmlTableCell BGJJ = e.Item.FindControl("tdBGJJ") as HtmlTableCell; YangLBX.Visible = false; SYBX.Visible = false; YiLBX.Visible = false; DEJiuZhu.Visible = false; BuBX.Visible = false; GJJ.Visible = false; BGJJ.Visible = false; } } if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { if (cbxBumen.Checked) { HtmlTableCell tdQD_BuMen = e.Item.FindControl("tdQD_BuMen") as HtmlTableCell; tdQD_BuMen.Visible = false; } if (cbxbanzu.Checked) { HtmlTableCell tdQD_BanZu = e.Item.FindControl("tdQD_BanZu") as HtmlTableCell; tdQD_BanZu.Visible = false; } if (cbxgh.Checked) { HtmlTableCell workno = e.Item.FindControl("tdQD_Worknumber") as HtmlTableCell; workno.Visible = false; } if (cbxgw.Checked) { HtmlTableCell gangw = e.Item.FindControl("tdQD_GangWe") as HtmlTableCell; gangw.Visible = false; } if (cbxKaoqin.Checked) { HtmlTableCell tdKQ_CHUQIN = e.Item.FindControl("tdKQ_CHUQIN") as HtmlTableCell; HtmlTableCell tdKQ_JRJIAB = e.Item.FindControl("tdKQ_JRJIAB") as HtmlTableCell; HtmlTableCell tdKQ_ZMJBAN = e.Item.FindControl("tdKQ_ZMJBAN") as HtmlTableCell; HtmlTableCell tdKQ_YSGZ = e.Item.FindControl("tdKQ_YSGZ") as HtmlTableCell; HtmlTableCell tdKQ_YEBAN = e.Item.FindControl("tdKQ_YEBAN") as HtmlTableCell; HtmlTableCell tdKQ_BINGJ = e.Item.FindControl("tdKQ_BINGJ") as HtmlTableCell; HtmlTableCell tdKQ_SHIJ = e.Item.FindControl("tdKQ_SHIJ") as HtmlTableCell; HtmlTableCell tdKQ_NIANX = e.Item.FindControl("tdKQ_NIANX") as HtmlTableCell; tdKQ_CHUQIN.Visible = false; tdKQ_JRJIAB.Visible = false; tdKQ_ZMJBAN.Visible = false; tdKQ_YSGZ.Visible = false; tdKQ_YEBAN.Visible = false; tdKQ_BINGJ.Visible = false; tdKQ_SHIJ.Visible = false; tdKQ_NIANX.Visible = false; } if (cbxWXYJ.Checked) { HtmlTableCell tdQD_YLBX = e.Item.FindControl("tdQD_YLBX") as HtmlTableCell; HtmlTableCell tdQD_SYBX = e.Item.FindControl("tdQD_SYBX") as HtmlTableCell; HtmlTableCell tdQD_YiLiaoBX = e.Item.FindControl("tdQD_YiLiaoBX") as HtmlTableCell; HtmlTableCell tdQD_DEJZ = e.Item.FindControl("tdQD_DEJZ") as HtmlTableCell; HtmlTableCell tdQD_BuBX = e.Item.FindControl("tdQD_BuBX") as HtmlTableCell; HtmlTableCell tdQD_GJJ = e.Item.FindControl("tdQD_GJJ") as HtmlTableCell; HtmlTableCell tdQD_BGJJ = e.Item.FindControl("tdQD_BGJJ") as HtmlTableCell; tdQD_YLBX.Visible = false; tdQD_SYBX.Visible = false; tdQD_YiLiaoBX.Visible = false; tdQD_DEJZ.Visible = false; tdQD_BuBX.Visible = false; tdQD_GJJ.Visible = false; tdQD_BGJJ.Visible = false; } } if (e.Item.ItemType == ListItemType.Footer) { if (dt000.Rows.Count > 0) { System.Web.UI.WebControls.Label lb_QD_JCGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_JCGZhj"); System.Web.UI.WebControls.Label lb_QD_GZGLhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_GZGLhj"); System.Web.UI.WebControls.Label lb_QD_GDGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_GDGZhj"); System.Web.UI.WebControls.Label lb_QD_JXGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_JXGZhj"); System.Web.UI.WebControls.Label lb_QD_JiangLihj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_JiangLihj"); System.Web.UI.WebControls.Label lb_QD_BingJiaGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_BingJiaGZhj"); System.Web.UI.WebControls.Label lb_QD_JiaBanGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_JiaBanGZhj"); System.Web.UI.WebControls.Label lb_QD_BFJBhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_BFJBhj"); System.Web.UI.WebControls.Label lb_QD_ZYBFhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_ZYBFhj"); System.Web.UI.WebControls.Label lb_QD_BFZYBhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_BFZYBhj"); System.Web.UI.WebControls.Label lb_QD_NianJiaGZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_NianJiaGZhj"); System.Web.UI.WebControls.Label lb_QD_YKGWhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_YKGWhj"); System.Web.UI.WebControls.Label lb_QD_TZBFhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_TZBFhj"); System.Web.UI.WebControls.Label lb_QD_TZBKhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_TZBKhj"); System.Web.UI.WebControls.Label lb_QD_JTBThj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_JTBThj"); System.Web.UI.WebControls.Label lb_QD_FSJWhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_FSJWhj"); System.Web.UI.WebControls.Label lb_QD_CLBThj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_CLBThj"); System.Web.UI.WebControls.Label lb_QD_QTFYhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_QTFYhj"); System.Web.UI.WebControls.Label lb_QD_YFHJhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_YFHJhj"); System.Web.UI.WebControls.Label lb_QD_YLBXhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_YLBXhj"); System.Web.UI.WebControls.Label lb_QD_SYBXhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_SYBXhj"); System.Web.UI.WebControls.Label lb_QD_YiLiaoBXhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_YiLiaoBXhj"); System.Web.UI.WebControls.Label lb_QD_DEJZhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_DEJZhj"); System.Web.UI.WebControls.Label lb_QD_BuBXhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_BuBXhj"); System.Web.UI.WebControls.Label lb_QD_GJJhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_GJJhj"); System.Web.UI.WebControls.Label lb_QD_BGJJhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_BGJJhj"); System.Web.UI.WebControls.Label lb_QD_ShuiDianhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_ShuiDianhj"); System.Web.UI.WebControls.Label lb_QD_GeShuihj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_GeShuihj"); System.Web.UI.WebControls.Label lb_QD_DaiKouXJhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_DaiKouXJhj"); System.Web.UI.WebControls.Label lb_QD_ShiFaJEhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_ShiFaJEhj"); System.Web.UI.WebControls.Label lb_QD_KOUSJShj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_QD_KOUSJShj"); lb_QD_JCGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_JCGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_GZGLhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_GZGLhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_GDGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_GDGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_JXGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_JXGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_JiangLihj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_JiangLihj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_BingJiaGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_BingJiaGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_JiaBanGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_JiaBanGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_BFJBhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_BFJBhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_ZYBFhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_ZYBFhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_BFZYBhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_BFZYBhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_NianJiaGZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_NianJiaGZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_YKGWhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_YKGWhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_TZBFhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_TZBFhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_TZBKhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_TZBKhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_JTBThj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_JTBThj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_FSJWhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_FSJWhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_CLBThj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_CLBThj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_QTFYhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_QTFYhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_YFHJhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_YFHJhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_YLBXhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_YLBXhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_SYBXhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_SYBXhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_YiLiaoBXhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_YiLiaoBXhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_DEJZhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_DEJZhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_BuBXhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_BuBXhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_GJJhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_GJJhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_BGJJhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_BGJJhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_ShuiDianhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_ShuiDianhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_GeShuihj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_GeShuihj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_DaiKouXJhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_DaiKouXJhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_ShiFaJEhj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_ShiFaJEhj"].ToString().Trim()), 2)).ToString().Trim(); lb_QD_KOUSJShj.Text = (Math.Round(CommonFun.ComTryDecimal(dt000.Rows[0]["QD_KOUSJShj"].ToString().Trim()), 2)).ToString().Trim(); } if (cbxBumen.Checked) { HtmlTableCell tdfootbm = e.Item.FindControl("tdfootbm") as HtmlTableCell; tdfootbm.Visible = false; } if (cbxbanzu.Checked) { HtmlTableCell tdfootbz = e.Item.FindControl("tdfootbz") as HtmlTableCell; tdfootbz.Visible = false; } if (cbxgh.Checked) { HtmlTableCell tdfoot1 = e.Item.FindControl("tdfoot1") as HtmlTableCell; tdfoot1.Visible = false; } if (cbxgw.Checked) { HtmlTableCell tdfootgw = e.Item.FindControl("tdfootgw") as HtmlTableCell; tdfootgw.Visible = false; } if (cbxKaoqin.Checked) { HtmlTableCell tdfoot2 = e.Item.FindControl("tdfoot2") as HtmlTableCell; tdfoot2.Visible = false; } if (cbxWXYJ.Checked) { HtmlTableCell tdQD_YLBXhj = e.Item.FindControl("tdQD_YLBXhj") as HtmlTableCell; HtmlTableCell tdQD_SYBXhj = e.Item.FindControl("tdQD_SYBXhj") as HtmlTableCell; HtmlTableCell tdQD_YiLiaoBXhj = e.Item.FindControl("tdQD_YiLiaoBXhj") as HtmlTableCell; HtmlTableCell tdQD_DEJZhj = e.Item.FindControl("tdQD_DEJZhj") as HtmlTableCell; HtmlTableCell tdQD_BuBXhj = e.Item.FindControl("tdQD_BuBXhj") as HtmlTableCell; HtmlTableCell tdQD_GJJhj = e.Item.FindControl("tdQD_GJJhj") as HtmlTableCell; HtmlTableCell tdQD_BGJJhj = e.Item.FindControl("tdQD_BGJJhj") as HtmlTableCell; tdQD_YLBXhj.Visible = false; tdQD_SYBXhj.Visible = false; tdQD_YiLiaoBXhj.Visible = false; tdQD_DEJZhj.Visible = false; tdQD_BuBXhj.Visible = false; tdQD_GJJhj.Visible = false; tdQD_BGJJhj.Visible = false; } } }
}//Page_Load /// <summary>PageBuild().</summary> public void PageBuild() { int dataTableCount = -1; int dataTableTotal = -1; int theWordIdColumnIndex = 0; DateTime dated = DateTime.Now; System.Web.UI.WebControls.Label label = null; String columnNameForeignKey = null; String exceptionMessage = null; String[] sourceName = null; String[] sourceSQL = null; String tableName = null; System.Web.UI.WebControls.TextBox textBox = null; XmlNodeList sourceXML = null; TheWord.SourceSQLQuery ( filenameConfigurationXml, ref exceptionMessage, ref sourceXML, ref sourceSQL, ref sourceName ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) if ( !Page.IsPostBack ) { theWord.DataSetInitialize ( databaseConnectionString, ref exceptionMessage, nodeRoot, sourceSQL, sourceName ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; return; }//if ( exceptionMessage != null ) }//if ( Page.IsPostBack ) UtilityXml.XmlDocumentNodeInnerText ( filenameConfigurationXml, ref exceptionMessage, TheWord.XPathColumnForeign, ref columnNameForeignKey ); dataTableTotal = theWord.DataSetTheWord.Tables.Count; GridViewTheWord = new System.Web.UI.WebControls.GridView[ dataTableTotal ]; linkButtonAdd = new System.Web.UI.WebControls.LinkButton[ dataTableTotal ]; for( dataTableCount = 0; dataTableCount < theWord.DataSetTheWord.Tables.Count; ++dataTableCount ) { theWord.DataSetTheWord.Tables[dataTableCount].TableName = sourceName[dataTableCount]; } dataTableCount = -1; foreach( DataTable dataTable in theWord.DataSetTheWord.Tables ) { ++dataTableCount; GridViewTheWord[dataTableCount] = new System.Web.UI.WebControls.GridView(); tableName = dataTable.TableName; GridViewTheWord[dataTableCount].BorderWidth = 1; GridViewTheWord[dataTableCount].CellPadding = 1; GridViewTheWord[dataTableCount].DataSource = dataTable; GridViewTheWord[dataTableCount].AllowPaging = true; GridViewTheWord[dataTableCount].AllowSorting = true; GridViewTheWord[dataTableCount].AutoGenerateColumns = false; GridViewTheWord[dataTableCount].AutoGenerateDeleteButton = true; GridViewTheWord[dataTableCount].AutoGenerateEditButton = true; GridViewTheWord[dataTableCount].AutoGenerateSelectButton = true; switch ( DataColumnFieldGridView ) { case DataColumnField.Bound: foreach( DataColumn dataColumn in dataTable.Columns ) { BoundField boundField = null; boundField = new BoundField(); boundField.DataField = dataColumn.ColumnName; boundField.HeaderText = dataColumn.ColumnName; boundField.SortExpression = dataColumn.ColumnName; GridViewTheWord[dataTableCount].Columns.Add( boundField ); } break; case DataColumnField.Template: foreach( DataColumn dataColumn in dataTable.Columns ) { TemplateField templateField = null; //System.Web.UI.WebControls.Label label = null; templateField = new TemplateField(); templateField.HeaderText = dataColumn.ColumnName; templateField.SortExpression = dataColumn.ColumnName; //templateField.EditItemTemplate = new DataGridTemplate(ListItemType.EditItem, dataColumn.ColumnName); //templateField.FooterTemplate = new DataGridTemplate(ListItemType.Footer, dataColumn.ColumnName); //templateField.HeaderTemplate = new DataGridTemplate(ListItemType.Header, dataColumn.ColumnName); templateField.ItemTemplate = new DataGridTemplate(ListItemType.Item, dataColumn.ColumnName); GridViewTheWord[dataTableCount].Columns.Add( templateField ); } break; case DataColumnField.TextBox: PlaceHolderGridView.Controls.Add ( new LiteralControl ( "<b>" + tableName + "</b><br />" ) ); foreach( DataColumn dataColumn in dataTable.Columns ) { label = new System.Web.UI.WebControls.Label(); //label.Id = dataColumn.ColumnName; label.Text = dataColumn.ColumnName + ": "; PlaceHolderGridView.Controls.Add( label ); textBox = new System.Web.UI.WebControls.TextBox(); //textBox.Name = dataColumn.ColumnName; textBox.Text = dataColumn.ColumnName; PlaceHolderGridView.Controls.Add( textBox ); label = new System.Web.UI.WebControls.Label(); label.Text = "<br />"; PlaceHolderGridView.Controls.Add( label ); } break; } GridViewTheWord[dataTableCount].DataBind(); GridViewTheWord[dataTableCount].ID = tableName; theWordIdColumnIndex = UtilityDatabase.DataTableColumnIndex ( theWord.DataSetTheWord.Tables[tableName], columnNameForeignKey ); if ( DataColumnFieldGridView <= DataColumnField.Template ) { if ( theWordIdColumnIndex >= 0 ) { //UtilityDatabase.DataSetTableColumnVisible( GridViewTheWord[dataTableCount], theWordIdColumnIndex, false ); GridViewTheWord[dataTableCount].Columns[theWordIdColumnIndex].Visible = false; }//if ( theWordIdColumnIndex >= 0 ) //GridViewTheWord[dataTableCount].UserDeletingRow += new GridViewRowCancelEventHandler( GridViewDeleteEventArgs ); PlaceHolderGridView.Controls.Add ( new LiteralControl ( "<b>" + GridViewTheWord[dataTableCount].ID + "</b>" ) ); } if ( dataTableCount != 0 ) { linkButtonAdd[dataTableCount] = new System.Web.UI.WebControls.LinkButton(); linkButtonAdd[dataTableCount].ID = dataTableCount + "|" + tableName + "|" + "Add"; linkButtonAdd[dataTableCount].Text = "Add <br />"; // Register the event-handling method for the Click event. linkButtonAdd[dataTableCount].Click += new EventHandler(this.LinkButtonAdd_Click); PlaceHolderGridView.Controls.Add( linkButtonAdd[dataTableCount] ); } if ( DataColumnFieldGridView <= DataColumnField.Template ) { PlaceHolderGridView.Controls.Add(GridViewTheWord[dataTableCount]); PlaceHolderGridView.Controls.Add(new LiteralControl("<br />")); } }//foreach( DataTable dataTable in theWord.DataSetTheWord.Tables ) }//public static void PageBuild()
protected void rptProNumCost_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { if (canseeif.Checked == true) { HtmlTableCell tdzjrgf = e.Item.FindControl("tdzjrgf") as HtmlTableCell; HtmlTableCell tdzjclf = e.Item.FindControl("tdzjclf") as HtmlTableCell; HtmlTableCell tdzzfy = e.Item.FindControl("tdzzfy") as HtmlTableCell; HtmlTableCell tdwxfy = e.Item.FindControl("tdwxfy") as HtmlTableCell; HtmlTableCell tdcnfb = e.Item.FindControl("tdcnfb") as HtmlTableCell; HtmlTableCell tdyf = e.Item.FindControl("tdyf") as HtmlTableCell; HtmlTableCell tdfjcb = e.Item.FindControl("tdfjcb") as HtmlTableCell; tdzjrgf.Visible = false; tdzjclf.Visible = false; tdzzfy.Visible = false; tdwxfy.Visible = false; tdcnfb.Visible = false; tdyf.Visible = false; tdfjcb.Visible = false; } } if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { if (canseeif.Checked == true) { HtmlTableCell tdzjrg = e.Item.FindControl("tdzjrg") as HtmlTableCell; HtmlTableCell tdcl = e.Item.FindControl("tdcl") as HtmlTableCell; HtmlTableCell tdzzf = e.Item.FindControl("tdzzf") as HtmlTableCell; HtmlTableCell tdwx = e.Item.FindControl("tdwx") as HtmlTableCell; HtmlTableCell tdcnfb = e.Item.FindControl("tdcnfb") as HtmlTableCell; HtmlTableCell tdyf = e.Item.FindControl("tdyf") as HtmlTableCell; HtmlTableCell tdfjcb = e.Item.FindControl("tdfjcb") as HtmlTableCell; tdzjrg.Visible = false; tdcl.Visible = false; tdzzf.Visible = false; tdwx.Visible = false; tdcnfb.Visible = false; tdyf.Visible = false; tdfjcb.Visible = false; } } if (e.Item.ItemType == ListItemType.Footer) { string sqlhj = "select sum(PCON_JINE) as xshtzje,sum(RWHCB_ZJRG) as zjrgfzj,sum(RWHCB_CL) as clfzj,sum(RWHCB_ZZFY) as zzfyzj,sum(RWHCB_WXFY) as wxfyzj,sum(RWHCB_CNFB) as cnfbzj,sum(RWHCB_YF) as yfzj,sum(RWHCB_FJCB) as fjcbzj,sum(RWHCB_CBZJ) as cbzje,sum(CBZJ) as cbtotal,sum(kpZongMoney) as kpzongjehj from (select PCON_CUSTMNAME,PCON_BCODE,PCON_YZHTH,PCON_ENGNAME,PCON_ENGTYPE,cast((cast(PCON_JINE as float)*10000)/1.17 as decimal(18,2)) as PCON_JINE,sum(cast((isnull(AYTJ_JJFYXJ,0)+isnull(AYTJ_JGYZFYXJ,0)) as decimal(12,2))) as RWHCB_ZJRG,sum((isnull(XJPMS_01_01,0)+isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_05,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_07,0)+isnull(XJPMS_01_08,0)+isnull(XJPMS_01_09,0)+isnull(XJPMS_01_10,0)+isnull(XJPMS_01_11,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_15,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0))) as RWHCB_CL,sum(cast((AYTJ_GDZZFYXJ+AYTJ_KBZZFYXJ) as decimal(12,2))) as RWHCB_ZZFY,sum(cast(AYTJ_WXFYXJ as decimal(12,2))) as RWHCB_WXFY,sum(cast(AYTJ_CNFBXJ as decimal(12,2))) as RWHCB_CNFB,sum(cast(AYTJ_YFXJ as decimal(12,2))) as RWHCB_YF,sum(cast(AYTJ_FJCBXJ as decimal(12,2))) as RWHCB_FJCB,sum(cast((isnull(AYTJ_JJFYXJ,0)+isnull(AYTJ_JGYZFYXJ,0)+isnull(XJPMS_01_01,0)+isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_05,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_07,0)+isnull(XJPMS_01_08,0)+isnull(XJPMS_01_09,0)+isnull(XJPMS_01_10,0)+isnull(XJPMS_01_11,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_15,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0)+isnull(AYTJ_WXFYXJ,0)+isnull(AYTJ_CNFBXJ,0)+isnull(AYTJ_YFXJ,0)+isnull(AYTJ_FJCBXJ,0)) as decimal(12,2))) as RWHCB_CBZJ,sum(cast((isnull(AYTJ_JJFYXJ,0)+isnull(AYTJ_JGYZFYXJ,0)+isnull(XJPMS_01_01,0)+isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_05,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_07,0)+isnull(XJPMS_01_08,0)+isnull(XJPMS_01_09,0)+isnull(XJPMS_01_10,0)+isnull(XJPMS_01_11,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_15,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0)+isnull(AYTJ_GDZZFYXJ,0)+isnull(AYTJ_KBZZFYXJ,0)+isnull(AYTJ_WXFYXJ,0)+isnull(AYTJ_CNFBXJ,0)+isnull(AYTJ_YFXJ,0)+isnull(AYTJ_FJCBXJ,0)) as decimal(12,2))) as CBZJ,kpZongMoney,kpstate from (select * from (select PMS_TSAID,cast(sum(isnull(PMS_01_01,0)) as decimal(12,2)) as XJPMS_01_01,cast(sum(isnull(PMS_01_02,0)) as decimal(12,2)) as XJPMS_01_02,cast(sum(isnull(PMS_01_03,0)) as decimal(12,2)) as XJPMS_01_03,cast(sum(isnull(PMS_01_04,0)) as decimal(12,2)) as XJPMS_01_04,cast(sum(isnull(PMS_01_05,0)) as decimal(12,2)) as XJPMS_01_05,cast(sum(isnull(PMS_01_06,0)) as decimal(12,2)) as XJPMS_01_06,cast(sum(isnull(PMS_01_07,0)) as decimal(12,2)) as XJPMS_01_07,cast(sum(isnull(PMS_01_08,0)) as decimal(12,2)) as XJPMS_01_08,cast(sum(isnull(PMS_01_09,0)) as decimal(12,2)) as XJPMS_01_09,cast(sum(isnull(PMS_01_10,0)) as decimal(12,2)) as XJPMS_01_10,cast(sum(isnull(PMS_01_11,0)) as decimal(12,2)) as XJPMS_01_11,cast(sum(isnull(PMS_01_12,0)) as decimal(12,2)) as XJPMS_01_12,cast(sum(isnull(PMS_01_13,0)) as decimal(12,2)) as XJPMS_01_13,cast(sum(isnull(PMS_01_14,0)) as decimal(12,2)) as XJPMS_01_14,cast(sum(isnull(PMS_01_15,0)) as decimal(12,2)) as XJPMS_01_15,cast(sum(isnull(PMS_01_16,0)) as decimal(12,2)) as XJPMS_01_16,cast(sum(isnull(PMS_01_17,0)) as decimal(12,2)) as XJPMS_01_17,cast(sum(isnull(PMS_01_18,0)) as decimal(12,2)) as XJPMS_01_18,cast(sum(isnull(PMS_02_01,0)) as decimal(12,2)) as XJPMS_02_01,cast(sum(isnull(PMS_02_02,0)) as decimal(12,2)) as XJPMS_02_02,cast(sum(isnull(PMS_02_03,0)) as decimal(12,2)) as XJPMS_02_03,cast(sum(isnull(PMS_02_04,0)) as decimal(12,2)) as XJPMS_02_04,cast(sum(isnull(PMS_02_05,0)) as decimal(12,2)) as XJPMS_02_05,cast(sum(isnull(PMS_02_06,0)) as decimal(12,2)) as XJPMS_02_06,cast(sum(isnull(PMS_02_07,0)) as decimal(12,2)) as XJPMS_02_07,cast(sum(isnull(PMS_02_08,0)) as decimal(12,2)) as XJPMS_02_08,cast(sum(isnull(PMS_02_09,0)) as decimal(12,2)) as XJPMS_02_09,isnull(sum(isnull(AYTJ_GZ,0)),0) as AYTJ_GZXJ,isnull(sum(isnull(AYTJ_QT,0)),0) as AYTJ_QTXJ,sum(isnull(AYTJ_JJFY,0)) as AYTJ_JJFYXJ,sum(isnull(AYTJ_JGYZFY,0)) as AYTJ_JGYZFYXJ,sum(isnull(AYTJ_GDZZFY,0)) as AYTJ_GDZZFYXJ,sum(isnull(AYTJ_KBZZFY,0)) as AYTJ_KBZZFYXJ,sum(isnull(AYTJ_WXFY,0)+isnull(DIF_DIFMONEY,0)) as AYTJ_WXFYXJ,sum(isnull(AYTJ_CNFB,0)) as AYTJ_CNFBXJ,sum(isnull(AYTJ_YF,0)+isnull(DIFYF_DIFMONEY,0)) as AYTJ_YFXJ,sum(isnull(AYTJ_FJCB,0)) as AYTJ_FJCBXJ from (select * from VIEW_FM_AYTJ as a left join (select sum(cast(DIF_DIFMONEY as decimal(12,2))) as DIF_DIFMONEY,DIF_TSAID,DIF_YEAR,DIF_MONTH from TBFM_DIF group by DIF_TSAID,DIF_YEAR,DIF_MONTH)b on (a.PMS_TSAID=b.DIF_TSAID and a.AYTJ_YEARMONTH=b.DIF_YEAR+'-'+b.DIF_MONTH) left join (select sum(cast(DIFYF_DIFMONEY as decimal(12,2))) as DIFYF_DIFMONEY,DIFYF_TSAID,DIFYF_YEAR,DIFYF_MONTH from TBFM_YFDIF group by DIFYF_TSAID,DIFYF_YEAR,DIFYF_MONTH)c on (a.PMS_TSAID=c.DIFYF_TSAID and a.AYTJ_YEARMONTH=c.DIFYF_YEAR+'-'+c.DIFYF_MONTH))k group by PMS_TSAID) as a left join (select TASK_ID,CWCB_STATE,CWCB_HSDATE from TBCB_BMCONFIRM) as b on a.PMS_TSAID=b.TASK_ID)t left join (select distinct TSA_ID,CM_CONTR from View_CM_Task where CM_SPSTATUS='2')m on t.PMS_TSAID=m.TSA_ID left join TBPM_CONPCHSINFO as c on m.CM_CONTR=c.PCON_BCODE left join (select b.conId as conid,sum(cast(b.kpmoney as float))*10000 as kpZongMoney,case when KP_SPSTATE='3' then '是' else '否' end as kpstate from CM_KAIPIAO as a left join dbo.CM_KAIPIAO_DETAIL as b on a.KP_TaskID=b.cId where KP_SPSTATE='3' group by b.conId,KP_SPSTATE)p on c.PCON_BCODE=p.conid group by PCON_CUSTMNAME,PCON_BCODE,PCON_YZHTH,PCON_ENGNAME,PCON_ENGTYPE,PCON_JINE,kpZongMoney,kpstate)s where " + strstring(); System.Data.DataTable dthj = DBCallCommon.GetDTUsingSqlText(sqlhj); if (dthj.Rows.Count > 0) { System.Web.UI.WebControls.Label lb_xshtzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_xshtzj"); System.Web.UI.WebControls.Label lb_zjrgzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_zjrgzj"); System.Web.UI.WebControls.Label lbclzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbclzj"); System.Web.UI.WebControls.Label lbzzfyzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzzfyzj"); System.Web.UI.WebControls.Label lbwxfyzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbwxfyzj"); System.Web.UI.WebControls.Label lbcnfbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbcnfbzj"); System.Web.UI.WebControls.Label lbyfzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbyfzj"); System.Web.UI.WebControls.Label lbfjcbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbfjcbzj"); System.Web.UI.WebControls.Label lb_cbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_cbzj"); System.Web.UI.WebControls.Label lb_cbtotal = (System.Web.UI.WebControls.Label)e.Item.FindControl("lb_cbtotal"); System.Web.UI.WebControls.Label lbkpjezj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbkpjezj"); lb_xshtzj.Text = dthj.Rows[0]["xshtzje"].ToString().Trim(); lb_zjrgzj.Text = dthj.Rows[0]["zjrgfzj"].ToString().Trim(); lbclzj.Text = dthj.Rows[0]["clfzj"].ToString().Trim(); lbzzfyzj.Text = dthj.Rows[0]["zzfyzj"].ToString().Trim(); lbwxfyzj.Text = dthj.Rows[0]["wxfyzj"].ToString().Trim(); lbcnfbzj.Text = dthj.Rows[0]["cnfbzj"].ToString().Trim(); lbyfzj.Text = dthj.Rows[0]["yfzj"].ToString().Trim(); lbfjcbzj.Text = dthj.Rows[0]["fjcbzj"].ToString().Trim(); lb_cbzj.Text = dthj.Rows[0]["cbzje"].ToString().Trim(); lb_cbtotal.Text = dthj.Rows[0]["cbtotal"].ToString().Trim(); lbkpjezj.Text = dthj.Rows[0]["kpzongjehj"].ToString().Trim(); } if (canseeif.Checked == true) { HtmlTableCell tdzjrgf = e.Item.FindControl("tdzjrgf") as HtmlTableCell; HtmlTableCell tdclf = e.Item.FindControl("tdclf") as HtmlTableCell; HtmlTableCell tdzzfy = e.Item.FindControl("tdzzfy") as HtmlTableCell; HtmlTableCell tdwxfy = e.Item.FindControl("tdwxfy") as HtmlTableCell; HtmlTableCell tdcnfb = e.Item.FindControl("tdcnfb") as HtmlTableCell; HtmlTableCell tdyf = e.Item.FindControl("tdyf") as HtmlTableCell; HtmlTableCell tdfjcb = e.Item.FindControl("tdfjcb") as HtmlTableCell; tdzjrgf.Visible = false; tdclf.Visible = false; tdzzfy.Visible = false; tdwxfy.Visible = false; tdcnfb.Visible = false; tdyf.Visible = false; tdfjcb.Visible = false; } } }
protected void lnkView_Click(object sender, EventArgs e) { LinkButton btnButton = sender as LinkButton; GridViewRow gvRow = (GridViewRow)btnButton.NamingContainer; System.Web.UI.WebControls.Label lblTitle = (System.Web.UI.WebControls.Label)gvRow.FindControl("Label2"); string abc = lblTitle.Text; if (abc == "Peminjam") { abc1 = "PJ"; } else if (abc == "Penjamin 1") { abc1 = "P1"; } else if (abc == "Penjamin 2") { abc1 = "P2"; } else if (abc == "Penjamin 3") { abc1 = "P3"; } DataTable ddokdicno = new DataTable(); ddokdicno = DBCon.Ora_Execute_table("select leg_applcn_no,leg_plaintif_cat_cd from jpa_legal_action where leg_applcn_no='" + txtappno.Text + "'"); stscd = ddokdicno.Rows[0][1].ToString(); if (ddokdicno.Rows.Count != 0) { string appno; appno = ddokdicno.Rows[0][0].ToString(); DataTable ddokdicno1 = new DataTable(); ddokdicno1 = DBCon.Ora_Execute_table("select leg_plaintif_cat_cd,leg_legal_action_cd,leg_lawyer_name,leg_apply_dt,leg_court_dt,leg_case_no,leg_action_type_cd,leg_court_result from jpa_legal_action jl left join jpa_application as ja on ja.app_new_icno=jl.leg_applcn_no where leg_applcn_no='" + appno + "' and leg_plaintif_cat_cd='" + abc1 + "'"); if (ddokdicno1.Rows.Count != 0) { ddlkd1.SelectedValue = ddokdicno1.Rows[0][0].ToString(); ddljt2.SelectedValue = ddokdicno1.Rows[0][1].ToString(); txtpp3.Text = ddokdicno1.Rows[0][2].ToString(); txttpt4.Text = Convert.ToDateTime(ddokdicno1.Rows[0][3]).ToString("dd/MM/yyyy"); txttp5.Text = Convert.ToDateTime(ddokdicno1.Rows[0][4]).ToString("dd/MM/yyyy"); txtndk.Text = ddokdicno1.Rows[0][5].ToString(); ddlpen.SelectedValue = ddokdicno1.Rows[0][6].ToString(); textarea1.Value = ddokdicno1.Rows[0][7].ToString(); Button5.Visible = true; Button2.Visible = false; } else { ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Maklumat Carian Tidak Dijumpai.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "$.Zebra_Dialog('Maklumat Carian Tidak Dijumpai.',{'type': 'warning','title': 'Warning','auto_close': 2000});", true); } Button2.Visible = false; Button1.Visible = true; //Button3.Visible = false; Button5.Visible = true; }
private void labGender_DataBinding(object sender, EventArgs e) { AspNet.Label labGender = (AspNet.Label)sender; IDataItemContainer dataItemContainer = (IDataItemContainer)labGender.NamingContainer; string SpareNum = Convert.ToString(((DataRowView)dataItemContainer.DataItem)["物料号"]); string Company_Name = Convert.ToString(((DataRowView)dataItemContainer.DataItem)["提报单位"]); DateTime dtime = DateTime.Now; int Last_Year = Convert.ToInt32(dtime.ToString("yyyy")) - 1; int Now_Year = Convert.ToInt32(dtime.ToString("yyyy")); //string Sql = @"select sum(ma.数量) as 总 from(select sum(操作数量) as 数量,设备编号,YEAR(操作日期) as 年份 from b_备件_记录表 where YEAR(操作日期)=" + Last_Year + " and 日志ID in (select ID from b_备件_导入日志表 where 物料号='"+ SpareNum + "' and 提报单位='"+Company_Name+"') group by 设备编号,YEAR(操作日期)) as ma"; string Sql_lastYear = @"select SUM(b.操作数量) as 总数量,b.设备相关名称 from b_备件_导入日志表 as a,b_备件_记录表 as b where a.ID=b.日志ID and a.物料号='" + SpareNum + "' and a.提报单位='" + Company_Name + "' and Year(b.操作日期)=" + Last_Year + " group by b.设备相关名称"; string Sql_NowYear = @"select SUM(b.操作数量) as 总数量,b.设备相关名称 from b_备件_导入日志表 as a,b_备件_记录表 as b where a.ID=b.日志ID and a.物料号='" + SpareNum + "' and a.提报单位='" + Company_Name + "' and Year(b.操作日期)=" + Now_Year + " group by b.设备相关名称"; #region 查询名称为当前年的设备的投产时间小于当前年的设备 //string Sql_Count_NowYear = @"select * from 设备_设备信息表 as sbtab,(select SUM(b.操作数量) as 总数量,b.设备相关名称 from b_备件_导入日志表 as a,b_备件_记录表 as b where a.ID=b.日志ID and a.物料号='"+ SpareNum + "' and a.提报单位='"+Company_Name+"' and Year(b.操作日期)="+Now_Year+" group by b.设备相关名称) as c where sbtab.设备名称 in(c.设备相关名称) and year(sbtab.投产时间)="+Now_Year+""; //string Sql_Count_LastYear = @"select * from 设备_设备信息表 as sbtab,(select SUM(b.操作数量) as 总数量,b.设备相关名称 from b_备件_导入日志表 as a,b_备件_记录表 as b where a.ID=b.日志ID and a.物料号='" + SpareNum + "' and a.提报单位='" + Company_Name + "' and Year(b.操作日期)=" + Now_Year + " group by b.设备相关名称) as c where sbtab.设备名称 in(c.设备相关名称) and year(sbtab.投产时间)<" + Now_Year + ""; #endregion DataSet ds_lastYear = bll.返回DataSet(Sql_lastYear); DataTable dt_lastYear = ds_lastYear.Tables[0]; DataSet ds_NowYear = bll.返回DataSet(Sql_NowYear); DataTable dt_NowYear = ds_NowYear.Tables[0]; //DataSet ds_CountNowYear = BLL.DBControl.Query(Sql_Count_NowYear); //DataTable dt_CountNowYear = ds_CountNowYear.Tables[0]; //DataSet ds_CountLastYear = BLL.DBControl.Query(Sql_Count_LastYear); //DataTable dt_CountLastYear = ds_CountLastYear.Tables[0]; int lasttotal = 0; int NowToral = 0; int allTotal = 0; if (dt_NowYear.Rows.Count - dt_lastYear.Rows.Count > 0) { for (int i = 0; i < dt_lastYear.Rows.Count; i++) { lasttotal += Convert.ToInt32(dt_lastYear.Rows[i]["总数量"]); } for (int n = 0; n < dt_NowYear.Rows.Count; n++) { NowToral += Convert.ToInt32(dt_NowYear.Rows[n]["总数量"]); } double avgcount = Math.Round(Convert.ToDouble(NowToral / dt_NowYear.Rows.Count), 0); allTotal = lasttotal + Convert.ToInt32(avgcount) * (dt_NowYear.Rows.Count - dt_lastYear.Rows.Count); } else if (dt_NowYear.Rows.Count - dt_lastYear.Rows.Count == 0) { for (int i = 0; i < dt_lastYear.Rows.Count; i++) { lasttotal += Convert.ToInt32(dt_lastYear.Rows[i]["总数量"]); } allTotal = lasttotal; } else { for (int i = 0; i < dt_lastYear.Rows.Count; i++) { lasttotal += Convert.ToInt32(dt_lastYear.Rows[i]["总数量"]); } allTotal = lasttotal; } labGender.Text = allTotal.ToString(); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(); } this.common_Location = (Common_Location)this.FindControl("common_Location"); this.litProductName = (System.Web.UI.WebControls.Literal) this.FindControl("litProductName"); this.lblSku = (SkuLabel)this.FindControl("lblSku"); this.lblStock = (StockLabel)this.FindControl("lblStock"); this.litUnit = (System.Web.UI.WebControls.Literal) this.FindControl("litUnit"); this.litWeight = (System.Web.UI.WebControls.Label) this.FindControl("litWeight"); this.litBrosedNum = (System.Web.UI.WebControls.Literal) this.FindControl("litBrosedNum"); this.litBrand = (System.Web.UI.WebControls.Literal) this.FindControl("litBrand"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); this.lblSalePrice = (FormatedMoneyLabel)this.FindControl("lblSalePrice"); this.lblTotalPrice = (TotalLabel)this.FindControl("lblTotalPrice"); this.litDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litDescription"); this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription"); this.btnOrder = (BuyButton)this.FindControl("btnOrder"); this.hpkProductConsultations = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductConsultations"); this.hpkProductReviews = (System.Web.UI.WebControls.HyperLink) this.FindControl("hpkProductReviews"); this.txtMaxCount = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtMaxCount"); this.txtSoldCount = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtSoldCount"); this.lblCurrentSalePrice = (FormatedMoneyLabel)this.FindControl("lblCurrentSalePrice"); this.litCount = (System.Web.UI.WebControls.Label) this.FindControl("litCount"); this.lblNeedPrice = (FormatedMoneyLabel)this.FindControl("lblNeedPrice"); this.lblEndTime = (FormatedTimeLabel)this.FindControl("lblEndTime"); this.lblStartTime = (FormatedTimeLabel)this.FindControl("lblStartTime"); this.litRemainTime = (System.Web.UI.WebControls.Literal) this.FindControl("litRemainTime"); this.litNeedCount = (System.Web.UI.WebControls.Literal) this.FindControl("litNeedCount"); this.litMaxCount = (System.Web.UI.WebControls.Label) this.FindControl("litMaxCount"); this.images = (Common_ProductImages)this.FindControl("common_ProductImages"); this.rptExpandAttributes = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes"); this.skuSelector = (SKUSelector)this.FindControl("SKUSelector"); this.reviews = (Common_ProductReview)this.FindControl("list_Common_ProductReview"); this.consultations = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations"); this.correlative = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative"); this.nowTime = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("nowTime"); this.nowTime.SetWhenIsNotNull(System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo)); this.hidden_skus = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skus"); this.hidden_skuItem = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidden_skuItem"); if (!this.Page.IsPostBack) { ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, new int?(this.reviews.MaxNum), new int?(this.consultations.MaxNum)); GroupBuyInfo productGroupBuyInfo = ProductBrowser.GetProductGroupBuyInfo(this.productId); if (productBrowseInfo.Product == null || productGroupBuyInfo == null) { this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该件商品参与的团购活动已经结束;或已被管理员删除")); return; } System.Collections.IEnumerable value = from item in productBrowseInfo.Product.Skus select item.Value; if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null) { this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs); } if (this.hidden_skus != null) { this.hidden_skus.Value = JsonConvert.SerializeObject(value); } this.LoadPageSearch(productBrowseInfo.Product); this.hpkProductReviews.Text = "查看全部" + productBrowseInfo.ReviewCount.ToString() + "条评论"; this.hpkProductConsultations.Text = "查看全部" + productBrowseInfo.ConsultationCount.ToString() + "条咨询"; this.hpkProductConsultations.NavigateUrl = string.Format("ProductConsultationsAndReplay.aspx?productId={0}", this.productId); this.hpkProductReviews.NavigateUrl = string.Format("LookProductReviews.aspx?productId={0}", this.productId); this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName); this.LoadProductGroupBuyInfo(productGroupBuyInfo); this.btnOrder.Stock = productBrowseInfo.Product.Stock; BrowsedProductQueue.EnQueue(this.productId); this.images.ImageInfo = productBrowseInfo.Product; this.litContent.Text = productGroupBuyInfo.Content; if (productBrowseInfo.DbAttribute != null) { this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute; this.rptExpandAttributes.DataBind(); } if (productBrowseInfo.DbSKUs != null) { this.skuSelector.ProductId = this.productId; this.skuSelector.DataSource = productBrowseInfo.DbSKUs; } if (productBrowseInfo.DBReviews != null) { this.reviews.DataSource = productBrowseInfo.DBReviews; this.reviews.DataBind(); } if (productBrowseInfo.DBConsultations != null) { this.consultations.DataSource = productBrowseInfo.DBConsultations; this.consultations.DataBind(); } if (productBrowseInfo.DbCorrelatives != null) { this.correlative.DataSource = productBrowseInfo.DbCorrelatives; this.correlative.DataBind(); } } }
protected void rptProNumCost_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { System.Web.UI.WebControls.Label lbzjrg = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzjrg"); System.Web.UI.WebControls.Label lbwgj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbwgj"); System.Web.UI.WebControls.Label lbhsjs = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbhsjs"); System.Web.UI.WebControls.Label lbhcl = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbhcl"); System.Web.UI.WebControls.Label lbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzj"); System.Web.UI.WebControls.Label lbdj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbdj"); System.Web.UI.WebControls.Label lbzc = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzc"); System.Web.UI.WebControls.Label lbbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbbzj"); System.Web.UI.WebControls.Label lbyqtl = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbyqtl"); System.Web.UI.WebControls.Label lbqtcl = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbqtcl"); System.Web.UI.WebControls.Label lbclxj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbclxj"); System.Web.UI.WebControls.Label lbzzfy = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzzfy"); System.Web.UI.WebControls.Label lbwxfy = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbwxfy"); System.Web.UI.WebControls.Label lbcnfb = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbcnfb"); System.Web.UI.WebControls.Label lbyf = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbyf"); System.Web.UI.WebControls.Label lbfjcb = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbfjcb"); System.Web.UI.WebControls.Label lbcbzj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbcbzj"); System.Web.UI.WebControls.Label lbhsbz = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbhsbz"); } if (e.Item.ItemType == ListItemType.Footer) { string sqlhj = "select cast(isnull(sum((isnull(AYTJ_JJFYXJ,0)+isnull(AYTJ_JGYZFYXJ,0))),0) as decimal(12,2)) as RWHCB_ZJRGHJ,isnull(sum(isnull(XJPMS_01_11,0)),0) as RWHCB_WGJHJ,isnull(sum(isnull(XJPMS_01_07,0)),0) as RWHCB_HSJSHJ,isnull(sum(isnull(XJPMS_01_05,0)),0) as RWHCB_HCLHJ,isnull(sum(isnull(XJPMS_01_08,0)),0) as RWHCB_ZJHJ,isnull(sum(isnull(XJPMS_01_09,0)),0) as RWHCB_DJHJ,isnull(sum(isnull(XJPMS_01_10,0)),0) as RWHCB_ZCHJ,isnull(sum(isnull(XJPMS_01_01,0)),0) as RWHCB_BZJHJ,isnull(sum(isnull(XJPMS_01_15,0)),0) as RWHCB_YQTLHJ,isnull(sum(isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0)),0) as RWHCB_QTCLHJ,isnull(sum(isnull(XJPMS_01_01,0)+isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_05,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_07,0)+isnull(XJPMS_01_08,0)+isnull(XJPMS_01_09,0)+isnull(XJPMS_01_10,0)+isnull(XJPMS_01_11,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_15,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0)),0) as RWHCB_CLHJ,cast(isnull(sum(isnull(AYTJ_GDZZFYXJ,0)+isnull(AYTJ_KBZZFYXJ,0)),0) as decimal(12,2)) as RWHCB_ZZFYHJ,cast(isnull(sum(isnull(AYTJ_WXFYXJ,0)),0) as decimal(12,2)) as RWHCB_WXFYHJ,cast(isnull(sum(isnull(AYTJ_CNFBXJ,0)),0) as decimal(12,2)) as RWHCB_CNFBHJ,cast(isnull(sum(isnull(AYTJ_YFXJ,0)),0) as decimal(12,2)) as RWHCB_YFHJ,cast(isnull(sum(isnull(AYTJ_FJCBXJ,0)),0) as decimal(12,2)) as RWHCB_FJCBHJ,cast(isnull(sum(isnull(AYTJ_JJFYXJ,0)+isnull(AYTJ_JGYZFYXJ,0)+isnull(XJPMS_01_01,0)+isnull(XJPMS_01_02,0)+isnull(XJPMS_01_03,0)+isnull(XJPMS_01_04,0)+isnull(XJPMS_01_05,0)+isnull(XJPMS_01_06,0)+isnull(XJPMS_01_07,0)+isnull(XJPMS_01_08,0)+isnull(XJPMS_01_09,0)+isnull(XJPMS_01_10,0)+isnull(XJPMS_01_11,0)+isnull(XJPMS_01_12,0)+isnull(XJPMS_01_13,0)+isnull(XJPMS_01_14,0)+isnull(XJPMS_01_15,0)+isnull(XJPMS_01_16,0)+isnull(XJPMS_01_17,0)+isnull(XJPMS_01_18,0)+isnull(XJPMS_02_01,0)+isnull(XJPMS_02_02,0)+isnull(XJPMS_02_03,0)+isnull(XJPMS_02_04,0)+isnull(XJPMS_02_05,0)+isnull(XJPMS_02_06,0)+isnull(XJPMS_02_07,0)+isnull(XJPMS_02_08,0)+isnull(XJPMS_02_09,0)+isnull(AYTJ_GDZZFYXJ,0)+isnull(AYTJ_KBZZFYXJ,0)+isnull(AYTJ_WXFYXJ,0)+isnull(AYTJ_CNFBXJ,0)+isnull(AYTJ_YFXJ,0)+isnull(AYTJ_FJCBXJ,0)),0) as decimal(12,2)) as RWHCB_CBZJHJ from (select * from (select PMS_TSAID,TSA_PJID,CM_PROJ,cast(sum(isnull(PMS_01_01,0)) as decimal(12,2)) as XJPMS_01_01,cast(sum(isnull(PMS_01_02,0)) as decimal(12,2)) as XJPMS_01_02,cast(sum(isnull(PMS_01_03,0)) as decimal(12,2)) as XJPMS_01_03,cast(sum(isnull(PMS_01_04,0)) as decimal(12,2)) as XJPMS_01_04,cast(sum(isnull(PMS_01_05,0)) as decimal(12,2)) as XJPMS_01_05,cast(sum(isnull(PMS_01_06,0)) as decimal(12,2)) as XJPMS_01_06,cast(sum(isnull(PMS_01_07,0)) as decimal(12,2)) as XJPMS_01_07,cast(sum(isnull(PMS_01_08,0)) as decimal(12,2)) as XJPMS_01_08,cast(sum(isnull(PMS_01_09,0)) as decimal(12,2)) as XJPMS_01_09,cast(sum(isnull(PMS_01_10,0)) as decimal(12,2)) as XJPMS_01_10,cast(sum(isnull(PMS_01_11,0)) as decimal(12,2)) as XJPMS_01_11,cast(sum(isnull(PMS_01_12,0)) as decimal(12,2)) as XJPMS_01_12,cast(sum(isnull(PMS_01_13,0)) as decimal(12,2)) as XJPMS_01_13,cast(sum(isnull(PMS_01_14,0)) as decimal(12,2)) as XJPMS_01_14,cast(sum(isnull(PMS_01_15,0)) as decimal(12,2)) as XJPMS_01_15,cast(sum(isnull(PMS_01_16,0)) as decimal(12,2)) as XJPMS_01_16,cast(sum(isnull(PMS_01_17,0)) as decimal(12,2)) as XJPMS_01_17,cast(sum(isnull(PMS_01_18,0)) as decimal(12,2)) as XJPMS_01_18,cast(sum(isnull(PMS_02_01,0)) as decimal(12,2)) as XJPMS_02_01,cast(sum(isnull(PMS_02_02,0)) as decimal(12,2)) as XJPMS_02_02,cast(sum(isnull(PMS_02_03,0)) as decimal(12,2)) as XJPMS_02_03,cast(sum(isnull(PMS_02_04,0)) as decimal(12,2)) as XJPMS_02_04,cast(sum(isnull(PMS_02_05,0)) as decimal(12,2)) as XJPMS_02_05,cast(sum(isnull(PMS_02_06,0)) as decimal(12,2)) as XJPMS_02_06,cast(sum(isnull(PMS_02_07,0)) as decimal(12,2)) as XJPMS_02_07,cast(sum(isnull(PMS_02_08,0)) as decimal(12,2)) as XJPMS_02_08,cast(sum(isnull(PMS_02_09,0)) as decimal(12,2)) as XJPMS_02_09,isnull(sum(isnull(AYTJ_GZ,0)),0) as AYTJ_GZXJ,isnull(sum(isnull(AYTJ_QT,0)),0) as AYTJ_QTXJ,sum(isnull(AYTJ_JJFY,0)) as AYTJ_JJFYXJ,sum(isnull(AYTJ_JGYZFY,0)) as AYTJ_JGYZFYXJ,sum(isnull(AYTJ_GDZZFY,0)) as AYTJ_GDZZFYXJ,sum(isnull(AYTJ_KBZZFY,0)) as AYTJ_KBZZFYXJ,sum(isnull(AYTJ_WXFY,0)+isnull(DIF_DIFMONEY,0)) as AYTJ_WXFYXJ,sum(isnull(AYTJ_CNFB,0)) as AYTJ_CNFBXJ,sum(isnull(AYTJ_YF,0)+isnull(DIFYF_DIFMONEY,0)) as AYTJ_YFXJ,sum(isnull(AYTJ_FJCB,0)) as AYTJ_FJCBXJ from (select * from VIEW_FM_AYTJ as a left join (select sum(cast(DIF_DIFMONEY as decimal(12,2))) as DIF_DIFMONEY,DIF_TSAID,DIF_YEAR,DIF_MONTH from TBFM_DIF group by DIF_TSAID,DIF_YEAR,DIF_MONTH)b on (a.PMS_TSAID=b.DIF_TSAID and a.AYTJ_YEARMONTH=b.DIF_YEAR+'-'+b.DIF_MONTH) left join (select sum(cast(DIFYF_DIFMONEY as decimal(12,2))) as DIFYF_DIFMONEY,DIFYF_TSAID,DIFYF_YEAR,DIFYF_MONTH from TBFM_YFDIF group by DIFYF_TSAID,DIFYF_YEAR,DIFYF_MONTH)c on (a.PMS_TSAID=c.DIFYF_TSAID and a.AYTJ_YEARMONTH=c.DIFYF_YEAR+'-'+c.DIFYF_MONTH))s group by PMS_TSAID,TSA_PJID,CM_PROJ) as a left join (select TASK_ID,CWCB_STATE,CWCB_HSDATE from TBCB_BMCONFIRM) as b on a.PMS_TSAID=b.TASK_ID)t where " + strstring(); SqlDataReader drhj = DBCallCommon.GetDRUsingSqlText(sqlhj); if (drhj.Read()) { zjrghj = Convert.ToDouble(drhj["RWHCB_ZJRGHJ"]); bzjhj = Convert.ToDouble(drhj["RWHCB_BZJHJ"]); hclhj = Convert.ToDouble(drhj["RWHCB_HCLHJ"]); hsjshj = Convert.ToDouble(drhj["RWHCB_HSJSHJ"]); zjhj = Convert.ToDouble(drhj["RWHCB_ZJHJ"]); djhj = Convert.ToDouble(drhj["RWHCB_DJHJ"]); zchj = Convert.ToDouble(drhj["RWHCB_ZCHJ"]); wgjhj = Convert.ToDouble(drhj["RWHCB_WGJHJ"]); yqtlhj = Convert.ToDouble(drhj["RWHCB_YQTLHJ"]); qtclhj = Convert.ToDouble(drhj["RWHCB_QTCLHJ"]); clhj = Convert.ToDouble(drhj["RWHCB_CLHJ"]); zzfyhj = Convert.ToDouble(drhj["RWHCB_ZZFYHJ"]); wxfyhj = Convert.ToDouble(drhj["RWHCB_WXFYHJ"]); cnfbhj = Convert.ToDouble(drhj["RWHCB_CNFBHJ"]); yfhj = Convert.ToDouble(drhj["RWHCB_YFHJ"]); fjcbhj = Convert.ToDouble(drhj["RWHCB_FJCBHJ"]); cbhj = Convert.ToDouble(drhj["RWHCB_CBZJHJ"]); } drhj.Close(); System.Web.UI.WebControls.Label lbzjrghj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzjrghj"); System.Web.UI.WebControls.Label lbwgjhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbwgjhj"); System.Web.UI.WebControls.Label lbhsjshj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbhsjshj"); System.Web.UI.WebControls.Label lbhclhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbhclhj"); System.Web.UI.WebControls.Label lbzjhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzjhj"); System.Web.UI.WebControls.Label lbdjhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbdjhj"); System.Web.UI.WebControls.Label lbzchj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzchj"); System.Web.UI.WebControls.Label lbbzjhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbbzjhj"); System.Web.UI.WebControls.Label lbyqtlhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbyqtlhj"); System.Web.UI.WebControls.Label lbqtclhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbqtclhj"); System.Web.UI.WebControls.Label lbclhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbclhj"); System.Web.UI.WebControls.Label lbzzfyhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbzzfyhj"); System.Web.UI.WebControls.Label lbwxfyhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbwxfyhj"); System.Web.UI.WebControls.Label lbcnfbhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbcnfbhj"); System.Web.UI.WebControls.Label lbyfhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbyfhj"); System.Web.UI.WebControls.Label lbfjcbhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbfjcbhj"); System.Web.UI.WebControls.Label lbcbhj = (System.Web.UI.WebControls.Label)e.Item.FindControl("lbcbhj"); lbzjrghj.Text = zjrghj.ToString(); lbwgjhj.Text = wgjhj.ToString(); lbhsjshj.Text = hsjshj.ToString(); lbhclhj.Text = hclhj.ToString(); lbzjhj.Text = zjhj.ToString(); lbdjhj.Text = djhj.ToString(); lbzchj.Text = zchj.ToString(); lbbzjhj.Text = bzjhj.ToString(); lbyqtlhj.Text = yqtlhj.ToString(); lbqtclhj.Text = qtclhj.ToString(); lbclhj.Text = clhj.ToString(); lbzzfyhj.Text = zzfyhj.ToString(); lbwxfyhj.Text = wxfyhj.ToString(); lbcnfbhj.Text = cnfbhj.ToString(); lbyfhj.Text = yfhj.ToString(); lbfjcbhj.Text = fjcbhj.ToString(); lbcbhj.Text = cbhj.ToString(); } }
private void Process() { string punIds = string.Empty; int WeightInKg = 0; int MaxLimit = 0; int count = 0; foreach (GridViewRow gvr in this.gvSearchPickupNotice.Rows) { if (((CheckBox)gvr.FindControl("chkSelect")).Checked == true) { System.Web.UI.WebControls.Label lblUnApprovedGINCount = ((System.Web.UI.WebControls.Label)gvr.FindControl("lblUnApprovedGINCount")); int UnApprovedGINCount = 0; if (Session["ProcessType"].ToString() == "PSA" && int.TryParse(lblUnApprovedGINCount.Text, out UnApprovedGINCount) && UnApprovedGINCount > 0) { Messages.SetMessage("The selected PUN in row " + (gvr.RowIndex + 1).ToString() + " has unapproved " + UnApprovedGINCount + " GIN under it. Please approve that first!" , WarehouseApplication.Messages.MessageType.Warning); return; } if (!string.IsNullOrEmpty(punIds)) { punIds += ","; } punIds += gvSearchPickupNotice.DataKeys[gvr.RowIndex].Value.ToString(); Session["PUNID"] = punIds; count = count + 1; WeightInKg = WeightInKg + Convert.ToInt32(gvSearchPickupNotice.DataKeys[gvr.RowIndex].Values["WeightInKg"]); MaxLimit = Convert.ToInt32(gvSearchPickupNotice.DataKeys[gvr.RowIndex].Values["MaxLimit"]); } } //if (WeightInKg > MaxLimit) //{ // Messages.SetMessage("The selected PUN list exceeded the maximum capacity by : " + (Convert.ToInt32(CommodityMaximumRangeEnum.MaximumRange) - WeightInKg) + " You can only process maximum of " + Convert.ToInt32(CommodityMaximumRangeEnum.MaximumRange) + " for one truck/GIN.", Messages.MessageType.Warning); //} //else //{ GINModel ob = new GINModel(); List <PickupNoticeModel> pikListcheck = PickupNoticeModel.PrintPUNChecking(punIds); if (pikListcheck.Count != count) { Messages.SetMessage("From selected PUN list some of them are not printed.You can’t process GIN before PUN is printed. ", Messages.MessageType.Warning); } else { ob.ID = Guid.NewGuid(); ob.PrepareGIN(punIds); Guid gradeID; string shedName; gradeID = ob.PickupNoticesList[0].CommodityGradeID; shedName = ob.PickupNoticesList[0].ShedName; ob.PickupNoticesList[0].ShedName = shedName; int ProductionYear = ob.PickupNoticesList[0].ProductionYear; ob.PickupNoticesList[0].ProductionYear = ProductionYear; bool hasError = false; foreach (PickupNoticeModel pm in ob.PickupNoticesList) { if (pm.ProductionYear != ProductionYear || pm.CommodityGradeID != gradeID || pm.ShedName != shedName) { hasError = true; Messages.SetMessage("ERROR: Please check warehouse receipts are of the same grade, shed and production year!"); break; } } if (hasError) { return; } ob.PUNPrintDateTime = pikListcheck[0].PUNPrintDateTime; ob.PUNPrintedBy = pikListcheck[0].PUNPrintedBy; ob.GINNumber = ob.GetNewGINNumber()[0]; ob.AutoNumber = int.Parse(ob.GetNewGINNumber()[1]); // ob.TransactionId = WFTransaction.GetTransaction(new Guid(ConfigurationSettings.AppSettings["GINNew"])).ToString(); ob.WarehouseID = UserBLL.GetCurrentWarehouse(); ob.CommodityGradeID = gradeID; ob.ProductionYear = ProductionYear; Session["GINMODEL"] = ob; Session["EditMode"] = false; if (Session["ProcessType"].ToString() == "GIN") { Response.Redirect("GIN.aspx"); } else if (Session["ProcessType"].ToString() == "PSA") { Response.Redirect("GINPSA.aspx"); } //} } btnGINProcess.Style["visibility"] = "Visible"; btnPrintPUN.Style["visibility"] = "Visible"; btnProcessPSA.Style["visibility"] = "Visible"; }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["AfficheId"], out this.affichesId)) { base.GotoResourceNotFound(); } this.litAffichesAddedDate = (FormatedTimeLabel)this.FindControl("litAffichesAddedDate"); this.litContent = (System.Web.UI.WebControls.Literal) this.FindControl("litContent"); this.litTilte = (System.Web.UI.WebControls.Literal) this.FindControl("litTilte"); this.lblFront = (System.Web.UI.WebControls.Label) this.FindControl("lblFront"); this.lblNext = (System.Web.UI.WebControls.Label) this.FindControl("lblNext"); this.aFront = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front"); this.aNext = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next"); this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle"); this.lblNextTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle"); if (!this.Page.IsPostBack) { AfficheInfo affiche = CommentBrowser.GetAffiche(this.affichesId); if (affiche != null) { PageTitle.AddSiteNameTitle(affiche.Title); this.litTilte.Text = affiche.Title; string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("AffichesDetails", new object[] { this.affichesId }); this.litContent.Text = affiche.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litAffichesAddedDate.Time = affiche.AddedDate; AfficheInfo frontOrNextAffiche = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Front"); AfficheInfo frontOrNextAffiche2 = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Next"); if (frontOrNextAffiche != null && frontOrNextAffiche.AfficheId > 0) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche.AfficheId; this.lblFrontTitle.Text = frontOrNextAffiche.Title; } } else { if (this.lblFront != null) { this.lblFront.Visible = false; } } if (frontOrNextAffiche2 != null && frontOrNextAffiche2.AfficheId > 0) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche2.AfficheId; this.lblNextTitle.Text = frontOrNextAffiche2.Title; return; } } else { if (this.lblNext != null) { this.lblNext.Visible = false; } } } } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId)) { base.GotoResourceNotFound(); } this.litArticleAddedDate = (FormatedTimeLabel)this.FindControl("litArticleAddedDate"); this.litArticleContent = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleContent"); this.litArticleDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleDescription"); this.litArticleTitle = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleTitle"); this.lblFront = (System.Web.UI.WebControls.Label) this.FindControl("lblFront"); this.lblNext = (System.Web.UI.WebControls.Label) this.FindControl("lblNext"); this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle"); this.lblNextTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle"); this.aFront = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front"); this.aNext = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next"); this.ariticlative = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative"); if (!this.Page.IsPostBack) { ArticleInfo article = CommentBrowser.GetArticle(this.articleId); if (article != null && article.IsRelease) { PageTitle.AddSiteNameTitle(article.Title, Hidistro.Membership.Context.HiContext.Current.Context); if (!string.IsNullOrEmpty(article.MetaKeywords)) { MetaTags.AddMetaKeywords(article.MetaKeywords, Hidistro.Membership.Context.HiContext.Current.Context); } if (!string.IsNullOrEmpty(article.MetaDescription)) { MetaTags.AddMetaDescription(article.MetaDescription, Hidistro.Membership.Context.HiContext.Current.Context); } this.litArticleTitle.Text = article.Title; this.litArticleDescription.Text = article.Description; string str = Hidistro.Membership.Context.HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { this.articleId }); this.litArticleContent.Text = article.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litArticleAddedDate.Time = article.AddedDate; ArticleInfo frontOrNextArticle = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId); if (frontOrNextArticle != null && frontOrNextArticle.ArticleId > 0) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { frontOrNextArticle.ArticleId }); this.lblFrontTitle.Text = frontOrNextArticle.Title; } } else { if (this.lblFront != null) { this.lblFront.Visible = false; } } ArticleInfo frontOrNextArticle2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId); if (frontOrNextArticle2 != null && frontOrNextArticle2.ArticleId > 0) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { frontOrNextArticle2.ArticleId }); this.lblNextTitle.Text = frontOrNextArticle2.Title; } } else { if (this.lblNext != null) { this.lblNext.Visible = false; } } this.ariticlative.DataSource = CommentBrowser.GetArticlProductList(this.articleId); this.ariticlative.DataBind(); } } }
private void TratarComboStatusOferta(DropDownList ddlStatusOferta, classes.MatriculaOferta matriculaOferta, Label statusOferta = null) { var permiteAlteracao = matriculaOferta.Oferta.AlteraPeloGestorUC; // Caso esteja em modo de avaliação, só adiciona o Status atual da matrícula e esconde o dropdown. if (!InModoDeAvaliacao && (permiteAlteracao == true || _manterUsuario.PerfilAdministrador())) { if (ddlStatusOferta != null) { var categoriaConteudo = new ManterSolucaoEducacional().ObterSolucaoEducacionalPorId(matriculaOferta.Oferta.SolucaoEducacional.ID).CategoriaConteudo; var listaStatusMatricula = (new ManterStatusMatricula()).ObterStatusMatriculaPorCategoriaConteudo(categoriaConteudo) .Where(p => p.ID != (int)enumStatusMatricula.Reprovado).ToList(); // Obter lista usando AutoMapper para não alterar a lista original com a adição // do status "Cancelado\Turma" abaixo. Mapper.Map(ListaStatusMatricula, listaStatusMatricula); if (matriculaOferta.StatusMatricula == enumStatusMatricula.CanceladoTurma) { var cancelado = new ManterStatusMatricula().ObterStatusMatriculaPorID( (int)enumStatusMatricula.CanceladoTurma); listaStatusMatricula.Add(cancelado); listaStatusMatricula = listaStatusMatricula.OrderBy(x => x.Nome).ToList(); } // Caso o status atual não exista na lista de status disponíveis, insere ele na lista. if (!listaStatusMatricula.Select(x => x.ID).Contains((int)matriculaOferta.StatusMatricula)) { var statusAtual = new ManterStatusMatricula().ObterStatusMatriculaPorID((int)matriculaOferta.StatusMatricula); listaStatusMatricula.Add(statusAtual); // Reordenar a lista. listaStatusMatricula = listaStatusMatricula.OrderBy(x => x.Nome).ToList(); } WebFormHelper.PreencherLista(listaStatusMatricula, ddlStatusOferta); // Desabilitar a opção de cancelamento. if (matriculaOferta.StatusMatricula == enumStatusMatricula.CanceladoTurma) { ddlStatusOferta.Items.FindByValue(((int)enumStatusMatricula.CanceladoTurma).ToString()).Attributes.Add("disabled", "disabled"); } var idStatusMatricula = (int)matriculaOferta.StatusMatricula; WebFormHelper.SetarValorNaCombo(idStatusMatricula.ToString(), ddlStatusOferta); } } else { ddlStatusOferta.Visible = false; if (statusOferta != null) { statusOferta.Visible = true; statusOferta.Text = matriculaOferta.StatusMatriculaFormatado; } } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["activityId"], out this.activityId)) { base.GotoResourceNotFound(); } this.hlkLink = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlkLink"); this.litHelpDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpDescription"); this.litHelpTitle = (System.Web.UI.WebControls.Literal) this.FindControl("litHelpTitle"); this.lblFront = (System.Web.UI.WebControls.Label) this.FindControl("lblFront"); this.lblNext = (System.Web.UI.WebControls.Label) this.FindControl("lblNext"); this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle"); this.lblNextTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle"); this.aFront = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front"); this.aNext = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next"); if (!this.Page.IsPostBack && this.activityId > 0) { PromotionInfo promote = CommentBrowser.GetPromote(this.activityId); if (promote == null) { base.GotoResourceNotFound(); } else { PageTitle.AddSiteNameTitle(promote.Name, Hidistro.Membership.Context.HiContext.Current.Context); this.litHelpTitle.Text = promote.Name; this.litHelpDescription.Text = promote.Description; PromotionInfo frontOrNextPromoteInfo = CommentBrowser.GetFrontOrNextPromoteInfo(promote, "Front"); if (frontOrNextPromoteInfo != null) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "FavourableDetails.aspx?activityId=" + frontOrNextPromoteInfo.ActivityId; this.lblFrontTitle.Text = frontOrNextPromoteInfo.Name; } } else { if (this.lblFront != null) { this.lblFront.Visible = false; } } PromotionInfo frontOrNextPromoteInfo2 = CommentBrowser.GetFrontOrNextPromoteInfo(promote, "Next"); if (frontOrNextPromoteInfo2 != null) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "FavourableDetails.aspx?activityId=" + frontOrNextPromoteInfo2.ActivityId; this.lblNextTitle.Text = frontOrNextPromoteInfo2.Name; } } else { if (this.lblNext != null) { this.lblNext.Visible = false; } } } } }
protected void Page_Load(object sender, EventArgs e) { System.Web.UI.WebControls.Label la = this.Master.FindControl("Label1") as System.Web.UI.WebControls.Label; la.Text = Session["User"].ToString(); Label5.Text = ""; }
private void dlstOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus"); string a = ""; if (!(System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") is System.DBNull)) { a = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway"); } int num = (int)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyId"); System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnEditPrice"); System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lkbtnSendGoods"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litCloseOrder"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckReplace"); ImageLinkButton imageLinkButton3 = (ImageLinkButton)e.Item.FindControl("lkbtnOrderMatch"); if (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")) { imageLinkButton3.Visible = true; } if (orderStatus == OrderStatus.WaitBuyerPay) { hyperLink.Visible = true; literal.Visible = true; if (a != "hishop.plugins.payment.podrequest") { imageLinkButton.Visible = true; } } if (orderStatus == OrderStatus.ApplyForRefund) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.ApplyForReturns) { htmlAnchor2.Visible = true; } if (orderStatus == OrderStatus.ApplyForReplacement) { htmlAnchor3.Visible = true; } if (num > 0) { GroupBuyStatus groupBuyStatus = (GroupBuyStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "GroupBuyStatus"); label.Visible = ((orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")) && groupBuyStatus == GroupBuyStatus.Success); } else { label.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")); } imageLinkButton2.Visible = (orderStatus == OrderStatus.SellerAlreadySent); string orderid = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderId"); if (Methods.Supplier_ShipOrderHasAllSendGood(orderid) && orderStatus == OrderStatus.SellerAlreadySent) { imageLinkButton2.Visible = true; return; } imageLinkButton2.Visible = false; } }