public void AddDDL(string ddl) { DDL d = new DDL(); d.ID = ddl; this.Add(d); }
/// <summary> /// 初始化类 /// </summary> /// <param name="ddl"></param> /// <param name="aa"></param> /// <param name="selectVal"></param> public Type InitClassName(DDL ddl, Type[] types, string selectVal) { Type mytype = null; foreach (Type tp in types) { if (tp.IsClass == false) { continue; } if (tp.IsCOMObject == true) { continue; } if (tp.IsEnum == true) { continue; } if (mytype == null) { mytype = tp; } if (tp.Name.Contains("<") || tp.Name.Contains("{")) { continue; } ddl.Items.Add(new ListItem(tp.FullName, tp.FullName)); if (tp.FullName == selectVal) { mytype = tp; } } //返回. return(mytype); }
public List <DDL> GetDDL(string UserCode) { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@UserCode", UserCode), new SqlParameter("@QryOption", "2") }; List <DDL> _DBModelList = new List <DDL>(); try { DataTable dt = ExecuteDataTable("bimob.dbo.sp_productionAccounting", param); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { DDL _DBModel = new DDL(); _DBModel.LocationRef = dr["LocationRef"].ToString(); _DBModel.LocationName = dr["LocationName"].ToString(); _DBModel.ProcessCode = dr["ProcessCode"].ToString(); _DBModel.ProcessName = dr["ProcessName"].ToString(); _DBModelList.Add(_DBModel); } } return(_DBModelList); } catch (Exception ex) { //ErrorSignal.FromCurrentContext().Raise(ex); throw ex; } finally { _DBModelList = null; } }
/// <summary> /// 类名 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ddl_Class_SelectedIndexChanged(object sender, EventArgs e) { //获得选择的名称. string ddlName = this.Pub1.GetDDLByID("DDL_MonthedDLL").SelectedItemStringVal; //类名. string clsName = this.Pub1.GetDDLByID("DDL_MonthedClass").SelectedItemStringVal; //实例化该Type. Assembly abl = Assembly.LoadFrom(ddlName); // 载入程序集 Type[] tps = abl.GetTypes(); Type mytp = null; foreach (Type item in tps) { if (clsName.Contains(item.Name) == true) { mytp = item; break; } } // 获得该类的方法名, 重新绑定方法. DDL ddl = this.Pub1.GetDDLByID("DDL_MonthedName"); ddl.Items.Clear(); //绑定方法. ParameterInfo[] myPI = this.InitMethodName(ddl, mytp.GetMethods(), null); //生成提示标签. this.Pub1.GetLabelByID("Lab_Note").Text = this.GenerParas(myPI); }
/// <summary> /// dll文件. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ddl_SelectedIndexChanged(object sender, EventArgs e) { //获得选择的名称. string ddlName = this.Pub1.GetDDLByID("DDL_MonthedDLL").SelectedItemStringVal; //获得 DDL ddl = this.Pub1.GetDDLByID("DDL_MonthedClass"); ddl.Items.Clear(); //获得方法. Assembly abl = Assembly.LoadFrom(ddlName); // 载入程序集 Type[] types = null; try { types = abl.GetTypes(); } catch (Exception ex) { Response.Write("<script>alert('载入类出现错误:" + ex.Message + "');history.back();</script>"); return; } Type mytype = this.InitClassName(ddl, types, ""); // 获得该类的方法名, 重新绑定方法. ddl = this.Pub1.GetDDLByID("DDL_MonthedName"); ddl.Items.Clear(); ParameterInfo[] myPI = InitMethodName(ddl, mytype.GetMethods(), "");; //生成提示标签. this.Pub1.GetLabelByID("Lab_Note").Text = this.GenerParas(myPI); }
protected void Page_Load(object sender, EventArgs e) { #region 处理查询权限, 此处不要修改,以Search.ascx为准. // this.Page.RegisterClientScriptBlock("sss", //"<link href='" + BP.WF.Glo.CCFlowAppPath + "WF/Comm/Style/Table" + BP.Web.WebUser.Style + ".css' rel='stylesheet' type='text/css' />"); currMapRpt = new MapRpt(this.RptNo); Entity en = this.HisEns.GetNewEntity; Flow fl = new Flow(this.currMapRpt.FK_Flow); //初始化查询工具栏. this.ToolBar1.InitToolbarOfMapRpt(fl, currMapRpt, this.RptNo, en, 1); this.ToolBar1.AddLinkBtn(BP.Web.Controls.NamesOfBtn.Export); //增加转到. this.ToolBar1.Add(" "); DDL ddl = new DDL(); ddl.ID = "GoTo"; ddl.Items.Add(new ListItem("查询", "Search")); // ddl.Items.Add(new ListItem("高级查询", "SearchAdv")); ddl.Items.Add(new ListItem("分组分析", "Group")); ddl.Items.Add(new ListItem("交叉报表", "D3")); ddl.Items.Add(new ListItem("对比分析", "Contrast")); ddl.SetSelectItem(this.PageID); this.ToolBar1.AddDDL(ddl); ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged_GoTo); this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Search).Click += new System.EventHandler(this.ToolBar1_ButtonClick); this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Export).Click += new System.EventHandler(this.ToolBar1_ButtonClick); #endregion 处理查询权限 //处理按钮. this.SetDGData(); }
private List <SelectListItem> GetCategories(string selectedCategory) { List <SelectListItem> categories = new List <SelectListItem>(); var categoris = _dataManager.CategoriesGetAll().Result; return(categories = DDL.ToDropDownList(categoris, selectedCategory)); }
public static (TriggerClassType, TriggerBeforeAfterType?, IList <TriggerEventType>) Parse(ulong type) { var @class = ParseTriggerClassType(type); switch (@class) { case TriggerClassType.DML: { var(beforeAfter, @event) = DML.Parse(type); return(@class, beforeAfter, @event); } case TriggerClassType.DB: { return(@class, null, DB.Parse(type)); } case TriggerClassType.DDL: { var(beforeAfter, @event) = DDL.Parse(type); return(@class, beforeAfter, @event); } } throw UnknownTriggerTypeException(type); }
private List <SelectListItem> GetRegions(string selectedRegion) { List <SelectListItem> regions = new List <SelectListItem>(); var regionss = _dataManager.RegionsGetAll().Result; return(regions = DDL.ToDropDownList(regionss, selectedRegion)); }
/// <summary> /// gets the current database and completes it with the user selected ddl file /// </summary> void completeDBwithDLL() { // initialize database var selectedPackage = this.model.selectedElement as UTF_EA.Package; var selectedDatabase = DB2DatabaseTransformer.getFactory(this.model, DB2StrategyFactory.getInstance()).createDataBase(selectedPackage); // get user selected DDL file var browseDDLFileDialog = new OpenFileDialog(); browseDDLFileDialog.Filter = "DDL File |*.sql;*.txt"; browseDDLFileDialog.FilterIndex = 1; browseDDLFileDialog.Multiselect = false; var dialogResult = browseDDLFileDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { var ddlFileName = browseDDLFileDialog.FileName; //read the file contents //workaround to make sure it also works when the file is open var fileStream = new FileStream(ddlFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); var reader = new StreamReader(fileStream); string source = reader.ReadToEnd(); var ddl = new DDL(); ddl.Parse(source); new DB2DatabaseTransformer(this.model, null, DB2StrategyFactory.getInstance()) .complete(selectedDatabase, ddl); } }
protected void Page_Load(object sender, EventArgs e) { this.ToolBar1.AddBtn(NamesOfBtn.Forward, "移交"); this.ToolBar1.AddBtn(NamesOfBtn.Cancel, "取消"); this.ToolBar1.GetBtnByID(NamesOfBtn.Forward).Attributes["onclick"] = " return confirm('您确定要执行吗?');"; Depts depts = new Depts(); depts.RetrieveAllFromDBSource(); this.ToolBar1.AddDDL("DDL_Dept"); DDL ddl = this.ToolBar1.GetDDLByID("DDL_Dept"); ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged); foreach (Dept dept in depts) { ListItem li = new ListItem(); li.Text = BP.DA.DataType.GenerSpace(dept.Grade - 1) + dept.Name; li.Text = BP.DA.DataType.GenerSpace(dept.Grade - 1) + dept.Name; li.Text = li.Text.Replace(" ", "_"); li.Value = dept.No; ddl.Items.Add(li); if (this.FK_Dept == li.Value) { li.Selected = true; } } this.ToolBar1.AddLab("ds", " 请选择移交人,输入移交原因,点移交按钮执行工作移交。"); this.ToolBar1.GetBtnByID(NamesOfBtn.Forward).Click += new EventHandler(Forward_Click); this.ToolBar1.GetBtnByID(NamesOfBtn.Cancel).Click += new EventHandler(Forward_Click); this.BindLB(); }
private List <SelectListItem> GetCities(Guid regionId, string selectedCity) { List <SelectListItem> cities = new List <SelectListItem>(); var citis = _dataManager.CitiesByRegionGetAll(regionId).Result; cities = DDL.ToDropDownList(citis, selectedCity); return(cities); }
private void UDDL() { ds = SqlAC.CheckData("SELECT * FROM Complaints WHERE Checked='0'"); DDL.DataSource = ds.Tables[0]; DDL.DataTextField = ds.Tables[0].Columns["Title"].ToString(); DDL.DataValueField = ds.Tables[0].Columns["Title"].ToString(); DDL.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { #region 处理查询权限, 此处不要修改,以Search.ascx为准. // this.Page.RegisterClientScriptBlock("sss", //"<link href='" + BP.WF.Glo.CCFlowAppPath + "WF/Comm/Style/Table" + BP.Web.WebUser.Style + ".css' rel='stylesheet' type='text/css' />"); currMapRpt = new MapRpt(this.RptNo); Entity en = this.HisEns.GetNewEntity; Flow fl = new Flow(this.currMapRpt.FK_Flow); this.Page.Title = fl.Name; //初始化查询工具栏. this.ToolBar1.InitToolbarOfMapRpt(fl, currMapRpt, this.RptNo, en, 1); //增加发起. if (BP.WF.Dev2Interface.Flow_IsCanStartThisFlow(this.FK_Flow, BP.Web.WebUser.No) == true) { string str = "<div style='float:right'><a href=\"javascript:WinOpen('/WF/MyFlow.aspx?FK_Flow=" + this.FK_Flow + "','df');\" ><img src='/WF/Img/Start.png' width='12px' border=0/> 发起</a></div>"; this.ToolBar1.Add(str); } if (BP.Web.WebUser.No == "admin") { string url = "/WF/Rpt/OneFlow.aspx?FK_MapData=ND" + int.Parse(this.FK_Flow) + "Rpt&FK_Flow=" + this.FK_Flow; // string str = "<div style='float:right'><a href=\"javascript:Setting('"+this.RptNo+"','"+this.FK_Flow+"');\" >设置</a></div>"; string str = "<div style='float:right'><a href='" + url + "' ><img src='/WF/Img/Setting.png' width='12px' border=0/> 设置</a></div>"; this.ToolBar1.Add(str); } this.ToolBar1.AddLinkBtn(BP.Web.Controls.NamesOfBtn.Export); //导出. //增加转到. this.ToolBar1.Add(" "); DDL ddl = new DDL(); ddl.ID = "GoTo"; ddl.Items.Add(new ListItem("查询", "Search")); // ddl.Items.Add(new ListItem("高级查询", "SearchAdv")); ddl.Items.Add(new ListItem("分组分析", "Group")); ddl.Items.Add(new ListItem("交叉报表", "D3")); ddl.Items.Add(new ListItem("对比分析", "Contrast")); ddl.SetSelectItem(this.PageID); this.ToolBar1.AddDDL(ddl); ddl.AutoPostBack = true; ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged_GoTo); this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Search).Click += new System.EventHandler(this.ToolBar1_ButtonClick); this.ToolBar1.GetLinkBtnByID(NamesOfBtn.Export).Click += new System.EventHandler(this.ToolBar1_ButtonClick); #endregion 处理查询权限 //处理按钮. this.SetDGData(); }
void ddl_SelectedIndexChanged_GoTo(object sender, EventArgs e) { DDL ddl = sender as DDL; string item = ddl.SelectedItemStringVal; string tKey = DateTime.Now.ToString("MMddhhmmss"); this.Response.Redirect(item + ".aspx?RptNo=" + this.RptNo + "&FK_Flow=" + this.FK_Flow + "&T=" + tKey, true); }
void fixCheckConstraints(Database database, DDL withDDL) { var fieldsWithConstraints = from table in withDDL.statements.OfType <CreateTableStatement>() from field in table.Fields from constraint in field.Constraints.OfType <DDL_Parser.CheckConstraint>() select new { Table = table.SimpleName, FieldName = field.SimpleName, Constraintname = constraint.Field.Name, ConstraintRules = constraint.Rules }; int fixes = 0; foreach (var field in fieldsWithConstraints) { // find table var table = (Table)database.getTable(field.Table); if (table != null) { // find field var column = (Column)table.getColumn(field.FieldName); if (column != null) { var checkConstraint = table.constraints.OfType <CheckConstraint>() .FirstOrDefault(x => x.name.Equals(field.Constraintname, StringComparison.InvariantCultureIgnoreCase)); if (checkConstraint == null) { checkConstraint = new CheckConstraint(field.Constraintname, column, field.ConstraintRules); checkConstraint.save(); fixes++; } else { if (checkConstraint.rule != field.ConstraintRules) { checkConstraint.rule = field.ConstraintRules; checkConstraint.save(); fixes++; } } } else { this.log("WARNING: field " + table.name + "." + field.FieldName + " not found"); } } else { this.log("WARNING: table " + field.Table + " not found"); } } this.log(string.Format( "RESULT: Fix check constraints: fixed {0}/{1}", fixes, fieldsWithConstraints.Count() )); }
public void AskQuestion(string title, string mail, string content) { DDL.Click(); // Açılır menüye tıklar. System.Threading.Thread.Sleep(2000); // İçerik aktif olana kadar bekler. Subject.Click(); // Konuyu seçer. Title.SendKeys(title); // Konu başlığı yazar. EMail.SendKeys(mail); // E-mail'i yazar. Content.SendKeys(content); // Mesaj içeriğini yazar. //AskQuestionButton.Click(); // Bu butona tıklanırsa mağazaya soru gönderilir, o yüzden yorum satırına alınmıştır. }
public List <DDL> GetJoinedUserDDL([FromBody] DDL input) { User loginedUser = _context.User .Where(x => x.Id == HttpContext.Session.GetString("userId")) .Single(); List <User> joinedUserList = new List <Models.User>(); // 시스템 관리자와 일반 관리자가 가져오는 내용이 다르다. if (loginedUser.Level == "2-1" || loginedUser.Level == "시스템관리자") { joinedUserList = _context.User .Where(x => x.Department == input.SearchKey || input.SearchKey == "") .ToList(); List <DDL> userDDLList = new List <DDL>(); foreach (User item in joinedUserList) { DDL tempDDL = new DDL() { Text = item.Name, Value = item.Id }; userDDLList.Add(tempDDL); } return(userDDLList); } else { // 사용자 중 CRM ADMIN은 가져오지 않는다. joinedUserList = _context.User .Where(x => x.Level != "2-1" && x.Ismaster == false) .Where(x => x.Department == input.SearchKey || input.SearchKey == "") .ToList(); List <DDL> userDDLList = new List <DDL>(); foreach (User item in joinedUserList) { DDL tempDDL = new DDL() { Text = item.Name, Value = item.Id }; userDDLList.Add(tempDDL); } return(userDDLList); } }
void ddl_SelectedIndexChanged(object sender, EventArgs e) { DDL ddl = sender as DDL; if (ddl != null && ddl.ID == "DDL_D") { this.SaveState(); this.Response.Redirect("Contrast.aspx?FK_Flow=" + this.FK_Flow + "&DoType=" + this.DoType, true); return; } this.BindDG(); }
private void fixIncludedFieldsInIndex(Database database, DDL withDDL) { // find all Clustered indexes var indexes = from index in withDDL.statements.OfType <CreateIndexStatement>() where index.Parameters.Keys.Contains("INCLUDE") select index; int fixes = 0; foreach (var index in indexes) { // find table var table = (Table)database.getTable(index.Table.Name); if (table != null) { // find constraint var constraint = (Index)table.getConstraint(index.SimpleName); if (constraint != null) { string columnName = index.Parameters["INCLUDE"]; // step 1: remove involved column var column = (Column)constraint.getInvolvedColumn(columnName); if (column != null) { // mark the column as included in the constraint constraint.markAsIncluded(column); } else { this.log("WARNING: column " + table.name + "." + columnName + " not found"); } fixes++; this.log("MARKED " + index.Name + "'s INCLUDE column"); } else { this.log("WARNING: index " + table.name + "." + index.Name + " not found"); } } else { this.log("WARNING: table " + index.Table + " not found"); } } this.log(string.Format( "RESULT: Fix Included Column in Index: TODOs {0}/{1}", fixes, indexes.Count() )); }
public ActionResult DropdownlistFor(DDL model) { DropDownListProperties ddl = new DropDownListProperties(); ddl.DataSource = GetDataSource(); DropDownListFields ddf = new DropDownListFields(); ddf.Text = "text"; ddf.Id = "uniqueKey"; ddl.DropDownListFields = ddf; ViewData["ddl"] = ddl; return(View(model)); }
void ddlBig_SelectedIndexChanged(object sender, EventArgs e) { DDL ddl = this.Pub1.GetDDLByID("DDL_TBModel"); if (ddl.SelectedItemIntVal != 0) { this.Pub1.GetTBByID("TB_MaxLen").Text = "4000"; this.Pub1.GetTBByID("TB_UIHeight").Text = "390"; this.Pub1.GetTBByID("TB_MaxLen").Enabled = false; } else { this.Pub1.GetTBByID("TB_MaxLen").Enabled = true; this.Pub1.GetTBByID("TB_MaxLen").Text = "400"; } }
public void ClearSelection() { if (_ddlmode) { DDL.ClearSelection(); } else if (_frmmode) { _frsrc += "&si=0"; } else { CODE.Text = ""; DESC.Text = ""; } }
public void complete(Database database, DDL withDDL) { EAOutputLogger.clearLog(this._model, this.outputName); this.log(string.Format( "completing {0} statements (parsed with {1} errors)", withDDL.statements.Count, withDDL.errors.Count )); // perform several fixes to complete the schema according to the DDL this.fixUniqueIndexes(database, withDDL); this.fixClusteredIndexes(database, withDDL); this.fixOnDeleteRestrictForeignKeys(database, withDDL); this.fixWithDefaultFields(database, withDDL); this.fixIncludedFieldsInIndex(database, withDDL); this.fixCheckConstraints(database, withDDL); }
public List <DDL> GetOptionDDL([FromBody] DDL input) { List <DDL> list = new List <DDL>(); var optionList = _context.OptionMasterDetail.Where(x => x.Isused == true && x.Masterid == Convert.ToDouble(input.SearchKey)).ToList(); foreach (OptionMasterDetail item in optionList) { DDL data = new DDL() { Value = item.Optionid, Text = item.Name }; list.Add(data); } return(list); }
private void fixWithDefaultFields(Database database, DDL withDDL) { var fields = from table in withDDL.statements.OfType <CreateTableStatement>() from field in table.Fields where field.Parameters.Keys.Contains("DEFAULT") && field.Parameters["DEFAULT"] == "True" select new { Table = table.Name, Name = field.Name, SimpleName = field.SimpleName }; int fixes = 0; foreach (var field in fields) { // find table var table = (Table)database.getTable(field.Table.Name); if (table != null) { // find field var column = (Column)table.getColumn(field.SimpleName); if (column != null) { if (!column.initialValue.Equals("DEFAULT")) { column.initialValue = "DEFAULT"; column.save(); fixes++; } } else { this.log("WARNING: field " + table.name + "." + field.Name + " not found"); } } else { this.log("WARNING: table " + field.Table + " not found"); } } this.log(string.Format( "RESULT: Fix With Default field: fixed {0}/{1}", fixes, fields.Count() )); }
private void fixOnDeleteRestrictForeignKeys(Database database, DDL withDDL) { var keys = from alter in withDDL.statements.OfType <AlterTableAddConstraintStatement>() where alter.Constraint is ForeignKeyConstraint && alter.Constraint.Parameters.Keys.Contains("ON_DELETE") && alter.Constraint.Parameters["ON_DELETE"] == "RESTRICT" select new { Table = alter.Table, Name = alter.Constraint.Name, SimpleName = alter.Constraint.SimpleName }; int fixes = 0; foreach (var key in keys) { // find table var table = (Table)database.getTable(key.Table.Name); if (table != null) { // find constraint var constraint = (ForeignKey)table.getConstraint(key.SimpleName); if (constraint != null) { if (!constraint.onDelete.Equals("Restrict")) { constraint.onDelete = "Restrict"; fixes++; this.log("FIXED " + key.Name + "'s missing On Delete Restrict constraint"); } } else { this.log("WARNING: foreign key " + table.name + "." + key.Name + " not found"); } } else { this.log("WARNING: table " + key.Table + " not found"); } } this.log(string.Format( "RESULT: Fix On Delete Restrict foreign keys: fixed {0}/{1}", fixes, keys.Count() )); }
public List <DDL> GetOrganizationDDL() { List <Organization> organizationList = _context.Organization.ToList(); List <DDL> organizationDDLList = new List <DDL>(); foreach (Organization item in organizationList) { DDL tempDDL = new DDL() { Text = item.Name, Value = item.Organizationid.ToString() }; organizationDDLList.Add(tempDDL); } return(organizationDDLList); }
void btn_Author_Set_Click(object sender, EventArgs e) { TB tb_Author = this.Pub1.GetTBByID("TB_Author_No"); DDL ddl_AuthorWay = this.Pub1.GetDDLByID("ddl_AuthorWay"); TB tb_FlowNos = this.Pub1.GetTBByID("TB_Author_FlowNos"); if (tb_Author == null || ddl_AuthorWay == null || tb_FlowNos == null) { return; } bool bResult = Dev2Interface.Flow_AuthorSave(tb_Author.Text, int.Parse(ddl_AuthorWay.SelectedItem.Value), tb_FlowNos.Text); if (bResult == true) { this.Alert("设置成功。"); this.Response.Redirect("AuthorDemo.aspx"); } }
public ActionResult TabulerResult(int ExamId, int FacultyId) { int flag = 0; List <SingleResult> allStudentResult = DDL.sp_GetExamResultStudent(ExamId, FacultyId); List <ExamType> type = DDL.GetStudentSubjectTypeResult(null, ExamId, FacultyId, null); subjectList = DDL.sp_ExamSubject(ExamId, FacultyId); foreach (var item in allStudentResult) { item.Subject = repo.getTabulerResult(subjectList, type, item.RollNo); } //if (list != null && list.Count() > 0) //{ // //remove from subject // foreach (var item in list) // { // flag++; // if (flag == 1) // { // sbObj.Add(new Subject // { // ExamTypeList = item.ExamTypeList, // SubjectName = "Biology", // FacultyName = item.FacultyName, // ShortName = "Biology", // ExamId = item.ExamId, // SubjectId = item.SubjectId // }); // } // sbObj.Remove(item); // } //} ViewBag.ExamName = db.ExamInfoes.Find(ExamId).ExamName; ViewBag.FacultyName = db.FacultyInfoes.Find(FacultyId).FacultyName; return(View(allStudentResult)); }