protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { //执行删除 if (Request.Params["id"] != null)//Request.Params传递参数ID=0 { string sSql; sSql = "delete tblMode where id=" + Request.Params["id"]; DBConn myDB1 = new DBConn(); myDB1.ExecuteNonQuery(sSql ); myDB1.Close(); } //执行编辑 if (Request.Params["Editid"] != null) { AddButton.Visible = false; EditButton.Visible = true; EditButton.ToolTip = Request.Params["Editid"]; getFieldVaule(); getFieldVaule(); } BindGrid(); } }
private void getOrderData( string strOID ) { DBConn myDB = new DBConn(); string sql="select * from [Order] where OID='" + strOID + "'"; SqlDataReader dr = myDB.getDataReader( sql ); if( dr.Read() ) { lblOrderID.Text = dr["OID"].ToString(); lblTName.Text = dr["TName"].ToString(); string strEmail = dr["Email"].ToString(); lblEmail.Text = "<a href='mailto:" + strEmail + "'>" + strEmail + "</a>"; lblPhone.Text = dr["Phone"].ToString(); lblPID.Text = dr["PID"].ToString(); lblPName.Text = dr["PName"].ToString(); lblPPrice.Text = double.Parse( dr["PPrice"].ToString() ).ToString("C"); lblPNum.Text = dr["PNum"].ToString(); lblTotalPrice.Text = double.Parse( dr["TotalPrice"].ToString() ).ToString("C"); lblPubdate.Text = dr["Pubdate"].ToString(); lblOState.Text = dr["OState"].ToString(); if (lblPID.Text=="0") lblDetailP.Text = "<a href='../P_OderInfo.aspx?id=" + dr["OID"].ToString() + "' target='_blank'>查看批量购买的产品详情</a>"; } /*else { Response.Write("<script>"); Response.Write("alert('没有订单编号为[ " + strOID + " ]这条记录!!!');"); Response.Write("</script>"); }*/ dr.Close(); myDB.Close(); }
protected void Page_Load(object sender, System.EventArgs e) { //权限检查 if( Session["adminName"]==null || Session["adminName"].ToString() == String.Empty ) { Response.Write("<font color=#ff0000>对不起,您没足够权限访问此页!!</font>"); Response.Write("<a href=index.aspx>重新登陆</a>"); Response.End(); return; } if( !IsPostBack ) { if (Request.QueryString["ac"]!= null) { string mySql = "update [Order] set OState=" + (string)(Request.QueryString["ac"]) + " where OID='" + (string)(Request.QueryString["oid"])+"'"; DBConn myDB = new DBConn(); myDB.ExecuteNonQuery(mySql); myDB.Close(); } getData(); } }
private void alterState( string strID ) { string mySql = "update message set MState=1 where MState<>1 and MID=" + strID; DBConn myDB = new DBConn(); myDB.ExecuteNonQuery(mySql); myDB.Close(); }
protected void Button1_Click(object sender, System.EventArgs e) { string strName = TextBox1.Text; if( strName.Trim() == String.Empty ) { Response.Write("<script>"); Response.Write("alert('请输入类别名称!!!');"); Response.Write("</script>"); return; } else if( strName.Length > 35 ) { Response.Write("<script>"); Response.Write("alert('输入类别名称太长了!!!');"); Response.Write("</script>"); return; } DBConn myDB = new DBConn(); string sql="insert into Category(CName) values('" + strName + "')"; myDB.ExecuteNonQuery(sql); myDB.Close(); Response.Write("<script>"); Response.Write("alert('成功添加!!!');"); Response.Write("</script>"); TextBox1.Text=""; getData(); }
private void getData() { DBConn myDB = new DBConn(); string sql="select * from admin order by addtime"; adminDataGrid.DataSource = myDB.getDataReader(sql); adminDataGrid.DataBind(); myDB.Close(); }
private void getData()//绑定数据 { DBConn myDB = new DBConn(); string sql="select * from Category order by CID desc"; DataGrid1.DataSource = myDB.getDataReader(sql); DataGrid1.DataBind(); myDB.Close(); }
protected void Page_Load(object sender, System.EventArgs e) { //权限检查 if( Session["adminName"]==null || Session["adminName"].ToString() == String.Empty ) { Response.Write("<font color=#ff0000 style='FONT-SIZE: 12px'>对不起,您没足够权限访问此页!!</font><br>"); Response.Write("<a href=index.aspx target=_top style='FONT-SIZE: 12px'>重新登陆</a><br>"); Response.End(); return; } if( !IsPostBack ) { getCategory();//绑定类别下拉列表 if( Request.QueryString["id"] == null) { Response.Write("没有这个二手书"); Response.End(); } string strID = Request.QueryString["id"].ToString().Trim(); //获取ID对应的二手书信息 DBConn myDB1 = new DBConn(); string sqlP="select * from Products where PID=" + strID; SqlDataReader dr = myDB1.getDataReader(sqlP); if ( dr.Read() ) { myimg.Src = "../showPP.aspx?id=" + dr["PID"].ToString(); ViewState["PID"] = dr["PID"].ToString(); txtName.Text = CleanString.htmlOutputText( dr["PName"].ToString() ); txtCPrice.Text = double.Parse( dr["PCPrice"].ToString() ).ToString("f2");//小数点后面的位数2位 txtFPrice.Text = double.Parse( dr["PFPrice"].ToString() ).ToString("f2"); txtNPrice.Text = double.Parse( dr["PNPrice"].ToString() ).ToString("f2"); txtBewrite.Text = CleanString.htmlOutputText( dr["PBewrite"].ToString() ); txtUseMode.Text = CleanString.htmlOutputText( dr["PUseMode"].ToString() ); txtValidity.Text = CleanString.htmlOutputText( dr["PValidity"].ToString() ); try//分类 { ddlCategory.SelectedValue = dr["CID"].ToString(); } catch { ddlCategory.SelectedIndex = 0; } } dr.Close(); myDB1.Close(); } }
private void getCategory()//绑定类别下拉列表 { DBConn myDB = new DBConn(); string sql="select * from Category"; ddlCategory.DataSource = myDB.getDataReader(sql); ddlCategory.DataTextField = "CName"; ddlCategory.DataValueField = "CID"; ddlCategory.DataBind(); myDB.Close(); }
private void getVData() { string sql="select * from Products Left Outer join Category on Products.CID = Category.CID where PCommend=1 order by PID desc"; DBConn myDB = new DBConn(); DataGrid1.DataSource = myDB.getDataReader(sql); DataGrid1.DataBind(); myDB.Close(); }
private void adminDataGrid_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { string strAdmin = e.Item.Cells[1].Text; DBConn myDB = new DBConn(); string sql="Delete from admin where username='******'"; myDB.ExecuteNonQuery(sql); myDB.Close(); getData(); }
private void getddlClassData()//绑定类别 { DBConn myDB = new DBConn(); string sql="select * from Category order by CID desc"; ddlClass.DataSource = myDB.getDataReader(sql); ddlClass.DataTextField = "CName"; ddlClass.DataBind(); myDB.Close(); ddlClass.Items.Insert(0,new ListItem("所有分类","-1")); }
protected void Button1_Click(object sender, EventArgs e) { string 进货,销售; DBConn db1 = new DBConn(); 进货 = db1.LookUp("select sum(ismoney) as '1' from viwlog where isDate between '" + TextBox1.Text + " 00:00:00' and '" + TextBox2.Text + " 23:59:00'", "1"); 销售 = db1.LookUp("select sum(totalprice) as '1' from [order] where pubdate between '" + TextBox1.Text + " 00:00:00' and '" + TextBox2.Text + " 23:59:00'", "1"); if (销售 == "") 销售 = "0"; if (进货 == "") 进货 = "0"; lblNote.Text = "利润= " + (double.Parse(销售) - double.Parse(进货)); }
private void getDataCount() { string mySql="select count(*) as [num] from [message] where MState=" + ViewState["MState"].ToString(); DBConn myDB = new DBConn(); SqlDataReader mydr = myDB.getDataReader( mySql ); if( mydr.Read() ) { lblNum.Text = mydr["num"].ToString(); } mydr.Close(); myDB.Close(); }
protected void insert(object sender, EventArgs e) { DBConn Database = new DBConn(); String str = "INSERT INTO BusinessSector VALUES (@BizSector)"; SqlCommand cmd = new SqlCommand(str, Database.Connection); cmd.Connection.Open(); cmd.Parameters.AddWithValue("@BizSector", Convert.ToString(boxBusinessSector.Text)); cmd.ExecuteNonQuery(); cmd.Connection.Close(); GridView1.DataBind(); }
protected void insert(object sender, EventArgs e) { DBConn Database = new DBConn(); String str = "INSERT INTO AnimalDiaryTypes VALUES (@DiaryType)"; SqlCommand cmd = new SqlCommand(str, Database.Connection); cmd.Connection.Open(); cmd.Parameters.AddWithValue("@DiaryType", Convert.ToString(boxDiaryType.Text)); cmd.ExecuteNonQuery(); cmd.Connection.Close(); GridView1.DataBind(); }
private void getAnnounce() { string mySql="select * from append where id='3'"; DBConn myDB = new DBConn(); SqlDataReader mydr = myDB.getDataReader( mySql ); if( mydr.Read() ) { txtAnnounce.Text = CleanString.htmlOutputText( mydr["text"].ToString() ); } mydr.Close(); myDB.Close(); }
protected void insert(object sender, EventArgs e) { DBConn Database = new DBConn(); String str = "INSERT INTO AnimalRaces VALUES (@AnimalSpecieID,@Name)"; SqlCommand cmd = new SqlCommand(str, Database.Connection); cmd.Connection.Open(); cmd.Parameters.AddWithValue("@AnimalSpecieID", Convert.ToInt32(ddlSpecies.SelectedValue)); cmd.Parameters.AddWithValue("@Name", Convert.ToString(boxSpecieName.Text)); cmd.ExecuteNonQuery(); cmd.Connection.Close(); GridView1.DataBind(); }
protected void btnOk_Click(object sender, System.EventArgs e) { string strAnnounce = CleanString.htmlInputText( txtAnnounce.Text ); string mySql="update [Append] set [text]='" + strAnnounce + "' where [id]='3'"; DBConn myDB = new DBConn(); int iNum = myDB.ExecuteNonQuery( mySql ); myDB.Close(); if( iNum == 1 ) { Response.Write("<script>"); Response.Write("alert('[公告栏] 修改成功!!!');"); Response.Write("</script>"); } }
protected void EditButton_Click(object sender, EventArgs e) {//修改记录 if (CheckPut() ) { string sSql = "Update tblMode set 名称= '" + txtTitle.Text.Trim() + "',备注='" + txtRate.Text.Trim() + "' where id=" + EditButton.ToolTip; DBConn myDB1 = new DBConn(); myDB1.ExecuteNonQuery(sSql ); myDB1.Close(); } BindGrid(); txtRate.Text = " "; txtTitle.Text = " "; AddButton.Visible = true; EditButton.Visible = false; }
private void getData( string strID ) { string mySql = "select * from message where MID=" + strID; DBConn myDB = new DBConn(); SqlDataReader mydr = myDB.getDataReader( mySql ); if( mydr.Read() ) { lblUName.Text = mydr["UName"].ToString(); lblUPhone.Text = mydr["UPhone"].ToString(); string strUEmail = mydr["UEmail"].ToString(); lblUEmail.Text = "<a href='mailto:" + strUEmail + "'>" + strUEmail + "</a>"; lblMTitle.Text = mydr["MTitle"].ToString(); txtMContent.Text = CleanString.htmlOutputText( mydr["MContent"].ToString() ); lblDate.Text = mydr["Pubdate"].ToString(); } mydr.Close(); myDB.Close(); }
private void getPData()//获取ID对应的二手书信息 { string strID = ViewState["PID"].ToString(); DBConn myDB1 = new DBConn(); string sqlP = "select PName,PStock,PSellNum from Products where PID=" + strID; SqlDataReader dr = myDB1.getDataReader(sqlP); if (dr.Read()) { lblPName.Text = dr["PName"].ToString(); lblPStock.Text = dr["PStock"].ToString(); lblPSellNum.Text = dr["PSellNum"].ToString(); } dr.Close(); myDB1.Close(); }
private bool checkAdmin( string strAdmin ) { bool bTemp = false; DBConn myDB = new DBConn(); string mySql = "select * from admin where username='******'"; SqlDataReader mydr = myDB.getDataReader( mySql ); if( mydr.Read() ) { bTemp = true; } else { bTemp = false; } mydr.Close(); myDB.Close(); return bTemp; }
protected void ShowTodoList() { string selectString = "SELECT * FROM schedule"; selectString += "WHERE u_name=@user AND date=@date ORDER BY time"; DBConn conn = new DBConn(); SqlCommand cmd = new SqlCommand(selectString, conn.GetConn()); cmd.Parameters.AddWithValue("@user", Membership.GetUser().UserName); cmd.Parameters.AddWithValue("@date", string.Format("{0:yyyy-MM-dd}", selectedDate)); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ShowTodo(dr["serial_no"].ToString(), dr["time"].ToString(), dr["todo"].ToString(), dr["has_done"].ToString()); } dr.Close(); conn.Close(); }
protected void Page_Load(object sender, System.EventArgs e) { //权限检查 if( Session["adminName"]==null || Session["adminName"].ToString() == String.Empty ) { Response.Write("<font color=#ff0000>对不起,您没足够权限访问此页!!</font>"); Response.Write("<a href=index.aspx>重新登陆</a>"); Response.End(); return; } if( !IsPostBack ) { if( Request.QueryString["id"] == null) { Response.Write("没有这个二手书"); Response.End(); } string strID = Request.QueryString["id"].ToString().Trim(); if( strID == String.Empty ) { strID = "-1"; } DBConn myDB1 = new DBConn(); string sqlP="select PName from Products where PID=" + strID; SqlDataReader dr = myDB1.getDataReader(sqlP); if( dr.Read() ) { lblName.Text = dr["PName"].ToString(); } dr.Close(); myDB1.Close(); ViewState["PID"] = strID; } }
private bool isAdmin( string strAdmin, string strPassword ) { bool bTemp = false; strPassword = FormsAuthentication.HashPasswordForStoringInConfigFile( strPassword ,"MD5"); DBConn myDB = new DBConn(); string mySql = "select * from admin where username='******' and password='******'"; SqlDataReader mydr = myDB.getDataReader( mySql ); if( mydr.Read() ) { bTemp = true; } else { bTemp = false; } mydr.Close(); myDB.Close(); return bTemp; }
protected void btnResetPSellNum_Click(object sender, System.EventArgs e) { string strID = ViewState["PID"].ToString(); DBConn myDB = new DBConn(); string sql = "select sum(PNum) as [count] from [Order] where OState=1 and PID=" + strID; SqlDataReader myDR = myDB.getDataReader(sql); if (myDR.Read()) { string myCount = myDR["count"].ToString(); if (myCount == "") { Response.Write("<script>"); Response.Write("alert('没有出售该二手书,无法累积');"); Response.Write("</script>"); return; } sql = "update [Products] set [PSellNum]=[PSellNum]+" + myCount + "where [PID]=" + strID; myDR.Close(); myDB.ExecuteNonQuery(sql); sql = "Update [Products] set [PStock]=[PStock]-" + myCount + " where [PID]=" + strID; myDR.Close(); myDB.ExecuteNonQuery(sql); } myDB.Close(); getPData(); Response.Write("<script>"); Response.Write("alert('重新累积完成!!!');"); Response.Write("</script>"); }
public WordCreator(PatientMV pp, DBConn conn) { if (pp == null || conn == null) { return; } dB = conn; _patient = pp; _defaultIndex = new DefaultIndex { Height = _patient.Patient.Height, Weight = _patient.Patient.Weigth, LastDiastolSizeLeftStomach = _patient.PatienValue?.LastDiastolSizeLeftStomach, ThicknessLowerWallLeftStomach = _patient.PatienValue?.ThicknessLowerWallLeftStomach, Arise = _patient.Aorta?.Arise, //LastVolumeLJRSF = _patient.RightStomachFunction?.LastVolumeLJ, ThicknessMejPereMJP = _patient.PatienValue?.ThicknessMejPereMJP, KDO = _patient.RightStomachFunction?.LastVolumeLJ, LP = _patient.PatienValue?.LeftAtrium, Volume = _patient.RightStomachFunctionAddition?.MaxValomeLeftAtrium, AverageGradientAortValue = _patient.RightStomachFunction?.AverageGradientAortValue, AverageGradientPressureTrucuspidil = _patient.RightStomachFunction?.AverageGradientPressureTrucuspidil, AverageGradientMitralValve = _patient.LeftStomachFunction?.AverageGradientMitralValve, MaxGradientAortValue = _patient.RightStomachFunction?.MaxGradientAortValue, MaxGradientTricuspidil = _patient.RightStomachFunction?.MaxGradientTricuspidil, MaxGradientLeftStomach = _patient.RightStomachFunction?.MaxGradientLeftStomach, MaxGradientMitralValve = _patient.LeftStomachFunction?.MaxGradientMitralValve, MaxGradientPressurePulmonaryArtery = _patient.PatienValue?.MaxGradientPressurePulmonaryArtery, RightAtriumVolume = _patient.RightStomachFunctionAddition?.MaxValomeRightAtrium }; _patient.LeftStomachMV = new LeftStomachMV { LastDiastolSizeLeftStomach = _patient.PatienValue?.LastDiastolSizeLeftStomach, LastSislotSizeLeftStomach = _patient.PatienValue?.LastSislotSizeLeftStomach, RelativeThicknessLeftStomach = _patient.PatienValue?.RelativeThicknessLeftStomach, ThicknessLowerWallLeftStomach = _patient.PatienValue?.ThicknessLowerWallLeftStomach, ThicknessMejPereMJP = _patient.PatienValue?.ThicknessMejPereMJP, ThicknessSegment = _patient.PatienValue?.ThicknessSegment, MovementMJP = _patient.PatienValue?.MovementMJP, FractionAcceleration = _patient.PatienValue?.FractionAcceleration, FVRSF = _patient.RightStomachFunction?.FV, LastVolumeLJ = _patient.RightStomachFunction?.LastVolumeLJ, INS = _patient.PatienValue?.INS, UOK = _patient.RightStomachFunction?.UOK }; _patient.Dopper = new Dopper { Aortha = _patient.RightStomachFunction?.VelocityAortValve, LeaveTract = _patient.RightStomachFunction?.VelocityLeftStomach, MitralValve = _patient.LeftStomachFunction?.PickE, TricValve = _patient.RightStomachFunction?.PickE, ValveLight = _patient.PatienValue?.VelocityVavlvePulmonaryArtery }; _patient.LightValve = new LightValve { MaxGradientTricuspidil = _patient.RightStomach?.MaxGradientTricuspidil, PressurePP = _patient.RightStomach?.PressurePP, SistolPressureLA = _patient.RightStomach?.SistolPressureLA }; _patient.DiametrNpv = new DiametrNpv { CollNPV = _patient.RightStomach?.SelectedColl, WidthNPV = _patient.RightStomach?.Width }; _patient.LeftAtrium = new LeftAtrium { LP = _patient.PatienValue?.LeftAtrium, Volume = _patient.RightStomachFunctionAddition?.MaxValomeLeftAtrium }; _patient.RightAtrium = new RightAtrium { RightAtriumVolume = _patient.RightStomachFunctionAddition?.MaxValomeRightAtrium }; _patient.CommentaryMV = new CommentaryMV { Commentary = _patient.Patient?.Commentary }; _defaultIndex.Initialize(); _patient.LeftStomachMV.WeightMokardLj = _defaultIndex.indexes["Mass"]; date = _patient.Patient.ResearchDateTime.ToString().Replace(" ", "_").Replace(":", "_"); _patientName = string.IsNullOrWhiteSpace(_patient.Patient.FIO) ? date : $"{_patient.Patient.FIO}_{date}"; var gender = _patient.Patient.Jender == "Ж" ? Gender.Female : Gender.Male; normaStorage = new NormaStorage(gender, pp.Patient.ChildAgeCode); CreateFolder(); }
protected void BtngEnviar_Click(object sender, EventArgs e) { string sLicenciatario = string.Empty; string sNoContrato = string.Empty; string sTxtComentarios = txtcomentarios.Text; if (!string.IsNullOrEmpty(numcontrato.Value)) { DBConn oConn = new DBConn(); if (oConn.Open()) { cReporteVenta oReporteVenta = new cReporteVenta(ref oConn); oReporteVenta.NumContrato = numcontrato.Value; oReporteVenta.Periodo = periodo.Value; oReporteVenta.AnoReporte = ano_reporte.Value; oReporteVenta.EstReporte = "C"; DataTable dtReporteVenta = oReporteVenta.Get(); if (dtReporteVenta != null) { if (dtReporteVenta.Rows.Count > 0) { foreach (DataRow oRow in dtReporteVenta.Rows) { oReporteVenta.CodigoReporteVenta = oRow["cod_reporte_venta"].ToString(); oReporteVenta.EstReporte = "P"; oReporteVenta.Accion = "EDITAR"; oReporteVenta.Put(); } } } dtReporteVenta = null; cContratos oContratos = new cContratos(ref oConn); oContratos.NumContrato = numcontrato.Value; DataTable dtContrato = oContratos.Get(); if (dtContrato != null) { if (dtContrato.Rows.Count > 0) { sNoContrato = dtContrato.Rows[0]["no_contrato"].ToString(); cDeudor oDeudor = new cDeudor(ref oConn); oDeudor.NKeyDeudor = dtContrato.Rows[0]["nkey_deudor"].ToString(); DataTable dtDeudor = oDeudor.Get(); if (dtDeudor != null) { if (dtDeudor.Rows.Count > 0) { sLicenciatario = dtDeudor.Rows[0]["snombre"].ToString(); } } dtDeudor = null; } } dtContrato = null; } oConn.Close(); } else { DBConn oConn = new DBConn(); if (oConn.Open()) { cReporteVenta oReporteVenta = new cReporteVenta(ref oConn); oReporteVenta.EstReporte = "C"; DataTable dtReporteVenta = oReporteVenta.GettingForInvoice(); if (dtReporteVenta != null) { if (dtReporteVenta.Rows.Count > 0) { foreach (DataRow oRow in dtReporteVenta.Rows) { oReporteVenta.NumContrato = oRow["num_contrato"].ToString(); oReporteVenta.Periodo = oRow["periodo_q"].ToString(); oReporteVenta.AnoReporte = oRow["ano_reporte"].ToString(); oReporteVenta.EstReporte = "C"; DataTable dtVenta = oReporteVenta.Get(); if (dtVenta != null) { if (dtVenta.Rows.Count > 0) { foreach (DataRow oRowVenta in dtVenta.Rows) { oReporteVenta.CodigoReporteVenta = oRowVenta["cod_reporte_venta"].ToString(); oReporteVenta.EstReporte = "P"; oReporteVenta.Accion = "EDITAR"; oReporteVenta.Put(); } } } dtVenta = null; } } } dtReporteVenta = null; } oConn.Close(); } StringBuilder sMensaje = new StringBuilder(); sMensaje.Append("<html>"); sMensaje.Append("<body>"); if (!string.IsNullOrEmpty(numcontrato.Value)) { sMensaje.Append("Licenciatario : ").Append(sLicenciatario).Append("<br>"); sMensaje.Append("Contrato : ").Append(sNoContrato).Append("<br>"); sMensaje.Append("Periodo : ").Append(periodo.Value).Append("<br>"); } sMensaje.Append("Motivo Rechazo : ").Append(sTxtComentarios).Append("<br>"); sMensaje.Append("</body>"); sMensaje.Append("</html>"); Emailing oEmailing = new Emailing(); oEmailing.FromName = Application["NameSender"].ToString(); oEmailing.From = Application["EmailSender"].ToString(); oEmailing.Address = Application["EmailSender"].ToString(); if (!string.IsNullOrEmpty(numcontrato.Value)) { oEmailing.Subject = "Rechazo de factura periodo " + periodo.Value + ", contrato " + sNoContrato + " de Licenciatario " + sLicenciatario; } else { oEmailing.Subject = "Rechazo de todas las facturas de periodos del sistema Licenciatario "; } oEmailing.Body = sMensaje; StringBuilder js = new StringBuilder(); js.Append("function LgRespuesta() {"); if (oEmailing.EmailSend()) { js.Append(" window.radalert('El rechazo fue enviado exitosamente.', 400, 100,''); "); } else { js.Append(" window.radalert('El rechazo no pudo ser enviado, intente más tarde.', 400, 100,''); "); } js.Append(" Sys.Application.remove_load(LgRespuesta); "); js.Append("};"); js.Append("Sys.Application.add_load(LgRespuesta);"); Page.ClientScript.RegisterStartupScript(Page.GetType(), "LgRespuesta", js.ToString(), true); txtcomentarios.Text = string.Empty; bx_msRechazo.Visible = false; bx_msRealizado.Visible = true; }
private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { string strid = e.Item.Cells[0].Text; DBConn myDB = new DBConn(); string sql="update Products set PCommend=0 where PID="+strid; myDB.ExecuteNonQuery(sql); myDB.Close(); getPData(); getVData(); }
protected void btnAlter_Click(object sender, System.EventArgs e) { if (ViewState["PID"] == null) { Response.Write("<script>"); Response.Write("alert('更新失败!!!');"); Response.Write("</script>"); return; } string strID = ViewState["PID"].ToString(); string strName = txtName.Text.Trim(); string strCID = ddlCategory.SelectedValue; string strCPrice = txtCPrice.Text.Trim(); string strFPrice = txtFPrice.Text.Trim(); string strNPrice = txtNPrice.Text.Trim(); string strBewrite = txtBewrite.Text.Trim(); string strUseMode = txtUseMode.Text.Trim(); string strValidity = txtValidity.Text.Trim(); if (strName == String.Empty || strCPrice == String.Empty || strCID == String.Empty || strFPrice == String.Empty || strNPrice == String.Empty) { Response.Write("<script>"); Response.Write("alert('必选项不能为空!!!');"); Response.Write("</script>"); return; } else if (strName.Length > 35) { Response.Write("<script>"); Response.Write("alert('输入二手书名称太长了!!!');"); Response.Write("</script>"); return; } try { double.Parse(strCPrice); } catch { Response.Write("<script>"); Response.Write("alert('请检查 成本价 的格式!!!');"); Response.Write("</script>"); return; } try { double.Parse(strFPrice); } catch { Response.Write("<script>"); Response.Write("alert('请检查 原价 的格式!!!');"); Response.Write("</script>"); return; } try { double.Parse(strNPrice); } catch { Response.Write("<script>"); Response.Write("alert('请检查 现价 的格式!!!');"); Response.Write("</script>"); return; } if (uploadFile.PostedFile.FileName.Trim() != String.Empty && (Path.GetExtension(uploadFile.PostedFile.FileName) != ".gif" && Path.GetExtension(uploadFile.PostedFile.FileName) != ".jpg")) { Response.Write("<Script>alert('上传的图片格式必须为gif或jpg!!')</Script>"); return; } strBewrite = CleanString.htmlInputText(strBewrite); strUseMode = CleanString.htmlInputText(strUseMode); strValidity = CleanString.htmlInputText(strValidity); string sql = "update Products set PName='" + strName + "',CID=" + strCID + ",PCPrice=" + strCPrice + ",PFPrice=" + strFPrice + ",PNPrice=" + strNPrice + ",PBewrite='" + strBewrite + "',PUseMode='" + strUseMode + "',PValidity='" + strValidity + "' where PID=" + strID; DBConn myDB = new DBConn(); myDB.ExecuteNonQuery(sql); myDB.Close(); if (uploadFile.PostedFile.FileName.Trim() != String.Empty) { //----------- update图片 Stream imagedatastream; string DBPath = ConfigurationManager.AppSettings["DataBasePath"]; string connStr = (DBPath); SqlConnection myConn = new SqlConnection(connStr); imagedatastream = Request.Files["uploadFile"].InputStream; int imagedatalen = Request.Files["uploadFile"].ContentLength; string imagedatatype = Request.Files["uploadFile"].ContentType; byte[] image = new byte[imagedatalen]; imagedatastream.Read(image, 0, imagedatalen); String Psql = "update Products set PPicture=@imgdata where PID=" + strID; SqlCommand Pcommand = new SqlCommand(Psql, myConn); SqlParameter imgdata = new SqlParameter("@imgdata", SqlDbType.Image); imgdata.Value = image; Pcommand.Parameters.Add(imgdata); myConn.Open(); Pcommand.ExecuteReader(); myConn.Close(); } Response.Write("<script>"); Response.Write("alert('成功更新!!!');"); Response.Write("</script>"); }
/// <summary> /// Agrega validacion de integridad a una entidad: ResEntrevista /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entResEntrevista">Entidad con los datos a validar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void RenTInt_f(DBConn p_dbcAccess, EResEntrevista p_entResEntrevista, StatMsg p_smResult) { }
/// <summary> /// Agrega validacion de integridad a una entidad: Rubro /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entRubro">Entidad con los datos a validar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void RbrTInt_f(DBConn p_dbcAccess, ERubro p_entRubro, StatMsg p_smResult) { }
void oButton_Click(object sender, EventArgs e) { bool bExecMail = false; string sDireccion = sDireccion = "."; DBConn oConn = new DBConn(); if (oConn.Open()) { string cPath = Server.MapPath("."); string sSubject = string.Empty; string sNomApeUsrOrigen = string.Empty; string sEmailDestino = string.Empty; SysUsuario sUsuario; StringBuilder oHtml = new StringBuilder(); BinaryUsuario dUser; StringBuilder sFile = new StringBuilder(); SysRelacionUsuarios oRelacionUsuarios; StringBuilder oFolder = new StringBuilder(); oFolder.Append(Server.MapPath(".")).Append(@"\binary\"); string sType = (sender as Button).Attributes["sType"].ToString(); switch (sType) { case "P": oRelacionUsuarios = new SysRelacionUsuarios(ref oConn); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.EstRelacion = "P"; oRelacionUsuarios.Accion = "CREAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuario"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.EstRelacion = "C"; oRelacionUsuarios.Accion = "CREAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuarioRel"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); sUsuario = new SysUsuario(); sUsuario.Path = cPath; sUsuario.CodUsuario = (sender as Button).Attributes["CodUsuario"].ToString(); dUser = sUsuario.ClassGet(); if (dUser != null) { sNomApeUsrOrigen = dUser.NomUsuario + " " + dUser.ApeUsuario; } dUser = null; sUsuario.CodUsuario = (sender as Button).Attributes["CodUsuarioRel"].ToString(); dUser = sUsuario.ClassGet(); if (dUser != null) { sEmailDestino = dUser.EmlUsuario; } dUser = null; oHtml.Append("<HTML><BODY><p><font face=verdana size=2>").Append(sNomApeUsrOrigen); oHtml.Append("<br>").Append(oCulture.GetResource("Mensajes", "sMessage04")).Append("</font></p></BODY></HTML>"); sSubject = sNomApeUsrOrigen + oCulture.GetResource("Mensajes", "sMessage03") + Application["SiteName"].ToString(); sDireccion = "Escort.aspx?CodUsuario=" + (sender as Button).Attributes["CodUsuarioRel"].ToString(); bExecMail = true; break; case "C": oRelacionUsuarios = new SysRelacionUsuarios(ref oConn); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.EstRelacion = "V"; oRelacionUsuarios.Accion = "EDITAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuario"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.EstRelacion = "V"; oRelacionUsuarios.Accion = "EDITAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuarioRel"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); sUsuario = new SysUsuario(); sUsuario.Path = cPath; sUsuario.CodUsuario = (sender as Button).Attributes["CodUsuario"].ToString(); dUser = sUsuario.ClassGet(); if (dUser != null) { sNomApeUsrOrigen = dUser.NomUsuario + " " + dUser.ApeUsuario; } dUser = null; sUsuario.CodUsuario = (sender as Button).Attributes["CodUsuarioRel"].ToString(); dUser = sUsuario.ClassGet(); if (dUser != null) { sEmailDestino = dUser.EmlUsuario; } dUser = null; oHtml.Append("<HTML><BODY><p><font face=verdana size=2>").Append(sNomApeUsrOrigen); oHtml.Append("<br>").Append(oCulture.GetResource("Mensajes", "sMessage05")).Append("</font></p></BODY></HTML>"); sSubject = sNomApeUsrOrigen + oCulture.GetResource("Mensajes", "sMessage05"); bExecMail = true; break; case "N": oRelacionUsuarios = new SysRelacionUsuarios(ref oConn); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.Accion = "ELIMINAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuario"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); oRelacionUsuarios.CodUsuario = (sender as Button).Attributes["CodUsuarioRel"].ToString(); oRelacionUsuarios.CodUsuarioRel = (sender as Button).Attributes["CodUsuario"].ToString(); oRelacionUsuarios.Accion = "ELIMINAR"; oRelacionUsuarios.Put(); sFile.Length = 0; sFile.Append("RelacionUsuario_").Append((sender as Button).Attributes["CodUsuarioRel"].ToString()).Append(".bin"); oRelacionUsuarios.SerializaTblRelacionUsuarios(ref oConn, oFolder.ToString(), sFile.ToString()); break; } if (bExecMail) { Emailing oEmailing = new Emailing(); oEmailing.FromName = Application["NameSender"].ToString(); oEmailing.From = Application["EmailSender"].ToString(); oEmailing.Address = sEmailDestino; oEmailing.Subject = sSubject; oEmailing.Body = oHtml; oEmailing.EmailSend(); } oConn.Close(); } Response.Redirect(sDireccion); }
public CmsNodos(ref DBConn oConn) { this.oConn = oConn; }
public void ReadInCSVTest() { var path = "c://csvfiles//worldcities.csv"; var doubleTypeConversion = new DoubleConversion(); IList <CityModelImport> myList = ReadCsv.ReadCsvFile <CityModelImport, CityMap>(path, doubleTypeConversion); var countryCapitalQuery = (from s in myList where s.Capital.Equals("primary") orderby s.Country ascending select s); /* * foreach (CityModelImport city in countryCapitalQuery) * { * Debug.Write(city.Country + ": " + city.City_name + Environment.NewLine); * }*/ var queryName = nameof(countryCapitalQuery); var writePath = "c://csvfiles//" + queryName + ".csv"; using (var writer = new StreamWriter(writePath)) using (var csv = new CsvWriter(writer)) { csv.WriteRecords(countryCapitalQuery); } Assert.IsTrue(File.Exists(writePath)); var QSCount = (from city in countryCapitalQuery select city).Count(); CountryModel cm = new CountryModel(); cm.AddCountries <CityModelImport>(countryCapitalQuery); //Debug.Write(QSCount); Assert.AreEqual(15493, myList.Count()); using (var dbContext = new CitiesContext()) { dbContext.Database.Connection.Close(); } var countryGroups = from city in countryCapitalQuery group city by new { city.Country, city.ISO2, city.ISO3 } into countryGroup orderby countryGroup.Key.Country select countryGroup; //using (var db = new CitiesContext()) // DBConn conn = new DBConn(); // var db=conn.conn(); var db = DBConn.conn(); using (db) { foreach (var country in countryGroups) { var countryName = country.Key.Country; var ISO2 = country.Key.ISO2; var ISO3 = country.Key.ISO3; var CountryEntity = new CountryEntity { Name = countryName, ISO2 = ISO2, ISO3 = ISO3 }; db.Countries.Add(CountryEntity); db.SaveChanges(); int id = CountryEntity.CountryID; Debug.Write(country); foreach (var city in country) { var CityEntity = new CityEntity { City_name = city.City_name, Admin_name = city.Admin_name, City_ascii = city.City_ascii, Lat = city.Lat, Lng = city.Lng, Capital = city.Capital, CountryId = id, Population = city.Population }; db.Cities.Add(CityEntity); db.SaveChanges(); } } } // countryQuery = records.Where(city => city.Country.Equals("United States")); /* * foreach (CityModel city in countryQuery) * { * var name = city.City_name.ToString(); * } */ }
public AdminView(DBConn Db) { db = Db; InitializeComponent(); }
protected void Page_Load(object sender, EventArgs e) { idOpciones.Visible = false; idOpcionesTxt.Visible = false; if (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.cod_campo") != null) { hddCodCampo.Value = DataBinder.Eval(this.Parent.NamingContainer, "DataItem.cod_campo").ToString(); rdCmbTipo.Items.FindItemByValue(DataBinder.Eval(this.Parent.NamingContainer, "DataItem.tipo_campo").ToString().Trim()).Selected = true; string sTipo = DataBinder.Eval(this.Parent.NamingContainer, "DataItem.tipo_campo").ToString().Trim(); switch (sTipo) { case "0": case "1": DBConn oConn = new DBConn(); if (oConn.Open()) { idOpciones.Visible = true; StringBuilder sData = new StringBuilder(); SyrCampoOpciones oCampoOpciones = new SyrCampoOpciones(ref oConn); oCampoOpciones.CodCampo = DataBinder.Eval(this.Parent.NamingContainer, "DataItem.cod_campo").ToString(); DataTable dCampoOpciones = oCampoOpciones.GetOpcionByCodCampos(); if (dCampoOpciones != null) { if (dCampoOpciones.Rows.Count > 0) { foreach (DataRow oRow in dCampoOpciones.Rows) { sData.Append(oRow["nom_opcion"].ToString()).Append(Environment.NewLine); } txtAtributos.Text = sData.ToString(); } } dCampoOpciones = null; if (sTipo == "1") { chk_multSelect.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.desp_campo").ToString().Trim() == "C" ? true : false); } else { chk_multSelect.Visible = false; } } break; case "2": idOpcionesTxt.Visible = true; chk_observacion.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.desp_campo").ToString().Trim() == "O" ? true : false); chk_despl_usr.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_despliegue").ToString().Trim() == "V" ? true : false); chk_despl_portal.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_despliegue_portal").ToString().Trim() == "V" ? true : false); chk_ind_validacion.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_validacion").ToString().Trim() == "V" ? true : false); break; case "5": idOpcionesTxt.Visible = true; chk_observacion.Enabled = false; chk_despl_usr.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_despliegue").ToString().Trim() == "V" ? true : false); chk_despl_portal.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_despliegue_portal").ToString().Trim() == "V" ? true : false); chk_ind_validacion.Checked = (DataBinder.Eval(this.Parent.NamingContainer, "DataItem.ind_validacion").ToString().Trim() == "V" ? true : false); break; default: break; } } }
public cEjecutivo(ref DBConn oConn) { this.oConn = oConn; }
protected void Page_Load(object sender, EventArgs e) { bool bEnable = false; oIsUsuario = oWeb.ValidaUserAppReport(); if ((!string.IsNullOrEmpty(oIsUsuario.NKeyDeudor)) && (!string.IsNullOrEmpty(oIsUsuario.NKeyUsuario)) || (!string.IsNullOrEmpty(oIsUsuario.NCodHolding))) { DBConn oConn = new DBConn(); if (oConn.Open()) { cDashboard oDso = new cDashboard(ref oConn); oDso.nKeyCliente = oIsUsuario.NKeyUsuario; oDso.nKeyDeudor = oIsUsuario.NKeyDeudor; oDso.CodHolding = oIsUsuario.NCodHolding; oDso.Ano = DateTime.Now.Year.ToString(); //Response.Write("GetDso;" + DateTime.Now.Millisecond.ToString()+"<br>"); DataTable dt = oDso.GetDso(); //Response.Write("GetDso;" + DateTime.Now.Millisecond.ToString() + "<br>"); if (dt != null) { if (dt.Rows.Count > 0) { bEnable = true; string sMeses = string.Empty; string sMes = string.Empty; string sDso = string.Empty; string sData = "['Perido', 'Días']"; foreach (DataRow oRow in dt.Rows) { sMes = oRow["periodo"].ToString().Trim(); sData = sData + ",['" + sMes + "'," + double.Parse(oRow["dso"].ToString()).ToString("0.00", CultureInfo.InvariantCulture) + "]"; } StringBuilder sHtml = new StringBuilder(); sHtml.Append(" google.charts.setOnLoadCallback(drawChartDso); "); sHtml.Append(" function drawChartDso() { "); sHtml.Append(" var data = google.visualization.arrayToDataTable([ "); sHtml.Append(sData); sHtml.Append(" ]); "); sHtml.Append(" var options = { legend: { position: 'bottom', textStyle: { color: '#c5c5c5', fontName: 'Lato', fontSize: 13, bold: true, } }, vAxis: { format: 'short', textStyle: { color: '#c5c5c5', fontName: 'Lato', fontSize: 12, bold: true } }, hAxis: { textStyle: { color: '#629DCC', fontName: 'Lato', fontSize: 10, bold: true } }, colors: ['#F5A624'], pointSize: 10, backgroundColor: '#fff' }; "); sHtml.Append(" var chart = new google.visualization.AreaChart(document.getElementById('lineChart1')); "); sHtml.Append(" chart.draw(data, options); } "); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "lineChart1", sHtml.ToString(), true); } } dt = null; dt = oDso.GetSlaDso(); if (dt != null) { if (dt.Rows.Count > 0) { lb_sla_dso.Text = dt.Rows[0]["SLA_DSO"].ToString() + " " + dt.Rows[0]["unidad"].ToString(); } } dt = null; } oConn.Close(); if (bEnable) { idVistaEnable.Visible = true; idVistaNoEnable.Visible = false; } else { idVistaEnable.Visible = false; idVistaNoEnable.Visible = true; } } else { idVistaEnable.Visible = false; idVistaNoEnable.Visible = true; } }
/// <summary> /// Agrega validacion de integridad a una entidad: Supervisor /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entSupervisor">Entidad con los datos a validar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void TInt_f(DBConn p_dbcAccess, ESupervisor p_entSupervisor, StatMsg p_smResult) { }
public string SerializaNodo(ref DBConn oConn, string cPath, string cFile) { if (string.IsNullOrEmpty(cPath)) { return(string.Empty); } try { BinaryNodo oNodo = new BinaryNodo(); CmsNodos oNodos = new CmsNodos(ref oConn); oNodos.CodNodo = pCodNodo; DataTable oData = oNodos.Get(); if (oData != null) { if (oData.Rows.Count > 0) { oNodo.CodNodo = oData.Rows[0]["cod_nodo"].ToString(); oNodo.CodNodoRel = oData.Rows[0]["cod_nodo_rel"].ToString(); oNodo.CodUsuario = oData.Rows[0]["cod_usuario"].ToString(); oNodo.CodTemplate = oData.Rows[0]["cod_template"].ToString(); oNodo.TituloNodo = oData.Rows[0]["titulo_nodo"].ToString(); oNodo.TextoNodo = oData.Rows[0]["texto_nodo"].ToString(); oNodo.DateNodo = oData.Rows[0]["date_nodo"].ToString(); oNodo.EstNodo = oData.Rows[0]["est_nodo"].ToString(); oNodo.PrvNodo = oData.Rows[0]["prv_nodo"].ToString(); oNodo.IniNodo = oData.Rows[0]["ini_nodo"].ToString(); oNodo.PfNodo = oData.Rows[0]["pf_nodo"].ToString(); oNodo.TitleHeaderNodo = oData.Rows[0]["titleheader_nodo"].ToString(); oNodo.KeywordsNodo = oData.Rows[0]["keywords_nodo"].ToString(); oNodo.ContNodo = oData.Rows[0]["cont_nodo"].ToString(); oNodo.OrdNodo = oData.Rows[0]["ord_nodo"].ToString(); oNodo.IniAsocUsrNodo = oData.Rows[0]["ini_asoc_usr_nodo"].ToString(); oNodo.IndDesplUsrClient = oData.Rows[0]["ind_despl_usr_client"].ToString(); oNodo.IndOlvClaveNodo = oData.Rows[0]["ind_olvclave_nodo"].ToString(); oNodo.IndRstClaveNodo = oData.Rows[0]["ind_rstclave_nodo"].ToString(); oNodo.IndLoginNodo = oData.Rows[0]["ind_login_nodo"].ToString(); oNodo.IndDesplUsrSite = oData.Rows[0]["ind_despl_usr_site"].ToString(); oNodo.IndPoltSecureNodo = oData.Rows[0]["ind_poltsecure_nodo"].ToString(); oNodo.IndTermUseNodo = oData.Rows[0]["ind_termuse_nodo"].ToString(); oNodo.IndRegistrateNodo = oData.Rows[0]["ind_registrate_nodo"].ToString(); oNodo.IndPagExitoNodo = oData.Rows[0]["ind_pagexito_nodo"].ToString(); oNodo.IndPhotoNodo = oData.Rows[0]["ind_photo_nodo"].ToString(); oNodo.IndIniNodoPhone = oData.Rows[0]["ini_nodo_phone"].ToString(); oNodo.IndPfNodoPhone = oData.Rows[0]["pf_nodo_phone"].ToString(); oNodo.IndContNodoPhone = oData.Rows[0]["cont_nodo_phone"].ToString(); } } oData.Dispose(); oNodos = null; if (Directory.Exists(cPath) && !string.IsNullOrEmpty(cFile)) { IFormatter oBinFormat = new BinaryFormatter(); Stream oFileStream = new FileStream(cPath + cFile, FileMode.Create, FileAccess.Write); oBinFormat.Serialize(oFileStream, oNodo); oFileStream.Close(); oFileStream = null; oNodo = null; } return(string.Empty); } catch (Exception Ex) { return(Ex.Source + " - " + Ex.Message + " - " + Ex.StackTrace); } }
public SyrInfoUsuarios(ref DBConn oConn) { this.oConn = oConn; }
protected void btnAceptar_Click(object sender, EventArgs e) { OnlineServices.Method.Usuario oIsUsuario; string sMsnLogin = string.Empty; bool dExito = false; DBConn oConn = new DBConn(); if (oConn.Open()) { SysUsuario oUsuario = new SysUsuario(ref oConn); oUsuario.LoginUsuario = txtLogin.Text; oUsuario.PwdUsuario = oWeb.Crypt(txtPassword.Text); oUsuario.EstUsuario = "V"; DataTable dUsuario = oUsuario.Get(); if (dUsuario != null) { if (dUsuario != null) { if (dUsuario.Rows.Count > 0) { oIsUsuario = oWeb.GetObjUsuario(); oIsUsuario.CodUsuario = dUsuario.Rows[0]["cod_usuario"].ToString(); oIsUsuario.Tipo = dUsuario.Rows[0]["cod_tipo"].ToString(); oIsUsuario.Nombres = (dUsuario.Rows[0]["nom_usuario"].ToString() + " " + dUsuario.Rows[0]["ape_usuario"].ToString()).Trim(); oIsUsuario.Email = dUsuario.Rows[0]["eml_usuario"].ToString(); oIsUsuario.Fono = dUsuario.Rows[0]["fono_usuario"].ToString(); Session["USUARIO"] = oIsUsuario; SyrPerfilesUsuarios oPerfilesUsuarios = new SyrPerfilesUsuarios(ref oConn); oPerfilesUsuarios.CodUsuario = dUsuario.Rows[0]["cod_usuario"].ToString(); DataTable dPerfilesUsuarios = oPerfilesUsuarios.Get(); if (dPerfilesUsuarios != null) { if (dPerfilesUsuarios.Rows.Count > 0) { dExito = true; Session["Administrador"] = "1"; } else { sMsnLogin = oCulture.GetResource("LoginUsers", "MsnLoggin02"); } } dPerfilesUsuarios = null; } else { sMsnLogin = oCulture.GetResource("LoginUsers", "MsnLoggin01"); } } } dUsuario = null; oConn.Close(); } else { sMsnLogin = oCulture.GetResource("LoginUsers", "MsnLoggin03"); } if (!dExito) { StringBuilder js = new StringBuilder(); js.Append("function LgRespuesta() {"); js.Append(" window.radalert('").Append(sMsnLogin).Append("', 200, 100,'Atención'); "); js.Append(" Sys.Application.remove_load(LgRespuesta); "); js.Append("};"); js.Append("Sys.Application.add_load(LgRespuesta);"); Page.ClientScript.RegisterStartupScript(this.GetType(), "LgRespuesta", js.ToString(), true); } else { Response.Redirect("framework.aspx"); } }
/// <summary> /// Agrega o modifica un registro de la tabla: TipoCont /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entTipoCont">Entidad con los datos a procesar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void TcnSave_f(DBConn p_dbcAccess, ref ETipoCont p_entTipoCont, StatMsg p_smResult) { }
/// <summary> /// Agrega o modifica un registro de la tabla: ResEntrevista /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entResEntrevista">Entidad con los datos a procesar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void RenSave_f(DBConn p_dbcAccess, ref EResEntrevista p_entResEntrevista, StatMsg p_smResult) { }
/// <summary> /// Agrega o modifica un registro de la tabla: Rubros /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entRubro">Entidad con los datos a procesar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void RbrSave_f(DBConn p_dbcAccess, ref ERubro p_entRubro, StatMsg p_smResult) { }
/// <summary> /// Agrega validacion de integridad a una entidad: PrecioServicio /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entPrecioServicio">Entidad con los datos a validar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void PrsTInt_f(DBConn p_dbcAccess, EPrecioServicio p_entPrecioServicio, StatMsg p_smResult) { }
/// <summary> /// 消息达到后交个Biz处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void SocketHelper_MessageReviced(object sender, MessageRevicedEventArgs e) { string sendingApp = AppSettingString.SendingApp; string recvApp = AppSettingString.RecvApp; //System.Configuration.ConfigurationManager.AppSettings["recvApp"]; try { DBConn dbcon = new DBConn(); PipeParser parser = new PipeParser(); //解析出消息类型,创建对应的Biz进行处理 string message = System.Text.Encoding.UTF8.GetString(e.Contents); message = MediII.Common.MLLPHelper.TrimMLLP(message, true, false); LogHelp.WriteLog(message); //手术字典 if (message.Contains(_AcceptTitleOperDic)) { OperDicModel dic = HL7ToXmlConverter.ToOperDic(message); dbcon.InsertOperDic(dic); } if (message.Contains(_NewOperApply)) { paibanModel paiban = HL7ToXmlConverter.toDataBae(message); if (dbcon.GetPaiban(paiban, tableName).Rows.Count == 0) { dbcon.InsertPaiban(paiban, tableName); } } //修改 if (message.Contains(_UpdateOperApply)) { paibanModel paiban = HL7ToXmlConverter.toDataBae(message); if (dbcon.GetPaiban(paiban, tableName).Rows.Count == 1) { dbcon.UpdatePaibanAll(paiban, tableName); } } if (message.Contains(_CancelOperApply)) { string PatID = ""; message = message.Replace("ARQ", "\nARQ"); string[] sList = message.Split('\n'); foreach (string str in sList) { if (str.Contains("ARQ|")) { PatID = str.Split('|')[1].Replace("^", ""); } } dbcon.UpdatePaibanOstate(tableName, PatID); } //string mesStruct = parser.GetMessageStructure(message).Substring(0, 3); string ackMsg = MediII.Common.MessageHelper.SetACK("ACK", "", "", recvApp, recvApp, sendingApp, sendingApp, Guid.NewGuid().ToString("N")); LogHelp.WriteLog(ackMsg); SocketHelper.SendAck(MediII.Common.MLLPHelper.AddMLLP(ackMsg), e.SocketHandler); } catch (Exception ex) { //出现异常需要返回,避免队列堵塞 string ackMsg = MediII.Common.MessageHelper.SetACK("ACK", "", "", recvApp, recvApp, sendingApp, sendingApp, Guid.NewGuid().ToString("N"), ex.Message); LogHelp.WriteErrorLog(ackMsg); SocketHelper.SendAck(MediII.Common.MLLPHelper.AddMLLP(ackMsg), e.SocketHandler); MediII.Common.LogHelper.LogError(ex, Common.LogCatagories.AdapterBiz); } }
public List <books> GetBooks() { DBConn db = new DBConn(); return(db.dbbooks.ToList()); }
public static List <ColumnInfo> getColumnInfo(string dbConnName, string dbName, string tableName, DBConn engine) { string key = string.Format("ColumnInfo_{0}_{1}_{2}", dbConnName, dbName, tableName); object objColumnList = CodeAssistant.Cache.Get(key); if (objColumnList == null) { DataTable dt = CodeAssistant.ColAssist.getColumnInfo(dbConnName, dbName, tableName, engine); List <ColumnInfo> list = new List <ColumnInfo>(); foreach (DataRow r in dt.Rows) { ColumnInfo tb = new ColumnInfo() { ColName = r["ColumnName"].ToString() }; list.Add(tb); } if (list.Count == 0) { // 沒有資料不cache GlobalClass.debugLog("CodeAssistant", "getColumnInfo no data, key " + key); return(list); } CacheItemPolicy p = new CacheItemPolicy(); p.AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(5); GlobalClass.debugLog("CodeAssistant", "getColumnInfo set data, key " + key); CodeAssistant.Cache.Set(key, list, p); return(list); } else { return((List <ColumnInfo>)objColumnList); } }
public SysGrupos(ref DBConn oConn) { this.oConn = oConn; }
protected void insert(object sender, EventArgs e) { DBConn Database = new DBConn(); string Name = boxName.Text; int KinD = Convert.ToInt32(boxKind.Text); string Address = boxAddress.Text; string ZipCode = boxZipCode.Text; string gps = boxGPS.Text; string Phone = boxPhone.Text; string Fax = boxFax.Text; string Mail = boxMail.Text; String str = "INSERT INTO Clinics (Name,KinD,Address,ZipCode"; if (gps != "") str += ",GPS"; str += ",CityID,PhoneNumber"; if (Fax != "") str += ",FaxNumber"; if (Mail != "") str += ",Email"; str += ") VALUES (@Name,@KinD,@Address,@ZipCode"; if (gps != "") str += ",@GPS"; str += ",@CityID,@PhoneNumber"; if (Fax != "") str += ",@FaxNumber"; if (Mail != "") str += ",@Email"; str += ")"; SqlCommand cmd = new SqlCommand(str, Database.Connection); cmd.Connection.Open(); cmd.Parameters.AddWithValue("@Name",Name); cmd.Parameters.AddWithValue("@KinD", KinD); cmd.Parameters.AddWithValue("@Address",Address); cmd.Parameters.AddWithValue("@ZipCode", ZipCode); cmd.Parameters.AddWithValue("@CityID", Convert.ToInt16(ddlCities.SelectedValue)); cmd.Parameters.AddWithValue("@PhoneNumber", Phone); if (gps != "") cmd.Parameters.AddWithValue("@GPS", gps); if (Fax != "") cmd.Parameters.AddWithValue("@FaxNumber", Fax); if (Mail != "") cmd.Parameters.AddWithValue("@Email", Mail); cmd.ExecuteNonQuery(); cmd.Connection.Close(); boxName.Text= ""; boxKind.Text = ""; boxAddress.Text = ""; boxZipCode.Text = ""; boxGPS.Text = ""; boxPhone.Text = ""; boxFax.Text = ""; boxMail.Text = ""; GridView1.DataBind(); }
public cAntDocumentosPago(ref DBConn oConn) { this.oConn = oConn; }
protected void btnOK_Click(object sender, System.EventArgs e) { string strName = txtAdmin.Text; string strPassword = txtPassword.Text; string strRPassword = txtRPassword.Text; if( strName == String.Empty ) { Response.Write("<script>"); Response.Write("alert('请输入管理名!!!');"); Response.Write("</script>"); return; } if( strPassword == String.Empty ) { Response.Write("<script>"); Response.Write("alert('请输入密码!!!');"); Response.Write("</script>"); return; } if( strRPassword == String.Empty ) { Response.Write("<script>"); Response.Write("alert('请输入确认密码!!!');"); Response.Write("</script>"); return; } if( txtPassword.Text.Length < 6 ) { Response.Write("<script>"); Response.Write("alert('密码长度至少6位!!!');"); Response.Write("</script>"); return; } strPassword = FormsAuthentication.HashPasswordForStoringInConfigFile( strPassword ,"MD5"); DBConn myDB = new DBConn(); string mySql = "UPDATE [admin] SET [password]='" + strPassword + "' WHERE [username]='" + strName + "'"; int iTemp = myDB.ExecuteNonQuery( mySql ); myDB.Close(); if( iTemp != 0 ) { Response.Write("<script>"); Response.Write("alert('您的密码修改成功!!!');"); Response.Write("</script>"); } else { Response.Write("<script>"); Response.Write("alert('密码修改失败!!!');"); Response.Write("</script>"); } }
public cAptMonitorPages(ref DBConn oConn) { this.oConn = oConn; }
/// <summary> /// Agrega validacion de integridad a una entidad: MotivosLlamada /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_entMotivosLlamada">Entidad con los datos a validar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void MtlTInt_f(DBConn p_dbcAccess, EMotivosLlamada p_entMotivosLlamada, StatMsg p_smResult) { }
/// <summary> /// Borra físicamento un registro de la tabla: Supervisores /// (Código Fijo) /// </summary> /// <param name="p_dbcAccess">Conexion a la base de datos</param> /// <param name="p_strCod">Código</param> /// <param name="p_iFxdVersion">Versión del registro a borrar</param> /// <param name="p_smResult">Estado final de la operacion</param> internal static void Remove_f(DBConn p_dbcAccess, string p_strCod, int p_iFxdVersion, StatMsg p_smResult) { }
public cFactura(ref DBConn oConn) { this.oConn = oConn; }
public cProductosContrato(ref DBConn oConn) { this.oConn = oConn; }