⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 companyoperationinfo.aspx.cs

📁 合同管理 合同管理 合同管理
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace HTMS.Web.CompanySysMange.CompanyInfo
{
	/// <summary>
	/// CompanyOperationInfo 的摘要说明。
	/// </summary>
	public class CompanyOperationInfo : HTMS.Web.CompanySysMange.BasePage
	{
		protected System.Web.UI.HtmlControls.HtmlInputText title;
		protected System.Web.UI.HtmlControls.HtmlTextArea content;
		protected System.Web.UI.HtmlControls.HtmlTextArea des;
		protected System.Web.UI.HtmlControls.HtmlInputText date1;
		protected System.Web.UI.HtmlControls.HtmlInputText date2;
		protected System.Web.UI.HtmlControls.HtmlInputFile file;
		protected System.Web.UI.HtmlControls.HtmlInputButton Submit1;
		protected System.Web.UI.WebControls.DropDownList DropDownList1;
	
		private string CompanyID
		{
			get{return Convert.ToString(this.ViewState["CompanyID"]);}
			set{this.ViewState["CompanyID"]=value;}
		}

		private string CompanyName
		{
			get{return Convert.ToString(this.ViewState["CompanyName"]);}
			set{this.ViewState["CompanyName"]=value;}
		}

		private void Page_Load(object sender, System.EventArgs e)
		{
			if(!Page.IsPostBack)
			{
				if(!base.CheckUser())
				{
					return;
				}
				else
				{
					this.CompanyID=this.Session["CompanyID"].ToString();
					this.CompanyName=this.Session["CompanyName"].ToString();
				}
				this.ShowClass();
			}
		}
		private void ShowClass()
		{
			System.Data.DataTable mytable=HTMS.SQLServerDAL.DAL.DAI.RunProcTable("OperationClass_GetClassIDAndClassNameByCompanyID",this.CompanyID);
			if(mytable==null || mytable.Rows.Count<=0)
			{	
				Common.Common.ShowMessageBox("现在还没有业务类型,请先添加业务类型");
				Common.Common.RunScript("window.close();");
				return;
			}
			else
			{
				this.DropDownList1.DataTextField="OperationName";
				this.DropDownList1.DataValueField="OperationClassID";
				this.DropDownList1.DataSource=mytable;
				this.DropDownList1.DataBind();	
				this.DropDownList1.Items.Insert(0,new System.Web.UI.WebControls.ListItem("未选择","-1"));
			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Submit1.ServerClick += new System.EventHandler(this.Submit1_ServerClick);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void Submit1_ServerClick(object sender, System.EventArgs e)
		{
			HTMS.Model.CompanyOperation tempinfo=new HTMS.Model.CompanyOperation();			 
			HTMS.BLL.CompanyOperation temp=new HTMS.BLL.CompanyOperation();
			tempinfo.OperationID=Common.GetNextId.getNextID("CompanyOperation","OperationID");
			tempinfo.OperationTitle=this.title.Value;
			tempinfo.OperationContent=this.content.Value;
			tempinfo.OperationDes=this.des.Value;
			tempinfo.OperationDate=System.DateTime.Now;
			tempinfo.OperationEndTime=DateTime.Parse(this.date2.Value);
			tempinfo.OperationStartTime=DateTime.Parse(this.date1.Value);
			//string filename="Common.Common.UpLoad(this.Server.MapPath("../../Data/Files/"));"
			string filename="";
			Common.Common.ShowMessageBox(filename);
            tempinfo.OperationFilePath=filename;
			tempinfo.OperationClassID=this.DropDownList1.SelectedValue;
			tempinfo.CompanyID=this.CompanyID;
			tempinfo.CompanyName=this.CompanyName;
			tempinfo.OperationLinkman="";
			tempinfo.OperationTel="";
			tempinfo.OperationPicPath="";
			tempinfo.Param="1";
			this.showMessage(temp.Add(tempinfo));
		}
		private void showMessage(int count)
		{
			if(count<=0)
			{
				Common.Common.ShowMessageBox("操作失败");				
			}
			else
			{
				Common.Common.ShowMessageBox("操作成功");
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -