public void RetriveTaskConfigInfo(ThematicTaskStatus to) { DataTable dt = DataBaseUtility.DataSelect("select * from TASK_ORDER where TASK_ORDER_ID='" + to.ThematicId + "'"); List <ThematicOrder> thematicOrderList = new List <ThematicOrder>(); if (dt == null) { MessageBox.Show("查询未返回结果,请检查数据库!"); return; } foreach (DataRow row in dt.Rows) { ThematicOrder order = new ThematicOrder(); order.Orderid = row["TASK_ORDER_ID"].ToString(); order.ProductName = row["PRODUCT_NAME"].ToString(); order.EnglishName = row["ENGLISH_NAME"].ToString(); order.OrderDate = row["CREATE_DATE"].ToString(); order.ProductType = row["PRODUCT_TYPE"].ToString(); order.StartDate = row["START_DATE"].ToString(); order.EndDate = row["END_DATE"].ToString(); order.CoverScope = row["LEFT_TOP_LON"].ToString() + "," + row["LEFT_TOP_LAT"].ToString() + "," + row["RIGHT_BOTTOM_LON"].ToString() + "," + row["RIGHT_BOTTOM_LAT"].ToString(); thematicOrderList.Add(order); } tb_detailedOrderId.Text = thematicOrderList[0].Orderid; cb_detailedProductName.Text = thematicOrderList[0].ProductName; this.productName = thematicOrderList[0].ProductName; cb_detailedProductType.Text = thematicOrderList[0].ProductType; tb_detailedEnglishName.Text = thematicOrderList[0].EnglishName; dtp_detailedStartDate.Text = thematicOrderList[0].StartDate; dtp_DetailedEndDate.Text = thematicOrderList[0].EndDate; tb_detailedCoverrage.Text = thematicOrderList[0].CoverScope; getDataInNeed(to); }
protected async override void OnExecute(object parameter) { if (this.cremaAppHost.IsOpened == true && parameter is DataBaseListViewModel listViewModel) { await DataBaseUtility.CreateAsync(this.authenticator, this.cremaAppHost); } }
public ActionResult ChartsFun() { DataBaseUtility db = new DataBaseUtility(); db.init(); SqlDataReader reader = db.caByUser(); List <String> x = new List <string>(); List <String> y = new List <string>(); while (reader.Read()) { x.Add((String)reader["nom"]); y.Add(reader["pr"].ToString()); } var myChart = new Chart(width: 600, height: 400) .AddTitle("net worth by client") .AddSeries( name: "client", xValue: x.ToArray(), yValues: y.ToArray()) .Write(); return(null); }
private List <OutputParameter> GetOutputParameterInNeed(ThematicTaskStatus to) { DataTable dt2 = null; if (this.model_id != null && !"".Equals(this.model_id)) { dt2 = DataBaseUtility.DataSelect("select * from OUTPUTPARAMETER where MODEL_ID='" + this.model_id + "'"); } List <OutputParameter> outputList = new List <OutputParameter>(); if (dt2 == null) { MessageBox.Show("查询未返回结果,请检查数据库!"); return(null); } foreach (DataRow row in dt2.Rows) { OutputParameter output = new OutputParameter(); output.OutputPara_model_name = this.productName; output.OutputPara_name = row["OUTPUTPARA_NAME"].ToString(); output.OutputPara_valueType = row["OUTPUTPARA_VALUETYPE"].ToString(); output.OutputPara_defaultValue = row["OUTPUTPARA_DEFAULTVALUE"].ToString(); output.OutputPara_currentValue = row["OUTPUTPARA_CURRENTVALUE"].ToString(); output.OutputPara_des = row["OUTPUTPAR_DES"].ToString(); outputList.Add(output); } return(outputList); }
public ActionResult ChartsFun1() { DataBaseUtility db = new DataBaseUtility(); db.init(); SqlDataReader reader = db.nbprodByCat(); List <String> x = new List <string>(); List <String> y = new List <string>(); while (reader.Read()) { x.Add((String)reader["id"]); y.Add(reader["nb"].ToString()); } var myChart = new Chart(width: 600, height: 400) .AddTitle("products by category") .AddSeries( name: "client", xValue: x.ToArray(), yValues: y.ToArray()) .Write(); return(null); }
protected override bool OnCanExecute(object parameter) { if (this.cremaAppHost.IsOpened == true && parameter is DataBaseListViewModel listViewModel) { return(DataBaseUtility.CanCreate(this.authenticator)); } return(false); }
public ActionResult Edit([Bind(Include = "ID,Title,ReleaseDate,Genre,Price,Rate")] Movie movie) { var ret = DataBaseUtility.UpdateMovie(movie.ID, movie.dbTitle, movie.ReleaseDate.ToString(), movie.dbGenre, movie.Price, movie.dbRate); if (ret) { return RedirectToAction("Index"); } return View(movie); }
protected async override void OnExecute(object parameter) { var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost); if (await dialog.ShowDialogAsync() != true) { return; } await DataBaseUtility.CopyAsync(this.authenticator, dialog.SelectedItem); }
private void button_Display_Click_1(object sender, EventArgs e) { String query = "Select Deduction_Amt, Comment from Deductions_Details where Emp_ID=104"; char Delim = ','; List <String> details = new List <String>(); details = DataBaseUtility.GetList(query, Delim); for (int i = 0; i < details.Count; i++) { } }
protected void Page_Load(object sender, EventArgs e) { Error.Visible = false; txtTableName.Text = "Interview"; txtDocType.Text = "64"; //ResetCommand(); id = (List <string>)DataBaseUtility.GetList("select DocNum from Interview"); string currentID = id[id.Count - 1]; int nextID = Convert.ToInt32(currentID) + 1; txtDocNum.Text = nextID.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Error.Visible = false; appId = (List <string>)DataBaseUtility.GetList("select DocNum from Applicant"); DropDownList1.DataSource = appId; DropDownList1.DataBind(); DropDownList1.SelectedIndex = 0; txtTableName.Text = "Employees"; } empId = (List <string>)DataBaseUtility.GetList("select DocNum from Employees"); }
// GET: Movies/Details/5 public ActionResult Details(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } string sql = "Select Id,Title,ReleaseDate,Genre,Price,Rate from Movies where Id = " + id.ToString(); var movielist = DataBaseUtility.GetMovies(sql); if (movielist.Count == 0) { return HttpNotFound(); } return View(movielist[0]); }
private List <InputParameter> GetInputParameterInNeed(ThematicTaskStatus to) { String ProductName = this.productName; DataTable dt = DataBaseUtility.DataSelect("select * from MODELINFOMANAGEMENT where MODEL_NAME='" + ProductName + "'"); List <TaskModelInfo> modelList = new List <TaskModelInfo>(); if (dt == null) { MessageBox.Show("查询未返回结果,请检查数据库!"); return(null); } foreach (DataRow row in dt.Rows) { TaskModelInfo model = new TaskModelInfo(); model.Model_id = row["MODEL_ID"].ToString(); model.Model_name = row["MODEL_NAME"].ToString(); model.Model_url = row["MODEL_URL"].ToString(); this.tsc.currentServiceUrl = model.Model_url; modelList.Add(model); } if (modelList[0].Model_id != null && !"".Equals(modelList[0].Model_id)) { this.model_id = modelList[0].Model_id; } DataTable dt2 = DataBaseUtility.DataSelect("select * from INPUTPARAMETER where MODEL_ID='" + modelList[0].Model_id + "'"); List <InputParameter> inputList = new List <InputParameter>(); if (dt2 == null) { MessageBox.Show("查询未返回结果,请检查数据库!"); return(null); } foreach (DataRow row in dt2.Rows) { InputParameter input = new InputParameter(); input.InputPara_model_name = this.productName; input.InputPara_name = row["INPUTPARA_NAME"].ToString(); input.InputPara_valueType = row["INPUTPARA_VALUETYPE"].ToString(); input.InputPara_defaultValue = row["INPUTPARA_DEFAULTVALUE"].ToString(); input.InputPara_currentValue = row["INPUTPARA_CURRENTVALUE"].ToString(); input.InputPara_des = row["INPUTPAR_DES"].ToString(); inputList.Add(input); } return(inputList); }
protected async override void OnExecute(object parameter) { var dialog = new SelectDataBaseViewModel(this.authenticator, this.cremaAppHost, (s) => DataBaseDescriptorUtility.IsLoaded(this.authenticator, s) == false); if (await dialog.ShowDialogAsync() != true) { return; } if (DataBaseDescriptorUtility.IsLoaded(this.authenticator, dialog.SelectedItem) == true) { await AppMessageBox.ShowAsync("현재 사용중인 데이터베이스는 삭제할 수 없습니다."); return; } if (await new DeleteViewModel().ShowDialogAsync() != true) { return; } await DataBaseUtility.DeleteAsync(this.authenticator, dialog.SelectedItem); }
// GET: Movies /* public ActionResult Index() { return View(db.Movies.ToList()); }*/ public ActionResult Index(string movieGenre, string searchstring) { string sql = "Select Id,Title,ReleaseDate,Genre,Price,Rate from Movies"; var movielist = DataBaseUtility.GetMovies(sql); var GenreLst = new List<string>(); foreach (var item in movielist) { GenreLst.Add(item.Genre); } ViewBag.movieGenre = new SelectList(GenreLst); bool addgenre = false; var querymovie = new Movie(); if (!string.IsNullOrEmpty(movieGenre)) { querymovie.Genre = movieGenre; sql = sql + " where Genre = '"+ querymovie.dbGenre + "'"; addgenre = true; } if(!string.IsNullOrEmpty(searchstring)) { querymovie.Title = searchstring; if (addgenre) { sql = sql + " and Title like '%"+ querymovie.dbTitle + "%'"; } else { sql = sql + " where Title like '%" + querymovie.dbTitle + "%'"; } } movielist = DataBaseUtility.GetMovies(sql); return View(movielist); }
protected async override void OnExecute(object parameter) { await DataBaseUtility.CreateAsync(this.authenticator, this.cremaHost); }
public async Task ViewLogAsync() { await DataBaseUtility.ViewLogAsync(this.authentication, this); }
public async Task UnloadAsync() { await DataBaseUtility.UnloadAsync(this.authentication, this); }
public async Task DeleteAsync() { await DataBaseUtility.DeleteAsync(this.authentication, this); }
public async Task RenameAsync() { await DataBaseUtility.RenameAsync(this.authentication, this); }
public ActionResult DeleteConfirmed(int id) { DataBaseUtility.DeleteMovie(id); return RedirectToAction("Index"); }
public async Task CreateAsync() { await DataBaseUtility.CreateAsync(this.authenticator, this.cremaHost); }
protected void GetDocument_Click(object sender, EventArgs e) { Error.Visible = false; GridView1.DataSource = null; GridView1.DataBind(); try { txtQuery.Text = "select * from " + txtTabName.Text + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text); List <string> _selDocStr = DataBaseUtility.GetList("select * from " + txtTabName.Text + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text)); string[] selDocStr = _selDocStr[1].Split(','); txtExtRef.Text = selDocStr[2]; txtIntRef.Text = selDocStr[3]; txtProcessNum.Text = selDocStr[4]; txtStatus.Text = selDocStr[5]; txtDocStartDate.Text = selDocStr[6]; txtDocStatusDate.Text = selDocStr[7]; txtQuotedAmt.Text = selDocStr[8]; txtActualAmt.Text = selDocStr[9]; txtComment.Text = selDocStr[10]; /*code starts here*/ try { DB_Operations db = new DB_Operations(); DataTable ds = db.SelectQry("select * from " + txtTabName.Text + "_Details" + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text)); //con.Open(); //cmd = new OleDbCommand("select * from " + txtTabName.Text + "_Details" + " where docNum = " + Convert.ToInt32(txtDocNum.Text) + "And docType = " + Convert.ToInt32(txtDocType.Text), con); //dr = cmd.ExecuteReader(); GridView1.DataSource = ds; GridView1.DataBind(); //Attribute to show the Plus Minus Button. GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand"; int column_Num = GridView1.Rows[0].Cells.Count; if (column_Num >= 3) { for (int i = 2; i <= column_Num - 1; i++) { //Attribute to hide column in Phone. GridView1.HeaderRow.Cells[i].Attributes["data-hide"] = "phone,tablet"; } } //Adds THEAD and TBODY to GridView. GridView1.HeaderRow.TableSection = TableRowSection.TableHeader; // con.Close(); } catch (Exception ex) { //Debug.WriteLine("********************************************************************"); //Debug.WriteLine("Exception Caught: {0}", ex.Message); //Debug.WriteLine("Exception Caught: {0}", ex.StackTrace); //Debug.WriteLine("********************************************************************"); } } catch (Exception ex) { Error.Visible = true; } }
public async Task CopyAsync() { await DataBaseUtility.CopyAsync(this.authentication, this); }