//创建EDITFORM前 protected void ASPxGridView3_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e) { if (!ASPxGridView3.IsNewRowEditing && ASPxGridView3.IsEditing) { ///主键不可以修改 (ASPxGridView3.FindEditFormTemplateControl("comboLJDM3") as ASPxComboBox).Enabled = false; //处理ASPxCheckBox if (ASPxGridView3.GetRowValues(ASPxGridView3.FocusedRowIndex, "SFHC").ToString() == "1") { (ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox).Checked = true; } else { (ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox).Checked = false; } //处理ASPxCheckBox if (ASPxGridView3.GetRowValues(ASPxGridView3.FocusedRowIndex, "SFZC").ToString() == "1") { (ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox).Checked = true; } else { (ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox).Checked = false; } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } if (!Page.IsPostBack) { if (Request.QueryString["codigo"] == null) { _countId = string.Empty; } else { _countId = Request.QueryString["codigo"]; GetDataHeader(_countId); } } if (Session["DATOS_PICKING_DETAIL"] != null) { ASPxGridView3.DataSource = Session["DATOS_PICKING_DETAIL"]; ASPxGridView3.DataBind(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void ASPxGridView3_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxComboBox NaturalPerson = ASPxGridView3.FindEditFormLayoutItemTemplateControl("PersonnePysique") as ASPxComboBox; cn.Open(); string req = "select Id from NaturalPerson where FirstName= '" + NaturalPerson.SelectedItem.ToString() + "'"; SqlCommand cmd = new SqlCommand(req, cn); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { e.NewValues["PersonnePysique_Id"] = dr["Id"].ToString(); } cn.Close(); ASPxComboBox Adresse = ASPxGridView3.FindEditFormLayoutItemTemplateControl("Adresse") as ASPxComboBox; cn.Open(); string req1 = "select Id from Adresse where Code= '" + Adresse.SelectedItem.ToString() + "'"; SqlCommand cmd1 = new SqlCommand(req1, cn); SqlDataReader dr1 = cmd1.ExecuteReader(); while (dr1.Read()) { e.NewValues["Adresse_Id"] = dr1["Id"].ToString(); } cn.Close(); }
protected void ASPxGridView3_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxComboBox Good = ASPxGridView3.FindEditFormLayoutItemTemplateControl("Good") as ASPxComboBox; cn.Open(); string req = "select Id from Good where TypeCode= '" + Good.SelectedItem.ToString() + "'"; SqlCommand cmd = new SqlCommand(req, cn); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { e.NewValues["Good_Id"] = dr["Id"].ToString(); } cn.Close(); ASPxComboBox Adresse = ASPxGridView3.FindEditFormLayoutItemTemplateControl("Adresse") as ASPxComboBox; cn.Open(); string req1 = "select Id from Adresse where Code= '" + Adresse.SelectedItem.ToString() + "'"; SqlCommand cmd1 = new SqlCommand(req1, cn); SqlDataReader dr1 = cmd1.ExecuteReader(); while (dr1.Read()) { e.NewValues["Adresse_Id"] = dr1["Id"].ToString(); } cn.Close(); }
protected void ASPxGridView3_CustomCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomCallbackEventArgs e) { DataTable Table1 = new DataTable(); ASPxGridView3.DataSource = Table1; ASPxGridView3.DataBind(); setCondition(); }
protected void ASPxGridView3_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { if (e.ButtonID == "btnview2") { int Gid = Convert.ToInt32(e.VisibleIndex.ToString()); DataRow dr = ASPxGridView3.GetDataRow(Gid); int id = Convert.ToInt32(dr["LeaveID"].ToString()); Response.Redirect("~/HR/ViewLeave.aspx?id=" + id); } }
protected void btnXlsExport1_Click(object sender, EventArgs e) { string sql = Session["2800ONLINE"].ToString(); DataTable dt = dc.GetTable(sql); ASPxGridView3.DataSource = dt; ASPxGridView3.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse("在制品物料清单导出" + DateTime.Now.ToString() + ".xls"); }
protected void ASPxGridView2_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { SqlDataSource1.DataBind(); ASPxGridView1.DataBind(); SqlDataSource13.DataBind(); ASPxGridView3.DataBind(); SqlDataSource15.DataBind(); ASPxGridView5.DataBind(); SqlDataSource8.DataBind(); ASPxGridView7.DataBind(); }
protected void importujDaneKOF(object sender, EventArgs e) { //wczytanie danych KOF string log = ms.uzupelnijDaneDoKOF(); //cm.log.Info("KOF " + log); ASPxGridView1.DataBind(); ASPxGridView2.DataBind(); ASPxGridView3.DataBind(); LogLabel.Text = log; }
private void setCondition3() { string sql = "SELECT A.ABOM_COMP,TO_CHAR(A.ZDRQ,'YYYY-MM-DD') ZDRQ,TO_CHAR(A.RQBEGIN,'YYYY-MM-DD') RQBEGIN,TO_CHAR(A.RQEND,'YYYY-MM-DD') RQEND," + " B.PT_DESC2,A.LJMC,a.SFXS,a.SFHC,a.SFZC " + " FROM ATPUBOMKZB A LEFT JOIN COPY_PT_MSTR B ON A.ABOM_COMP=B.PT_PART " + " ORDER BY A.ABOM_COMP "; DataTable dt = dc.GetTable(sql); ASPxGridView3.DataSource = dt; ASPxGridView3.DataBind(); }
private void setCondition() { if (comboPlineCode.Value != null && comboStationCode.Value != null && comboPSeries.Value != null) { string sql = "SELECT A.RMES_ID,A.DETECT_CODE,A.DETECT_NAME FROM CODE_DETECT A WHERE A.PLINE_CODE='" + comboPlineCode.Value.ToString() + "'" + " AND NOT EXISTS(SELECT * FROM REL_STATION_DETECT C WHERE C.DETECT_CODE=A.DETECT_CODE and c.pline_code='" + comboPlineCode.Value.ToString() + "' " + "and c.station_code='" + comboStationCode.Value.ToString() + "' and c.product_series='" + comboPSeries.Value.ToString() + "' ) " + " AND NOT EXISTS(SELECT * FROM REL_STATION_DETECT_temp d WHERE d.DETECT_CODE=A.DETECT_CODE and d.pline_code='" + comboPlineCode.Value.ToString() + "' " + "and d.station_code='" + comboStationCode.Value.ToString() + "' and d.product_series='" + comboPSeries.Value.ToString() + "' ) " + " ORDER BY A.DETECT_CODE"; DataTable dt = dc.GetTable(sql); ASPxGridView3.DataSource = dt; ASPxGridView3.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { ASPxGridView1.SettingsBehavior.AllowSelectByRowClick = true; ASPxGridView1.DataSource = Business.MediosPublicitarios.ReadAll(""); ASPxGridView1.DataBind(); ASPxGridView2.SettingsBehavior.AllowSelectByRowClick = true; ASPxGridView2.DataSource = Business.MediosPublicitarios.ReadAll(""); ASPxGridView2.DataBind(); ASPxGridView3.SettingsBehavior.AllowSelectByRowClick = true; ASPxGridView3.DataSource = Business.MediosPublicitarios.ReadAll(""); ASPxGridView3.DataBind(); ASPxGridView4.SettingsBehavior.AllowSelectByRowClick = true; ASPxGridView4.DataSource = Business.MediosPublicitarios.ReadAll(""); ASPxGridView4.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { treelistFinishedProductUnit.DataSource = new[] { new { OrganizationId = 1, ParentOrganizationId = 0, FinishedProductUnitID = "MS001", FinishedProductUnit = "Thùng lớn", FinishedProductUnitAmount = "", FinishedProductUnitDescription = "Thùng lớn là đơn vị tính cao nhất" }, new { OrganizationId = 2, ParentOrganizationId = 1, FinishedProductUnitID = "LT002", FinishedProductUnit = "Hợp lớn", FinishedProductUnitAmount = "20", FinishedProductUnitDescription = "1 Thùng lớn chứa 20 Hộp lớn" }, new { OrganizationId = 3, ParentOrganizationId = 2, FinishedProductUnitID = "LT003", FinishedProductUnit = "Vĩ", FinishedProductUnitAmount = "30", FinishedProductUnitDescription = "1 Hộp lớn chứa 30 Vĩ" }, new { OrganizationId = 4, ParentOrganizationId = 3, FinishedProductUnitID = "LT004", FinishedProductUnit = "Viên nén tròn", FinishedProductUnitAmount = "12", FinishedProductUnitDescription = "1 Vĩ chứa 12 Viên nén tròn" } }; treelistFinishedProductUnit.DataBind(); grdatauFinishedProductGroup.DataSource = new[] { new { FinishedProductGroupID = "MH001", FinishedProductGroup = "Hàng Hóa 1", FinishedProductGroupDescription = "Example", FinishedProductGroupNote = "Example" }, new { FinishedProductGroupID = "MH002", FinishedProductGroup = "Hàng Hóa 2", FinishedProductGroupDescription = "Example", FinishedProductGroupNote = "Example" }, new { FinishedProductGroupID = "MH003", FinishedProductGroup = "Hàng Hóa 3", FinishedProductGroupDescription = "Example", FinishedProductGroupNote = "Example" }, new { FinishedProductGroupID = "MH004", FinishedProductGroup = "Hàng Hóa 4", FinishedProductGroupDescription = "Example", FinishedProductGroupNote = "Example" } }; grdatauFinishedProductGroup.DataBind(); ASPxGridView3.DataSource = new[] { new { ID = "DV001", Name = "Viên nén tròn" }, new { ID = "DV002", Name = "Gói" } }; ASPxGridView3.KeyFieldName = "ID"; ASPxGridView3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session.Contents["username"] == null) { Response.Redirect("~/Login.aspx"); } // GridViewFeaturesHelper.SetupGlobalGridViewBehavior(ASPxGridView1); if (!IsPostBack) { hdfmaquanly.Value = "0"; hdfmaquanly1.Value = "0"; ASPxGridView1.DataBind(); // ASPxGridView1.DetailRows.ExpandRow(0); ASPxGridView3.DataBind(); // ASPxGridView3.DetailRows.ExpandAllRows(); ASPxGridView5.DataBind(); // ASPxGridView5.DetailRows.ExpandAllRows(); } }
//---------------------------------------------------------总成零件回冲显示维护-------------------------------------------------------- //修改 protected void ASPxGridView3_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxComboBox ljdm = ASPxGridView3.FindEditFormTemplateControl("comboLJDM3") as ASPxComboBox; ASPxCheckBox chHCXSFlag = ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox; string hcFlag = ""; if (chHCXSFlag.Checked == true) { hcFlag = "1"; } else { hcFlag = "0"; } ASPxCheckBox chHCZCFlag = ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox; string hcZCFlag = ""; if (chHCZCFlag.Checked == true && chHCXSFlag.Checked == true) { hcZCFlag = "1"; } else { hcZCFlag = "0"; } string Sql = "UPDATE ATPUBOMKZB SET SFHC='" + hcFlag + "', SFZC='" + hcZCFlag + "' " + " WHERE abom_comp = '" + ljdm.Value.ToString() + "'"; dc.ExeSql(Sql); //记录操作start string logSql = "insert into atpubomkzb_log(abom_comp,zdrq,rqbegin,rqend,rqsj,yhmc,czms) " + " select abom_comp,zdrq,rqbegin,rqend,sysdate,'" + theUserName + "','修改了该零件的回冲属性' " + " from atpubomkzb where abom_comp='" + ljdm.Value.ToString() + "' "; dc.ExeSql(logSql); //记录操作end e.Cancel = true; ASPxGridView3.CancelEdit(); setCondition3(); }
public void GetCustomers() { try { var pResult = ""; var ds = _objCustomer.GetCustomer(Session["connectionString"].ToString(), ref pResult); if (pResult == "") { ASPxGridView3.DataSource = ds; ASPxGridView3.DataBind(); Session["ALL_CUSTOMERS_AR"] = ds; } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } if (!Page.IsPostBack) { ASPxCalendar1.SelectedDate = DateTime.Today; ASPxGridLookup1.GridView.Width = 300; GetCustomersByDate(ASPxCalendar1.SelectedDate); GetTasksByDate(ASPxCalendar1.SelectedDate); GetSellers(); GetCustomers(); } if (Session["CUSTOMER_AR"] != null) { ASPxGridView1.DataSource = Session["CUSTOMER_AR"]; ASPxGridView1.DataBind(); } if (Session["TASK_AR"] != null) { ASPxGridView2.DataSource = Session["TASK_AR"]; ASPxGridView2.DataBind(); ReportView(); } if (Session["SELLERS_AR"] != null) { ASPxGridLookup1.DataSource = Session["SELLERS_AR"]; ASPxGridLookup1.DataBind(); } if (Session["ALL_CUSTOMERS_AR"] != null) { ASPxGridView3.DataSource = Session["ALL_CUSTOMERS_AR"]; ASPxGridView3.DataBind(); } }
public void GetBatch() { try { var objBatch = new WSBatch.SwiftExpressWSBatch(); var pResult = ""; var ds = objBatch.GetBatch(Session["connectionString"].ToString(), ref pResult); if (pResult == "") { ASPxGridView3.DataSource = ds; ASPxGridView3.DataBind(); Session["BATCH"] = ds; objBatch.Dispose(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
private void setCondition() { //if (txtChose.Text.Trim() == "") //{ // return; //} //else //{ string StationName = ""; // chose = txtChose.Value.ToString(); if (txtPCode.Text.Trim() != "") { if (txtPCode.Text.Trim() == "东区") { StationName = "ZF200"; } if (txtPCode.Text.Trim() == "西区") { StationName = "ATPU-U860"; } MW_RST_MonthBB sp = new MW_RST_MonthBB() { ZDMC1 = StationName, GZRQ1 = ASPxDateEdit1.Text.Trim(), GZRQ2 = ASPxDateEdit2.Text.Trim(), MACHINENAME1 = MachineName }; Procedure.run(sp); string ChSql1 = "select distinct jhdm 计划代码,so 计划SO,ggxhmc 机型,sl 计划数量 ,wcsl 完成数量 from rstdaybb where machinename='" + MachineName + "'order by jhdm "; DataTable dt1 = dc.GetTable(ChSql1); ASPxGridView1.DataSource = dt1; ASPxGridView1.DataBind(); } //int width = 40 / 5; // foreach (DevExpress.Web.ASPxGridView.GridViewColumn col in ASPxGridView1.VisibleColumns) // { // col.Width = Unit.Percentage(width); // } //DataTable Table1 = new DataTable(); //Table1.Columns.Add("计划代码"); //Table1.Columns.Add("计划SO"); //Table1.Columns.Add("机型"); //Table1.Columns.Add("计划数量"); //Table1.Columns.Add("完成数量"); //for (int i = 0; i < dt1.Rows.Count; i++) //{ // string jhdm = dt1.Rows[i][0].ToString(); // string so = dt1.Rows[i][1].ToString(); // string ggxhmc = dt1.Rows[i][2].ToString(); // string sl = dt1.Rows[i][3].ToString(); // string wcsl = dt1.Rows[i][4].ToString(); // Table1.Rows.Add(jhdm, so, ggxhmc, sl, wcsl); //} //ASPxGridView1.DataSource = Table1; //ASPxGridView1.DataBind(); if (txtPCode2.Text.Trim() != "") { if (txtPCode2.Text.Trim() == "东区") { StationName = "ZF200"; } if (txtPCode2.Text.Trim() == "西区") { StationName = "ATPU-U860"; } string ChSql2 = " select WORK_DATE 工作日期, PLAN_SO 产品代码,count(distinct SN) 完成数量 from VW_DATA_COMPLETE a left join code_station b on a.station_code=b.station_code " + "where b.station_name='" + StationName + "'and WORK_DATE>=to_date('" + ASPxDateEdit3.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss')" + " and WORK_DATE<=to_date('" + ASPxDateEdit4.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') group by a.work_date ,a.plan_so"; DataTable dt2 = dc.GetTable(ChSql2); ASPxGridView2.DataSource = dt2; ASPxGridView2.DataBind(); } if (txtPCode3.Text.Trim() != "") { if (txtPCode3.Text.Trim() == "东区") { StationName = "ZF200"; } if (txtPCode3.Text.Trim() == "西区") { StationName = "ATPU-U860"; } MW_CREATE_ZDLSHTJ sp2 = new MW_CREATE_ZDLSHTJ() { GZRQ1 = ASPxDateEdit5.Date, GZRQ2 = ASPxDateEdit6.Date, GZDD1 = txtPCode3.Value.ToString() }; Procedure.run(sp2); string ChSql3 = "SELECT GHTM 漏扫条码,ZDMC 工位号 FROM ATPUZDLSHQD ORDER BY GHTM"; DataTable dt3 = dc.GetTable(ChSql3); ASPxGridView3.DataSource = dt3; ASPxGridView3.DataBind(); } if (txtPCode4.Text.Trim() != "") { if (txtPCode4.Text.Trim() == "东区") { StationName = "ZF200"; } if (txtPCode4.Text.Trim() == "西区") { StationName = "ATPU-U860"; } //与原程序多调用了一次存储过程,因为分了两个页面查询 MW_CREATE_ZDLSHTJ sp3 = new MW_CREATE_ZDLSHTJ() { GZRQ1 = ASPxDateEdit5.Date, GZRQ2 = ASPxDateEdit6.Date, GZDD1 = txtPCode3.Value.ToString() }; Procedure.run(sp3); string ChSql4 = "SELECT ZDMC 工位,AA 漏扫数量 FROM (select ZDMC,ZDDM,COUNT(*) AA from ATPUZDLSHQD GROUP BY ZDMC,ZDDM ) ORDER BY ZDDM"; DataTable dt4 = dc.GetTable(ChSql4); ASPxGridView4.DataSource = dt4; ASPxGridView4.DataBind(); } //ASPxGridView1.JSProperties.Add("cpCallbackName", "Fail"); //ASPxGridView1.JSProperties.Add("cpCallbackRet", "统计方式有误!"); }
protected void ASPxButton1_Click(object sender, EventArgs e) { try { //HEADER var header = new cod.CountHeader { CountType = ASPxComboBox1.Value.ToString(), CountName = ASPxTextBox1.Text, CountAssignedTo = ASPxGridLookup1.Text }; //insertar header en tabla var dsHeader = _objCount.InsertCountHeader(Session["connectionString"].ToString(), header.CountType, header.CountName, header.CountAssignedTo, Session["USER"].ToString(), ASPxComboBox2.Value.ToString()); if (dsHeader.Tables[0].Rows.Count > 0) { var countId = dsHeader.Tables[0].Rows[0]["ID"].ToString(); var tab = ASPxComboBox1.Value.ToString(); if (tab == "SKU") { var fieldValues = ASPxGridView1.GetSelectedFieldValues(new[] { "CODE_SKU", "DESCRIPTION_SKU" }); foreach (object[] value in fieldValues) { //DETALLES //insertar en detalles var pResult = _objCount.InsertCountDetail(Session["connectionString"].ToString(), countId, "NULL", header.CountAssignedTo, value[0].ToString(), value[1].ToString(), "NULL"); if (pResult == "OK") { continue; } ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + pResult + "');", true); return; } } if (tab == "LOCATION") { var fieldValues = ASPxGridView2.GetSelectedFieldValues(new[] { "LOCATION", "CODE_LOCATION" }); foreach (object[] value in fieldValues) { var pResult = _objCount.InsertCountDetail(Session["connectionString"].ToString(), countId, value[1].ToString(), header.CountAssignedTo, "NULL", "NULL", "NULL"); if (pResult == "OK") { continue; } ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + pResult + "');", true); return; } } if (tab == "BATCH") { var fieldValues = ASPxGridView3.GetSelectedFieldValues(new[] { "BATCH", "BATCH_ID" }); foreach (object[] value in fieldValues) { var pResult = _objCount.InsertCountDetail(Session["connectionString"].ToString(), countId, "NULL", header.CountAssignedTo, "NULL", "NULL", value[1].ToString()); if (pResult == "OK") { continue; } ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + pResult + "');", true); return; } } //envia el conteo al operador seleccionado ScriptManager.RegisterStartupScript(this, GetType(), "FuncionNJS", "ConnectNJS('" + header.CountAssignedTo.ToUpper() + "' , 'NEW_TASK')", true); Response.Redirect("CountPanel.aspx"); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: Operación no pudo ser realizada');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["user"] == null) { Response.Redirect("~/Default.aspx"); } else { if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewStudent, Request.Cookies["user"]["Permission"].ToString())) { Response.Redirect("~/StudentAfair/UnAuthorized.aspx"); } } if (!IsPostBack) { if (Request.QueryString["id"].ToString() != null) { if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0) { Student student = new Student(); student.get(Convert.ToInt32(Request.QueryString["id"].ToString())); lblStudentID.Text = student.ID.ToString(); Parent parent = new Parent(); lblStudentName.Text = student.Name; parent.get(student.ParentID); lblParentName.Text = parent.Name; lblParentJob.Text = parent.Job; lblBirthDate.Text = student.BirthDate.ToShortDateString(); DateTime ioct = new DateTime(DateTime.Now.Year, 10, 1); lbl1oct.Text = (((ioct - student.BirthDate)).TotalDays / 365).ToString(); ddlType.Text = student.Type.ToString(); lblAddress.Text = student.Address.ToString(); lblPhone.Text = student.Phone; StdClass sclass = new StdClass(); sclass.get(student.StudClass); lblClass.Text = sclass.Name; lblGender.Text = student.Gender; lblReligion.Text = student.Religion; if (student.LearningDisabilities == 1) { cbtxtDisabilities.Checked = true; } else { cbtxtDisabilities.Checked = false; } txtDisabilities.Text = student.Note; if (student.Father != 0) { parent.get(student.Father); lblFather.Text = parent.Name; txtfjob.Text = parent.Job; txtfPhone.Text = parent.Phone; txtfAddress.Text = parent.Address; } if (student.Mother != 0) { parent.get(student.Mother); ddlMpther.Text = parent.Name; txtmJob.Text = parent.Job; txtmphone.Text = parent.Phone; txtmAddress.Text = parent.Address; } btnEdit.Visible = true; DataTable dt = new DataTable();//Exams ASPxGridView3.DataSource = dt; ASPxGridView3.DataBind(); StdClass c = new StdClass(); c.get(student.StudClass); DataTable dt2 = new EducationalYear().GetCourses(c.EdID);//Courses coursesGrid.DataSource = dt2; coursesGrid.DataBind(); DataTable dt3 = new Student().getAbsent(int.Parse(lblStudentID.Text));//Absents absentGrid.DataSource = dt3; absentGrid.DataBind(); } else { btnEdit.Visible = false; } } AddSubmitEvent(); } AddSubmitEvent(); }
protected void setCondition() { //if (txtICode.Text.Trim() != "") //{ // string sql = "select distinct A.SN ,B.PLAN_SO ,A.DETECT_VALUE from data_sn_detect_data A,data_product B where A.SN=B.SN AND A.PLINE_CODE='" + txtPCode.Value.ToString() + "' AND A.DETECT_NAME like '%" + txtIKind.Text.Trim() + "%' and A.DETECT_VALUE like '%" + txtICode.Text.Trim() + "%' "; // DataTable dt = dc.GetTable(sql); // ASPxGridView1.DataSource = dt; // ASPxGridView1.DataBind(); //} //if (txtPartCode.Text.Trim() != "") //{ // string chsql2 = "select * from copy_pt_mstr where pt_part='" + txtPartCode.Text.Trim() + "'"; // DataTable ch2 = dc.GetTable(chsql2); // if (ch2.Rows.Count <= 0) // { // return; // } // string sql2 = " select a.*,b.user_name from VW_DATA_SN_BOM a left join code_user b on a.create_userid=b.user_code where CREATE_TIME>=to_date('" + ASPxDateEdit1.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss')" // +" and CREATE_TIME<=to_date('" + ASPxDateEdit2.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and pline_code='" + txtPCode1.Value.ToString() + "' and item_code='" + txtPartCode.Text.Trim() + "' order by sn"; // DataTable dt2 = dc.GetTable(sql2); // ASPxGridView2.DataSource = dt2; // ASPxGridView2.DataBind(); //} if (txtPCode2.Text.Trim() != "") { DataTable Table1 = new DataTable(); Table1.Columns.Add("SO"); Table1.Columns.Add("流水号"); Table1.Columns.Add("时间"); Table1.Columns.Add("站点"); string planso = "", sn = "", wtime = "", scode = "", flag = ""; //获取站点代码 string chsql2 = "select station_code from code_station where station_name='" + txtStation.Text.Trim().ToUpper() + "'"; scode = dc.GetValue(chsql2); // string ChSql = "select DISTINCT a.PLAN_SO,a.SN,a.WORK_TIME,c.complete_flag from data_product a ,data_plan b,data_complete c where a.plan_code=b.plan_code and a.sn=c.sn and c.station_code like '%" + scode + "%' and a.WORK_DATE>=to_date('" + ASPxDateEdit3.Text.Trim() + "', 'yyyy-mm-dd hh24:mi:ss') " + " and a.WORK_DATE<=to_date('" + ASPxDateEdit4.Text.Trim() + "', 'yyyy-mm-dd hh24:mi:ss') and b.plan_type<>'C' and b.plan_type<>'D' and a.PLINE_CODE='" + txtPCode2.Value.ToString() + "' order by a.sn"; DataTable Chdt = dc.GetTable(ChSql); for (int i = 0; i < Chdt.Rows.Count; i++) { planso = Chdt.Rows[i][0].ToString(); sn = Chdt.Rows[i][1].ToString(); wtime = Chdt.Rows[i][2].ToString(); flag = Chdt.Rows[i][3].ToString(); DataRow dr1 = Table1.NewRow(); dr1[0] = planso; dr1[1] = sn; dr1[2] = wtime; for (int j = 0; j < ASPxListBoxUsed.Items.Count; j++) { string sj1 = "", ZDMC = "", ChSql2 = ""; string part2 = ASPxListBoxUsed.Items[j].ToString(); if (i == 0) { Table1.Columns.Add(part2); } if (flag == "0") { ChSql2 = "Select a.DETECT_VALUE,a.STATION_NAME from data_sn_detect_data_TEMP a where a.sn='" + sn + "' and a.DETECT_NAME='" + part2 + "' and a.station_name like '%" + txtStation.Text.Trim().ToUpper() + "%'"; } else { ChSql2 = "Select a.DETECT_VALUE,a.STATION_NAME from data_sn_detect_data a where a.sn='" + sn + "' and a.DETECT_NAME='" + part2 + "' and a.station_name like '%" + txtStation.Text.Trim().ToUpper() + "%'"; } DataTable Chdt2 = dc.GetTable(ChSql2); if (Chdt2.Rows.Count > 0) { sj1 = Chdt2.Rows[0][0].ToString(); ZDMC = Chdt2.Rows[0][1].ToString(); } dr1[3] = ZDMC; dr1[j + 4] = sj1; } Table1.Rows.Add(dr1); } ASPxGridView3.DataSource = Table1; ASPxGridView3.DataBind(); } //if (txtStation.Text.Trim() != "") //{ // DataTable Table2 = new DataTable(); // DataRow dr2 = Table2.NewRow(); // Table2.Columns.Add("SO"); // Table2.Columns.Add("流水号"); // Table2.Columns.Add("时间"); // Table2.Columns.Add("员工"); // Table2.Columns.Add("项目"); // Table2.Columns.Add("数值"); // string Sname = "", so = "", sn2 = "", time = "", Uname = "", barcode = "", pt = "", icode = "", isn = "", vcode = ""; // string sql4 = "Select station_name from code_station where station_name='" + txtStation.Text.Trim() + "'"; // DataTable dt4 = dc.GetTable(sql4); // if (dt4.Rows.Count <= 0) // { // return; // } // else // { // Sname = dt4.Rows[0][0].ToString(); // } // string sql5 = " select a.plan_so,a.sn,a.start_time,b.user_name from data_complete a,code_user b,code_station c where a.user_id=b.user_code and a.station_code=c.station_code " // +" and a.start_time>=to_date('" + ASPxDateEdit5.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and a.start_time<=to_date('" + ASPxDateEdit6.Text.Trim() + "','yyyy-mm-dd hh24:mi:ss') and c.station_name='" + txtStation.Text.Trim().ToUpper() + "' order by a.sn "; // DataTable dt5 = dc.GetTable(sql5); // for (int i = 0; i < dt5.Rows.Count; i++) // { // so = dt5.Rows[i][0].ToString(); // sn2 = dt5.Rows[i][1].ToString(); // time = dt5.Rows[i][2].ToString(); // Uname = dt5.Rows[i][3].ToString(); // dr2[0] = so; // dr2[1] = sn2; // dr2[2] = time; // dr2[3] = Uname; // string sql6 = " Select a.item_code,a.vendor_code,a.item_sn,b.pt_desc2 from vw_data_sn_bom a,copy_pt_mstr b where a.sn='" + sn2 + "' and a.station_name='" + txtStation.Text.Trim() + "' and a.item_code=b.pt_part"; // DataTable dt6 = dc.GetTable(sql6); // if (dt6.Rows.Count > 0) // { // icode = dt6.Rows[0][0].ToString(); // vcode = dt6.Rows[0][1].ToString(); // isn = dt6.Rows[0][2].ToString(); // pt = dt6.Rows[0][3].ToString(); // barcode = icode + '^' + vcode + '^' + isn; // } // dr2[4] = barcode; // dr2[5] = pt; // } // Table2.Rows.Add(dr2); // ASPxGridView4.DataSource = Table2; // ASPxGridView4.DataBind(); //} }
public void GetDataHeader(string pickingHeader) { try { var pResult = ""; var ds = _objPicking.GePickingInPanelReception(Convert.ToInt32(pickingHeader), Session["connectionString"].ToString(), ref pResult); if (pResult == "") { Session["DATOS_PICKING_DATASET"] = ds; Session["DATOS_PICKING_DETAIL"] = ds.Tables[1]; ASPxGridView3.DataSource = ds.Tables[1]; ASPxGridView3.DataBind(); //AQUI VERIFICA SI LOS VALORES SON 0 int contador = 0; foreach (DataRow row in ds.Tables[1].Rows) // Loop over the rows. { contador = Convert.ToInt32(row[6]) + contador; } if (contador == 0) { _objFreight.UpdatePickingHeaderFF_STATUS(Session["connectionString"].ToString(), pickingHeader); if (Page.IsCallback) { DevExpress.Web.ASPxWebControl.RedirectOnCallback("DispatchPanel.aspx"); } else { Response.Redirect("DispatchPanel.aspx"); } } ASPxSpinEdit2.Text = pickingHeader; if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["NAME_CUSTOMER"]))) { ASPxTextBox3.Text = Convert.ToString(ds.Tables[0].Rows[0]["NAME_CUSTOMER"]); ASPxTextBox3.Value = Convert.ToString(ds.Tables[0].Rows[0]["CODE_CUSTOMER"]); } if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["LOGIN"]))) { ASPxTextBox6.Text = Convert.ToString(ds.Tables[0].Rows[0]["LOGIN"]); } if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["REFERENCE"]))) { ASPxTextBox4.Text = Convert.ToString(ds.Tables[0].Rows[0]["REFERENCE"]); } if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"]))) { ASPxTextBox5.Text = Convert.ToString(ds.Tables[0].Rows[0]["DOC_SAP_RECEPTION"]); } if ((!Convert.IsDBNull(ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"]))) { ASPxTextBox7.Text = Convert.ToString(ds.Tables[0].Rows[0]["NAME_CLASSIFICATION"]); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void ASPxGridView3_BatchUpdate(object sender, ASPxDataBatchUpdateEventArgs e) { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } try { var fieldValues = ASPxGridView3.GetSelectedFieldValues(new[] { "CODE_CUSTOMER", "NAME_CUSTOMER" }); var newval = new int[e.UpdateValues.Count]; var customerKey = new string[e.UpdateValues.Count]; var conteo = 0; var customerValues = new Customer[fieldValues.Count]; var objSync = new System.Collections.ObjectModel.Collection <SyncSellers>(); var objNewTask = new System.Collections.ObjectModel.Collection <NewTask>(); foreach (var args in e.UpdateValues) { foreach (string valor in args.Keys.Values) { customerKey[conteo] = valor; } foreach (int valor in args.NewValues.Values) { newval[conteo] = valor; } conteo++; } conteo = 0; foreach (object[] value in fieldValues) { var flag = false; customerValues[conteo] = new Customer { CodeCustomer = value[0].ToString(), NameCustomer = value[1].ToString() }; for (var i = 0; customerKey.Count() > i; i++) { if (customerKey[i] != value[0].ToString()) { continue; } customerValues[conteo].Priority = newval[i]; flag = true; } if (flag == false) { customerValues[conteo].Priority = 1; } conteo++; } for (var i = 0; customerValues.Count() > i; i++) { var pResult = ""; _objTask.UpdateInsertPresaleTasks(Session["connectionString"].ToString(), customerValues[i].CodeCustomer, customerValues[i].NameCustomer, ASPxGridLookup1.Text, ASPxMemo1.Text, ASPxTimeEdit1.DateTime, ASPxCalendar1.SelectedDate, customerValues[i].Priority, ref pResult); if (pResult != ASPxGridLookup1.Text) { objSync.Add(new SyncSellers { OldSeller = pResult, NewSeller = ASPxGridLookup1.Text }); } else { objNewTask.Add(new NewTask { NewSeller = ASPxGridLookup1.Text }); } } //puede ser distinct por si solo se desea una notificacion ASPxGridView3.JSProperties.Add("cpSyncUsers", new object[] { objSync }); ASPxGridView3.JSProperties.Add("cpNewTask", new object[] { objNewTask }); GetTasksByDate(ASPxCalendar1.SelectedDate); ASPxPopupControl1.ShowOnPageLoad = false; ASPxGridLookup1.Text = ""; ASPxMemo1.Text = ""; ASPxGridView3.Selection.UnselectAll(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } e.Handled = true; }