/// <summary> /// GRID3(商品)检索的判断条件 /// </summary> /// <returns></returns> private List <ConditionFun.SqlqueryCondition> InquiryConditionProduct() { string _SHOP_ID = ddlSHOP_NAME.SelectedValue; var modelShop = new SHOP00(x => x.SHOP_ID == _SHOP_ID); List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>(); //取价格区域 conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, V_Product01_PRCAREATable.PRCAREA_ID, Comparison.Equals, modelShop.SHOP_Price_Area, false, false)); FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_ID") as FineUI.TextBox; var _PROD_ID = cPROD_ID.Text; if (!String.IsNullOrEmpty(cPROD_ID.Text)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", false, false)); } FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME") as FineUI.TextBox; var _PROD_NAME = cPROD_NAME.Text; if (!String.IsNullOrEmpty(_PROD_NAME)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", false, false)); } FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME_SPELLING") as FineUI.TextBox; var _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text; if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", false, false)); } FineUI.DropDownList cPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList; var _cPROD_KIND = cPROD_KIND.SelectedValue; if (!String.IsNullOrEmpty(_cPROD_KIND) && _cPROD_KIND != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_KIND, Comparison.Equals, _cPROD_KIND, false, false)); } FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList; var _PROD_DEP = cPROD_DEP.SelectedValue; if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_DEP, Comparison.Equals, _PROD_DEP, false, false)); } FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList; var _PROD_CATE = cPROD_CATE.SelectedValue; if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_CATE, Comparison.Equals, _PROD_CATE, false, false)); } return(conditionProdduct00List); }
/// <summary> /// GRID4检索的判断条件 /// </summary> /// <returns></returns> private List <ConditionFun.SqlqueryCondition> InquiryCondition() { List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>(); //conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, "1", Comparison.Equals, "1", false, false)); bool sFlag = true; FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("cPROD_ID") as FineUI.TextBox; var _PROD_ID = cPROD_ID.Text; if (!String.IsNullOrEmpty(cPROD_ID.Text)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", false, false)); sFlag = false; } FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("cPROD_NAME") as FineUI.TextBox; var _PROD_NAME = cPROD_NAME.Text; if (!String.IsNullOrEmpty(_PROD_NAME)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", false, false)); sFlag = false; } FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("cPROD_NAME_SPELLING") as FineUI.TextBox; var _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text; if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", false, false)); sFlag = false; } FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("cPROD_DEP") as FineUI.DropDownList; var _PROD_DEP = cPROD_DEP.SelectedValue; if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_DEP, Comparison.Equals, _PROD_DEP, false, false)); sFlag = false; } FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("cPROD_CATE") as FineUI.DropDownList; var _PROD_CATE = cPROD_CATE.SelectedValue; if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_CATE, Comparison.Equals, _PROD_CATE, false, false)); sFlag = false; } if (sFlag) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), "1", Comparison.Equals, "1", false, false)); } return(conditionProdduct00List); }
private void Bind() { FineUI.TextBox tbx = FormPanel.FindControl("txtInput") as FineUI.TextBox; FineUI.FileUpload fu1 = FormPanel.FindControl("up1") as FineUI.FileUpload; FineUI.FileUpload fu2 = FormPanel.FindControl("up2") as FineUI.FileUpload; HtmlEditor html1 = FormPanel.FindControl("he1") as HtmlEditor; if (ViewState["type"].ToString() == "1") { } }
//提交事件 protected void Button1_Click(object sender, EventArgs e) { try { string reasons = string.Empty; string works = string.Empty; for (int i = 0; i < len; i++) { string rowid = "rowUser" + i; string txtid = "txtReason" + i; string workname = "txtWork" + i; FormRow rowUser = Form2.FindControl(rowid) as FormRow; FineUI.TextBox reason = rowUser.FindControl(txtid) as FineUI.TextBox; FineUI.TextBox work = rowUser.FindControl(workname) as FineUI.TextBox; //&符号拼接 reasons += reason.Text + "&"; works += work.Text + "&"; } reasons = reasons.Substring(0, reasons.Length - 1); string flag = string.Empty; if (IsAdd.ToString() == "新增") { flag = operate.InsertRecommend(typename, id, reasons, Convert.ToBoolean(isenable), works); } else if (IsAdd.ToString() == "修改") { flag = operate.UpdateRecommend(typename, id, reasons, Convert.ToBoolean(isenable), works); } if (flag == "保存成功" || flag == "修改成功") { PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); Alert.ShowInParent(flag); } else { Alert.ShowInParent(flag); } } catch (Exception ex) { Alert.ShowInParent(ex.Message.ToString()); } }
private void loadEvaluateTable() { string exception = ""; string evaluatedID = Request.QueryString["id"]; string name = Request.QueryString["name"]; Panel1.Title = name + "的考核表"; EvaluateTable evaluateTable = new EvaluateTable(); if (EvaluateTableManagementCtrl.GetEvaluateTable(evaluatedID, ref evaluateTable, ref exception)) { Label_EvaluatedName.Text = evaluateTable.EvaluatedName; Label_PostName.Text = evaluateTable.PostName; Label_LaborDep.Text = evaluateTable.LaborDep; Label_LaborUnit.Text = evaluateTable.LaborUnit; Label_Period.Text = evaluateTable.StartTime + " ~ " + evaluateTable.StopTime; int count = 1; foreach (Quota item in evaluateTable.KeyResponse) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_KeyResponse_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_KeyResponse_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_KeyResponse_" + count; ta.Label = "内容"; ta.Text = item.Content[0]; ta.Readonly = true; sf.Items.Add(ta); Panel3.Items.Add(sf); count++; } count = 1; foreach (Quota item in evaluateTable.KeyQualify) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_KeyQualify_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_KeyQualify_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_KeyQualify_" + count; ta.Label = "内容"; ta.Text = "优:" + item.Content[0] + "良:" + item.Content[1] + "中:" + item.Content[2] + "差:" + item.Content[3]; ta.Readonly = true; sf.Items.Add(ta); Panel4.Items.Add(sf); count++; } count = 1; foreach (Quota item in evaluateTable.KeyAttitude) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_KeyAttitude_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_KeyAttitude_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_KeyAttitude_" + count; ta.Label = "内容"; ta.Text = "优:" + item.Content[0] + "良:" + item.Content[1] + "中:" + item.Content[2] + "差:" + item.Content[3]; ta.Readonly = true; sf.Items.Add(ta); Panel5.Items.Add(sf); count++; } count = 1; foreach (Quota item in evaluateTable.Response) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_Response_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_Response_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_Response_" + count; ta.Label = "内容"; ta.Text = item.Content[0]; ta.Readonly = true; sf.Items.Add(ta); Panel6.Items.Add(sf); count++; } count = 1; foreach (Quota item in evaluateTable.Qualify) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_Qualify_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_Qualify_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_Qualify_" + count; ta.Label = "内容"; ta.Text = "优:" + item.Content[0] + "良:" + item.Content[1] + "中:" + item.Content[2] + "差:" + item.Content[3]; ta.Readonly = true; sf.Items.Add(ta); Panel7.Items.Add(sf); count++; } count = 1; foreach (Quota item in evaluateTable.Attitude) { SimpleForm sf = new SimpleForm(); sf.ID = "SimpleForm_Attitude_" + count; sf.ShowHeader = false; sf.ShowBorder = true; sf.BodyPadding = "5px"; FineUI.TextBox tb = new FineUI.TextBox(); tb.ID = "TextBox_Attitude_" + count; tb.Label = "标题"; tb.Text = item.Title; tb.Readonly = true; sf.Items.Add(tb); FineUI.TextArea ta = new FineUI.TextArea(); ta.ID = "TextArea_Attitude_" + count; ta.Label = "内容"; ta.Text = "优:" + item.Content[0] + "良:" + item.Content[1] + "中:" + item.Content[2] + "差:" + item.Content[3]; ta.Readonly = true; sf.Items.Add(ta); Panel8.Items.Add(sf); count++; } SimpleForm sf__reject = new SimpleForm(); sf__reject.ID = "SimpleForm_Reject"; sf__reject.ShowBorder = true; sf__reject.ShowHeader = false; sf__reject.BodyPadding = "5px"; TextArea ta1 = new TextArea(); ta1.Label = "严重违反规章制度"; ta1.Text = "累计旷工3天以上的;\n严重失职,营私舞弊,给本单位造成3000元以上经济损失或者其它严重后果的;\n同时与其他用人单位建立劳动关系,对完成本单位工作任务造成严重影响,或者经本单位提出,拒不改正的;\n违背职业道德,行贿、受贿价值超过3000元以上的;\n被依法追究刑事责任的;"; TextArea ta2 = new TextArea(); ta2.Label = "其他"; ta2.Text = evaluateTable.Reject[0].Content[0]; ta1.Readonly = true; ta2.Readonly = true; sf__reject.Items.Add(ta1); sf__reject.Items.Add(ta2); Panel9.Items.Add(sf__reject); Label_Comment.Text = evaluateTable.Comment; } else { Alert.ShowInTop("未查寻到考核表!\n原因:" + exception, MessageBoxIcon.Error); } }
/// <summary> /// GRID3检索的判断条件 /// </summary> /// <returns></returns> private List <ConditionFun.SqlqueryCondition> InquiryConditionProduct() { string _shop_id = ddlSHOP_NAME.SelectedValue; var model = new SHOP00(x => x.SHOP_ID == _shop_id); List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>(); bool sFlag = true; string _SUP_ID = ddlSUP_NAME.SelectedValue; conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Or, V_Product01_PRCAREATable.PROD_TYPE, Comparison.In, new string[2] { "1", "2" }, true, true)); if (!String.IsNullOrEmpty(_SUP_ID)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.SUP_ID, Comparison.Like, _SUP_ID, true, false)); sFlag = false; } if (!String.IsNullOrEmpty(model.SHOP_Price_Area)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PRCAREA_ID, Comparison.Equals, model.SHOP_Price_Area, true, true)); sFlag = false; } //conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, "1", Comparison.Equals, "1", false, false)); FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_ID") as FineUI.TextBox; var _PROD_ID = cPROD_ID.Text; if (!String.IsNullOrEmpty(cPROD_ID.Text)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", true, true)); sFlag = false; } FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME") as FineUI.TextBox; var _PROD_NAME = cPROD_NAME.Text; if (!String.IsNullOrEmpty(_PROD_NAME)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", true, true)); sFlag = false; } FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME_SPELLING") as FineUI.TextBox; var _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text; if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING)) { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", true, true)); sFlag = false; } FineUI.DropDownList cPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList; var _cPROD_KIND = cPROD_KIND.SelectedValue; if (!String.IsNullOrEmpty(_cPROD_KIND) && _cPROD_KIND != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_KIND, Comparison.Equals, _cPROD_KIND, true, true)); sFlag = false; } FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList; var _PROD_DEP = cPROD_DEP.SelectedValue; if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_DEP, Comparison.Equals, _PROD_DEP, true, true)); sFlag = false; } FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList; var _PROD_CATE = cPROD_CATE.SelectedValue; if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0") { conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_CATE, Comparison.Equals, _PROD_CATE, true, true)); sFlag = false; } return(conditionProdduct00List); }
// 动态创建控件 // 注意:这段代码需要每次加载页面都执行,因此不能放在 if(!IsPostBack) 逻辑判断中 protected void Page_Init(object sender, EventArgs e) { IsAdd = RequestHelper.GetRequestString("IsAdd", ""); id = RequestHelper.GetRequestString("id", ""); name = RequestHelper.GetRequestString("name", ""); typename = RequestHelper.GetRequestString("typename", ""); isenable = RequestHelper.GetRequestString("isenable", ""); //非空判断 if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(name) || string.IsNullOrEmpty(typename) || string.IsNullOrEmpty(isenable)) { Alert.ShowInParent("请选择演员"); return; } string[] strid = id.Split(','); string[] strname = name.Split(','); len = strname.Length; if (IsAdd.ToString() == "修改") { //获取理由 DataTable dt = operate.GetRecommendByTypeNameEach(typename); // 创建一个 FormRow 控件并添加到 Form2 for (int i = 0; i < len; i++) { FormRow row = new FormRow(); row.ID = "rowUser" + i; Form2.Rows.Add(row); row.ColumnWidths = "50% 50%"; FineUI.TextBox tbxUser = new FineUI.TextBox(); FineUI.TextBox tbxWork = new FineUI.TextBox(); tbxUser.ID = "txtReason" + i; tbxUser.Text = ""; tbxUser.Label = strname[i]; tbxUser.ShowLabel = true; tbxUser.ShowRedStar = false; tbxUser.Required = false; tbxUser.MaxLength = 200; tbxUser.EmptyText = "请输入推荐理由"; tbxWork.ID = "txtWork" + i; tbxWork.Text = ""; tbxWork.Label = "作品"; tbxWork.ShowLabel = true; tbxWork.ShowRedStar = false; tbxWork.Required = false; tbxWork.MaxLength = 30; tbxWork.EmptyText = "请输入作品"; for (int m = 0; m < dt.Rows.Count; m++) { if (dt.Rows[m]["PersonID"].ToString() == strid[i]) { tbxUser.Text = dt.Select(" PersonID='" + strid[i] + "' ")[0]["Reason"].ToString(); tbxWork.Text = dt.Select(" PersonID='" + strid[i] + "' ")[0]["Work"].ToString(); } } row.Items.Add(tbxUser); row.Items.Add(tbxWork); } } else if (IsAdd.ToString() == "新增") { // 创建一个 FormRow 控件并添加到 Form2 for (int i = 0; i < len; i++) { FormRow row = new FormRow(); row.ID = "rowUser" + i; Form2.Rows.Add(row); row.ColumnWidths = "50% 50%"; FineUI.TextBox tbxUser = new FineUI.TextBox(); tbxUser.ID = "txtReason" + i; tbxUser.Text = ""; tbxUser.Label = strname[i]; tbxUser.ShowLabel = true; tbxUser.ShowRedStar = false; tbxUser.Required = false; tbxUser.MaxLength = 200; tbxUser.EmptyText = "请输入推荐理由"; row.Items.Add(tbxUser); FineUI.TextBox tbxWork = new FineUI.TextBox(); tbxWork.ID = "txtWork" + i; tbxWork.Text = ""; tbxWork.Label = "作品"; tbxWork.ShowLabel = true; tbxWork.ShowRedStar = false; tbxWork.Required = false; tbxWork.MaxLength = 30; tbxWork.EmptyText = "请输入作品"; row.Items.Add(tbxWork); } } }
protected void Page_Init(object sender, EventArgs e) { ds = new DataSet(); ds = manage.GetSearchList(" t.id= '" + Request["id"].ToString() + "' "); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ViewState["PROPERTYID"] = ds.Tables[0].Rows[i]["PROPERTYID"].ToString(); ViewState["PROPERTYTYPE"] = ds.Tables[0].Rows[i]["PROPERTYTYPE"].ToString(); switch (ds.Tables[0].Rows[i]["PROPERTYTYPE"].ToString()) { case "0": tb = new FineUI.TextBox(); tb.ID = "txtInput"; tb.Label = ds.Tables[0].Rows[i]["PROPERTYNAME"].ToString(); tb.ShowLabel = true; FormPanel.Items.Add(tb); break; case "1": fl = new FineUI.FileUpload(); fl.ID = "up1"; fl.Label = "高分辨率BANNER"; fl.ShowLabel = true; FormPanel.Items.Add(fl); img1 = new FineUI.Image(); img1.ID = "ig1"; img1.Hidden = true; FormPanel.Items.Add(img1); fl = new FineUI.FileUpload(); fl.ID = "up2"; fl.Label = "低分辨率BANNER"; fl.ShowLabel = true; FormPanel.Items.Add(fl); img2 = new FineUI.Image(); img2.ID = "ig2"; img2.Hidden = true; FormPanel.Items.Add(img2); break; case "2": he = new FineUI.HtmlEditor(); he.ID = "he1"; he.Label = ds.Tables[0].Rows[i]["PROPERTYNAME"].ToString(); he.ShowLabel = true; FormPanel.Items.Add(he); break; } } } FineUI.TextBox tbx = FormPanel.FindControl("txtInput") as FineUI.TextBox; FineUI.FileUpload fu1 = FormPanel.FindControl("up1") as FineUI.FileUpload; FineUI.FileUpload fu2 = FormPanel.FindControl("up2") as FineUI.FileUpload; HtmlEditor html1 = FormPanel.FindControl("he1") as HtmlEditor; ds = new DataSet(); ds = mPv.GetList(" cms_property_value.tagid = '" + Request["id"].ToString() + "'"); if (ds.Tables[0].Rows.Count > 0) { ViewState["type"] = "1"; for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ViewState["ID"] = ds.Tables[0].Rows[i]["ID"].ToString(); //ViewState["PROPERTYID"] = ds.Tables[0].Rows[i]["PROPERTYID"].ToString(); switch (ds.Tables[0].Rows[i]["PROPERTYTYPE"].ToString()) { case "0": tbx.Text = ds.Tables[0].Rows[i]["PROPERTYVALUE"].ToString(); break; case "1": if (ds.Tables[0].Rows[i]["PROPERTYTYPE"] != null && ds.Tables[0].Rows[i]["PROPERTYTYPE"].ToString() != "") { string[] strUpload = ds.Tables[0].Rows[i]["PROPERTYVALUE"].ToString().Split(','); ViewState["up1"] = strUpload[0].ToString(); ViewState["up2"] = strUpload[1].ToString(); img1.ImageUrl = strUpload[0].ToString(); img2.ImageUrl = strUpload[1].ToString(); img1.Hidden = false; img2.Hidden = false; } else { ViewState["up1"] = ""; ViewState["up2"] = ""; } break; case "2": html1.Text = ds.Tables[0].Rows[i]["PROPERTYVALUE"].ToString(); break; } } } else { ViewState["type"] = "0"; } }
protected void btnAdd_Click(object sender, EventArgs e) { FineUI.TextBox tbx = FormPanel.FindControl("txtInput") as FineUI.TextBox; FineUI.FileUpload fu1 = FormPanel.FindControl("up1") as FineUI.FileUpload; FineUI.FileUpload fu2 = FormPanel.FindControl("up2") as FineUI.FileUpload; HtmlEditor html1 = FormPanel.FindControl("he1") as HtmlEditor; switch (ViewState["type"].ToString()) { case "0": pvModel.ID = Guid.NewGuid().ToString(); pvModel.TAGID = Request["id"].ToString(); pvModel.PROPERTYID = ViewState["PROPERTYID"].ToString(); switch (ViewState["PROPERTYTYPE"].ToString()) { case "0": pvModel.PROPERTYVALUE = tbx.Text; break; case "1": if (fu1.HasFile && fu2.HasFile) { string url1 = @"Uploads/Others/High/" + pictureName() + Path.GetExtension(fu1.PostedFile.FileName); string url2 = @"Uploads/Others/Low/" + pictureName() + Path.GetExtension(fu2.PostedFile.FileName); fu1.SaveAs(Server.MapPath("~/" + url1)); fu2.SaveAs(Server.MapPath("~/" + url2)); pvModel.PROPERTYVALUE = url1 + "," + url2; } else { pvModel.PROPERTYVALUE = ViewState["up1"].ToString() + "," + ViewState["up2"].ToString(); } break; case "2": pvModel.PROPERTYVALUE = html1.Text; break; } bool rs = mPv.Add(pvModel); if (rs != false) { Alert.ShowInParent("保存成功。", string.Empty, ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInParent("提交失败"); } break; case "1": pvModel.ID = ViewState["ID"].ToString(); pvModel.TAGID = Request["id"].ToString(); pvModel.PROPERTYID = ViewState["PROPERTYID"].ToString(); switch (ViewState["PROPERTYTYPE"].ToString()) { case "0": pvModel.PROPERTYVALUE = tbx.Text; break; case "1": string url1 = @"~/Uploads/Others/" + pictureName() + Path.GetExtension(fu1.PostedFile.FileName); string url2 = @"~/Uploads/Others/" + pictureName() + Path.GetExtension(fu2.PostedFile.FileName); fu1.SaveAs(Server.MapPath(url1)); fu2.SaveAs(Server.MapPath(url2)); pvModel.PROPERTYVALUE = url1 + "," + url2; break; case "2": pvModel.PROPERTYVALUE = html1.Text; break; } bool rx = mPv.Update(pvModel); if (rx != false) { Alert.ShowInParent("保存成功。", string.Empty, ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInParent("提交失败"); } break; } //Alert.Show(tbx.Text); }