protected void cmdAttach_Click(object sender, System.EventArgs e) { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); //string strFileName = ""; //string strFName = ""; //不带路径的文件名 //string strAttachXml = ""; string UserGuid = (string)Session["UserGuid"]; string DisplayName = Session["DisplayName"].ToString(); if (dgAttachment.Items.Count >= MaxAttachCount && MaxAttachCount > 0) { trAdd.Visible = false; trRemark.Visible = false; Response.Write("<script language=javascript>alert('最多可上传" + MaxAttachCount + "个附件!');</script>"); return; } if (File1.PostedFile != null) { HttpPostedFile upFileName = File1.PostedFile; if (upFileName.ContentLength > 0) { string[] filesplit = upFileName.FileName.Split('\\');//分析文件名称 string fileName = filesplit[filesplit.Length - 1]; byte[] fileContent = new byte[upFileName.ContentLength]; upFileName.InputStream.Read(fileContent, 0, upFileName.ContentLength); string strAttachGuid = Guid.NewGuid().ToString(); string DocumentType = fileName.Substring(fileName.LastIndexOf('.'), fileName.Length - fileName.LastIndexOf('.')); StorgCom.Insert(strAttachGuid, fileName, upFileName.ContentType, DocumentType, Convert.ToString(ViewState[this.ID + "ClientTag"]), ViewState[this.ID + "ClientGuid"].ToString(), drpAttachType.SelectedValue, upFileName.ContentLength, fileContent); upFileName.InputStream.Close(); this.BindAttach(); txtFile.Value = string.Empty; //string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", MisRowGuid, DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59"); //Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //如果是社保证明,就同步更新下 if (this.ID == "SBZM") { string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", ViewState[this.ID + "ClientGuid"].ToString().Replace("SBZM", ""), DateTime.Now.AddMonths(6).ToString("yyyy-MM-dd") + " 23:59:59"); Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); } UpdateStatus(this.ID, ViewState[this.ID + "ClientGuid"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { JpdGroup.DataSource = BoxMana.BoxGroupSelectAll(); JpdGroup.DataTextField = "BoxGroupName"; JpdGroup.DataValueField = "BoxGroupID"; JpdGroup.DataBind(); JpdGroup.Items.Insert(0, new ListItem("请选择所属组别", "未分配组别")); if (Request.QueryString["BoxGuid"] != "" && Request.QueryString["BoxGuid"] != null) { this.CurrentPosition = "信箱修改"; this.Title = "信箱修改"; btnAddClose.Text = "保存修改"; btnCancel.Text = "取消修改"; btnAdd.Visible = false; Detail_RG_ConsultBox BoxDetial = BoxMana.GetDetail(Request.QueryString["BoxGuid"]); txtTitle.Text = BoxDetial.BoxName; txtDesc.Text = BoxDetial.Description; txtOrderNum.Text = BoxDetial.OrderNum.ToString(); Check_Audit.Checked = (BoxDetial.NeedAudit == 1 ? true : false); try { JpdGroup.Items.FindByValue(BoxDetial.BoxGroupID).Selected = true; } catch { } DataView dvup; if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("ConsultMainSite").ConfigValue == "1") { dvup = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom().Select(Request.QueryString["BoxGuid"]); } else { dvup = StorgCom.Select(Request.QueryString["BoxGuid"]); } if (dvup.Count > 0) { spanimg.InnerHtml = "<a target=\"_blank\" href='ReadAttachFile.aspx?AttachID=" + dvup[0]["AttachID"] + "'> <font color=\"red\">" + dvup[0]["filename"] + "</font></a>"; } } else { this.CurrentPosition = "信箱添加"; } } }
protected void dgAttachment_ItemCommand(object source, DataGridCommandEventArgs e) { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string AttachGuid = dgAttachment.DataKeys[e.Item.ItemIndex].ToString(); StorgCom.Delete_Attach(AttachGuid); if (this.ID == "QY_SBZM") { string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", ViewState[this.ID + "ClientGuid"].ToString().Replace("QY_SBZM", ""), DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"); Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); } UpdateStatus(this.ID, ViewState[this.ID + "ClientGuid"].ToString()); this.BindAttach(); }
private void BindAttach() { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Convert.ToString(ViewState[this.ID + "ClientGuid"]); if (CliGuid == "") { CliGuid = Guid.NewGuid().ToString(); } //DataView dvAttch = StorgCom.Select(Convert.ToString(ViewState[this.ID + "ClientGuid"])); DataView dvAttch = StorgCom.Select(CliGuid); dgAttachment.DataSource = dvAttch; dgAttachment.DataBind(); //超过附件个数,禁止上传 if (dvAttch.Count >= MaxAttachCount && MaxAttachCount > 0) { trAdd.Visible = false; trRemark.Visible = false; } else { trAdd.Visible = true; trRemark.Visible = true; } if (dvAttch.Count == 0 && this.ReadOnly) { //tabMain.Visible = false; dgAttachment.Visible = false; labMsg.Text = "无附件"; labMsg.Visible = true; } else { if (this.ReadOnly) { trAdd.Visible = false; trRemark.Visible = false; } labMsg.Visible = false; } }
public void AddAttach(string InfoID) { HttpFileCollection files = HttpContext.Current.Request.Files; HttpPostedFile upFileName; //循环插入记录 for (int i = 0; i < files.Count; i++) { upFileName = files[i]; if (upFileName.ContentLength > 0) { string[] filesplit = upFileName.FileName.Split('\\');//分析文件名称 string filename = filesplit[filesplit.Length - 1]; string contentType = files[i].ContentType; string length = files[i].ContentLength.ToString(); byte[] fileContent = new byte[upFileName.ContentLength]; upFileName.InputStream.Read(fileContent, 0, upFileName.ContentLength); Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom MainDBUpfiles = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); //添加附件信息 //string newguid = Guid.NewGuid().ToString(); MainDBUpfiles.Delete(InfoID); MainDBUpfiles.Insert( Guid.NewGuid().ToString(), filename, contentType, "", "RG_Consult", InfoID, "", Convert.ToInt32(length), fileContent ); upFileName.InputStream.Close(); } } }
public void AddAttach(string InfoID) { HttpFileCollection files = HttpContext.Current.Request.Files; HttpPostedFile upFileName; //ѭ�������¼ for (int i = 0; i < files.Count; i++) { upFileName = files[i]; if (upFileName.ContentLength > 0) { string[] filesplit = upFileName.FileName.Split('\\');//�����ļ����� string filename = filesplit[filesplit.Length - 1]; string contentType = files[i].ContentType; string length = files[i].ContentLength.ToString(); byte[] fileContent = new byte[upFileName.ContentLength]; upFileName.InputStream.Read(fileContent, 0, upFileName.ContentLength); Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom MainDBUpfiles = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); //��Ӹ�����Ϣ //string newguid = Guid.NewGuid().ToString(); MainDBUpfiles.Delete(InfoID); MainDBUpfiles.Insert( Guid.NewGuid().ToString(), filename, contentType, "", "RG_Consult", InfoID, "", Convert.ToInt32(length), fileContent ); upFileName.InputStream.Close(); } } }
protected void Page_Load(object sender, System.EventArgs e) { WatermarkImageUrl = Request.ApplicationPath + "/HTProject/Pages/Images/合同备案水印.jpg"; WatermarkText = new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("AppDeptName").ConfigValue; Response.Clear(); //string ProcessType = Request.QueryString["ProcessType"]; string FlipType = Request.QueryString["FlipType"]; //通过人员的Guid,获取个人签名的AttachGuid Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RYGuid"] + "RY_GRQM"; DataView dvAttch = StorgCom.Select(CliGuid); dvAttch.Sort = " Row_ID DESC "; string AttachGuid = ""; if (dvAttch.Count > 0) { AttachGuid = dvAttch[0]["AttachGuid"].ToString(); } else { //如果没有签名,就加载个默认的提示 Response.Redirect(Request.ApplicationPath + "/HTProject/Pages/Images/WQM.gif");//////////////////////////////////////////////// return; } //string AttachGuid = Request.QueryString["AttachGuid"]; string Attach_ConnectionStringName = Request.QueryString["ConnName"]; string Attach_ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["EpointMis_ConnectionString"].ConnectionString; if (Attach_ConnectionStringName != null && Attach_ConnectionStringName != "") { string strCon = new HTProject_Bizlogic.AttachManage.DB_Frame_Attach().GetAttach_ConnectionString(Attach_ConnectionStringName); if (strCon != "") { Attach_ConnectionString = strCon; } } Epoint.MisBizLogic2.Data.CommonDataRow oRow = new Epoint.MisBizLogic2.Data.CommonDataRow("Frame_AttachStorage", "AttachGuid", AttachGuid, Attach_ConnectionString); string fileName = ""; #region 如果采用生成文件的方式,会在服务器的Web程序目录下面创建临时文件, if (oRow.R_HasFilled && !Convert.IsDBNull(oRow["Content"])) { if (oRow["AttachFileName"] != null) { fileName = oRow["AttachFileName"].ToString(); } else { fileName = Guid.NewGuid().ToString(); } //替换开始 FileStream objFileStream; BinaryWriter objBinaryWriter; string attPath = Request.ApplicationPath + "/AttachStorage/"; if (!Directory.Exists(Server.MapPath(attPath + "/" + AttachGuid))) { Directory.CreateDirectory(Server.MapPath(attPath + "/" + AttachGuid)); } string strFullFilePath = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileName); //二进制文件写必须用binaryWrite,不需要制定encoding方式 if (!File.Exists(strFullFilePath)) { objFileStream = new FileStream(strFullFilePath, FileMode.OpenOrCreate, FileAccess.Write); objBinaryWriter = new BinaryWriter(objFileStream); objBinaryWriter.Write((byte[])oRow["Content"]); objBinaryWriter.Close(); objFileStream.Close(); } #region 图片翻转 //翻转后的文件名 string fileNameR = ""; int site = fileName.IndexOf('.'); fileNameR = fileName.Substring(0, site) + "_R" + fileName.Substring(site, fileName.Length - site); string strFullFilePathR = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileNameR); Bitmap image = new Bitmap(strFullFilePath); if (FlipType == "0") { image.RotateFlip(RotateFlipType.RotateNoneFlipNone); } else if (FlipType == "1") { image.RotateFlip(RotateFlipType.Rotate90FlipNone); } else if (FlipType == "2") { image.RotateFlip(RotateFlipType.Rotate180FlipNone); } else if (FlipType == "3") { image.RotateFlip(RotateFlipType.Rotate270FlipNone); } else { image.RotateFlip(RotateFlipType.RotateNoneFlipNone); } image.Save(strFullFilePathR); objFileStream = new FileStream(strFullFilePathR, FileMode.OpenOrCreate, FileAccess.Read); BinaryReader br = new BinaryReader(objFileStream); byte[] imagebytes = br.ReadBytes(Convert.ToInt32(objFileStream.Length)); objFileStream.Close(); image.Dispose(); ////翻转后存入数据库 //if (ProcessType.Equals("Save")) //{ // //保存到数据库 // new ZLJDMis.BizLogic.AttachManage.DB_Frame_Attach().UpdateAttachContent(AttachGuid, imagebytes); // //修改默认生成的图片 // File.Delete(strFullFilePath); // strFullFilePath = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileName); // Bitmap imageDB = new Bitmap(strFullFilePathR); // imageDB.Save(strFullFilePath); // imageDB.Dispose(); //} #endregion MakeThumbnail_And_AddWaterMark(strFullFilePathR); Response.Redirect(attPath + "/" + AttachGuid + "/" + fileNameR); } #endregion }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { JpdGroup.DataSource = BoxMana.BoxGroupSelectAll(); JpdGroup.DataTextField = "BoxGroupName"; JpdGroup.DataValueField = "BoxGroupID"; JpdGroup.DataBind(); JpdGroup.Items.Insert(0, new ListItem("��ѡ���������", "δ�������")); if (Request.QueryString["BoxGuid"] != "" && Request.QueryString["BoxGuid"] != null) { this.CurrentPosition = "������"; this.Title = "������"; btnAddClose.Text = "������"; btnCancel.Text = "ȡ����"; btnAdd.Visible = false; Detail_RG_ConsultBox BoxDetial = BoxMana.GetDetail(Request.QueryString["BoxGuid"]); txtTitle.Text = BoxDetial.BoxName; txtDesc.Text = BoxDetial.Description; txtOrderNum.Text = BoxDetial.OrderNum.ToString(); Check_Audit.Checked = (BoxDetial.NeedAudit == 1 ? true : false); try { JpdGroup.Items.FindByValue(BoxDetial.BoxGroupID).Selected = true; } catch { } DataView dvup; if (new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("ConsultMainSite").ConfigValue == "1") { dvup = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom().Select(Request.QueryString["BoxGuid"]); } else { dvup = StorgCom.Select(Request.QueryString["BoxGuid"]); } if (dvup.Count > 0) spanimg.InnerHtml = "<a target=\"_blank\" href='ReadAttachFile.aspx?AttachID=" + dvup[0]["AttachID"] + "'> <font color=\"red\">" + dvup[0]["filename"] + "</font></a>"; } else { this.CurrentPosition = "�������"; } } }
protected void btnSub_Click(object sender, System.EventArgs e) { string strSql = "SELECT Status FROM RG_OUInfo WHERE RowGuid='" + Request["DWGuid"] + "'"; if (Epoint.MisBizLogic2.DB.ExecuteToString(strSql) != "90") { WriteAjaxMessage("alert('企业信息还未审核通过,不能维护备案信息');window.close();"); return; } string message = ""; if (this.LoginID != "lift")//lift //13328457-X { //增加对人员的限制 message = RG_DW.ChenkZYRY(Request["RowGuid"], DWGuid_2021.Text, ZiZhiDJCode_2021.Text); if (message != "")//说明有些必须配置人专业没有配置人 { WriteAjaxMessage("alert('" + message + "');"); return; } //项目负责人 message = RG_DW.CheckXMFuZeRen(Request["RowGuid"]); if (message != "")//项目负责人有且只有一个人 { WriteAjaxMessage("alert('" + message + "');"); return; } //专业负责人 message = RG_DW.ChenkZYFuZeRen(Request["RowGuid"], DWGuid_2021.Text, ZiZhiDJCode_2021.Text); if (message != "")//专业负责人不满足要求 { WriteAjaxMessage("alert('" + message + "');"); return; } //看看有没有备案表,没有备案表就不能提交 Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RowGuid"] + "XM_HTBA"; DataView dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('请上传项目备案表');"); return; } CliGuid = Request["RowGuid"] + "XM_SJHT"; dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('请上传合同');"); return; } } //发送待审核事宜,根据角色来 //还要看是不是属于宜兴、江阴的项目,如果是,就重新获取 //Status_2021.SelectedValue = "70";//这个地方要注意,如果是江阴、宜兴的项目,要先到江阴、宜兴审核,然后再到市总办审核 DataView dv = DBF.GetUserByRoleName("备案信息初审"); if (XMAdd_2021.SelectedValue == "320282")//宜兴 { dv = DBF.GetUserByRoleName("宜兴备案信息审核"); Status_2021.SelectedValue = "69"; } else if (XMAdd_2021.SelectedValue == "320281")//江阴 { dv = DBF.GetUserByRoleName("江阴备案信息审核"); Status_2021.SelectedValue = "69"; } else { Status_2021.SelectedValue = "70"; } TJRGuid_2021.Text = this.UserGuid; TJDate_2021.Text = DateTime.Now.ToString("yyyy-MM-dd"); oEditPage.SaveTableValues(Request["RowGuid"], tdContainer); for (int m = 0; m < dv.Count; m++) { string messageGuid = Guid.NewGuid().ToString(); new HTProject_Bizlogic.DB_Messages_Center().WaitHandle_Insert(messageGuid, XMName_2021.Text + "备案初审", "", dv[m]["UserGuid"].ToString(), dv[m]["DisplayName"].ToString(), "", "", "", @"HTProject/Pages/RG_XMBeiAn/RG_XMBeiAnAD_Detail.aspx?RowGuid=" + Request["RowGuid"], "", "", 1, "", "", "" ); //更新标志位 strSql = "update messages_center set PType='备案信息审核',PGuid='" + Request["RowGuid"] + "' where MessageItemGuid='" + messageGuid + "'"; Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //添加短信 string IsSendADSMS = ApplicationOperate.GetConfigValueByName("IsSendADSMS"); if (IsSendADSMS == "1") { if (dv[m]["Mobile"].ToString() != "") { HTSMS.SendSMS(this.DisplayName, dv[m]["DisplayName"], XMName_2021.Text + "提交备案信息审核", dv[m]["Mobile"]); } } } AlertAjaxMessage("提交成功"); this.WriteAjaxMessage("refreshParent();window.close();"); }
protected void btnSubmit_Click(object sender, System.EventArgs e) { //�ж������֤s�Ƿ��Ѿ����� string oName = ""; if (RG_DW.IsExistByIDNO(IDNum_2019.Text.Trim(), out oName, Request["RowGuid"])) { this.WriteAjaxMessage("alert('�����֤�Ѿ����ڣ�����Ϊ��" + oName + "');"); return; } //��ע���� if (YinZhangNo_2019.Text.Trim() != "") { if (ZCZ_YXQ_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('����дע����1��Ч��');"); return; } } else { ZCZ_YXQ_2019.Text = ""; } if (YinZhangNo1_2019.Text.Trim() != "") { if (ZCZ_YXQ1_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('����дע����2��Ч��');"); return; } } else { ZCZ_YXQ1_2019.Text = ""; } if (YinZhangNo2_2019.Text.Trim() != "") { if (ZCZ_YXQ2_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('����дע����3��Ч��');"); return; } } else { ZCZ_YXQ2_2019.Text = ""; } //������û���ϴ�����ǩ�� Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RowGuid"] + "RY_GRQM"; DataView dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('���ϴ�����ǩ��');"); return; } //�Ƚ�ԭ����ɾ������ֹ�ظ� new HTProject_Bizlogic.DB_Messages_Center().DeleteWH("��Ա��Ϣ���", Request["RowGuid"]); ZhuanYeCS_2019.Text = RegionTreeView.Text; ZhuanYeCSCode_2019.Text = RegionTreeView.Value; TJRGuid_2019.Text = this.UserGuid; Status_2019.SelectedValue = "70"; TJ_Date_2019.Text = DateTime.Now.ToString("yyyy-MM-dd"); oEditPage.SaveTableValues(Request["RowGuid"], tdContainer); //if (ApplicationOperate.GetConfigValueByName("IsHoldCurPage", "0") == "1") // this.WriteAjaxMessage("refreshParentHoldCurPage();"); //else // this.WriteAjaxMessage("refreshParent();"); //this.WriteAjaxMessage("EP_ShowMessageDiv(" + tdContainer.ClientID + ",'���ݱ���ɹ�')"); //���ʹ�������ˣ����ݽ�ɫ�� DataView dv = DBF.GetUserByRoleName("��Ա��Ϣ���"); for (int m = 0; m < dv.Count; m++) { string messageGuid = Guid.NewGuid().ToString(); new HTProject_Bizlogic.DB_Messages_Center().WaitHandle_Insert(messageGuid, XM_2019.Text + "[" + lblDWName.Text + "]��Ϣ���", "", dv[m]["UserGuid"].ToString(), dv[m]["DisplayName"].ToString(), "", "", "", @"HTProject/Pages/RG_QYUser/RG_QYUser_Detail.aspx?stype=shenhe&RowGuid=" + Request["RowGuid"], "", "", 1, "", "", "" ); //���±�־λ string strSql = "update messages_center set PType='��Ա��Ϣ���',PGuid='" + Request["RowGuid"] + "' where MessageItemGuid='" + messageGuid + "'"; Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //��Ӷ��� string IsSendADSMS = ApplicationOperate.GetConfigValueByName("IsSendADSMS"); if (IsSendADSMS == "1") { if (dv[m]["Mobile"].ToString() != "") { HTSMS.SendSMS(this.DisplayName, dv[m]["DisplayName"], lblDWName.Text + "�ύ��Ա��Ϣ���", dv[m]["Mobile"]); } } } AlertAjaxMessage("�ύ�ɹ�"); }
protected void Page_Load(object sender, System.EventArgs e) { WatermarkImageUrl = Request.ApplicationPath + "/HTProject/Pages/Images/��ͬ����ˮӡ.jpg"; WatermarkText = new Epoint.Frame.Bizlogic.Frame_Config().GetDetail("AppDeptName").ConfigValue; Response.Clear(); //string ProcessType = Request.QueryString["ProcessType"]; string FlipType = Request.QueryString["FlipType"]; //ͨ����Ա��Guid����ȡ����ǩ����AttachGuid Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RYGuid"] + "RY_GRQM"; DataView dvAttch = StorgCom.Select(CliGuid); dvAttch.Sort = " Row_ID DESC "; string AttachGuid = ""; if (dvAttch.Count > 0) { AttachGuid = dvAttch[0]["AttachGuid"].ToString(); } else { //���û��ǩ�����ͼ��ظ�Ĭ�ϵ���ʾ Response.Redirect(Request.ApplicationPath + "/HTProject/Pages/Images/WQM.gif");//////////////////////////////////////////////// return; } //string AttachGuid = Request.QueryString["AttachGuid"]; string Attach_ConnectionStringName = Request.QueryString["ConnName"]; string Attach_ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["EpointMis_ConnectionString"].ConnectionString; if (Attach_ConnectionStringName != null && Attach_ConnectionStringName != "") { string strCon = new HTProject_Bizlogic.AttachManage.DB_Frame_Attach().GetAttach_ConnectionString(Attach_ConnectionStringName); if (strCon != "") { Attach_ConnectionString = strCon; } } Epoint.MisBizLogic2.Data.CommonDataRow oRow = new Epoint.MisBizLogic2.Data.CommonDataRow("Frame_AttachStorage", "AttachGuid", AttachGuid, Attach_ConnectionString); string fileName = ""; #region ������������ļ��ķ�ʽ�����ڷ�������Web����Ŀ¼���洴����ʱ�ļ��� if (oRow.R_HasFilled && !Convert.IsDBNull(oRow["Content"])) { if (oRow["AttachFileName"] != null) { fileName = oRow["AttachFileName"].ToString(); } else { fileName = Guid.NewGuid().ToString(); } //�滻��ʼ FileStream objFileStream; BinaryWriter objBinaryWriter; string attPath = Request.ApplicationPath + "/AttachStorage/"; if (!Directory.Exists(Server.MapPath(attPath + "/" + AttachGuid))) { Directory.CreateDirectory(Server.MapPath(attPath + "/" + AttachGuid)); } string strFullFilePath = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileName); //�������ļ�д������binaryWrite,����Ҫ�ƶ�encoding��ʽ if (!File.Exists(strFullFilePath)) { objFileStream = new FileStream(strFullFilePath, FileMode.OpenOrCreate, FileAccess.Write); objBinaryWriter = new BinaryWriter(objFileStream); objBinaryWriter.Write((byte[])oRow["Content"]); objBinaryWriter.Close(); objFileStream.Close(); } #region ͼƬ��ת //��ת����ļ��� string fileNameR = ""; int site = fileName.IndexOf('.'); fileNameR = fileName.Substring(0, site) + "_R" + fileName.Substring(site, fileName.Length - site); string strFullFilePathR = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileNameR); Bitmap image = new Bitmap(strFullFilePath); if (FlipType == "0") { image.RotateFlip(RotateFlipType.RotateNoneFlipNone); } else if (FlipType == "1") { image.RotateFlip(RotateFlipType.Rotate90FlipNone); } else if (FlipType == "2") { image.RotateFlip(RotateFlipType.Rotate180FlipNone); } else if (FlipType == "3") { image.RotateFlip(RotateFlipType.Rotate270FlipNone); } else { image.RotateFlip(RotateFlipType.RotateNoneFlipNone); } image.Save(strFullFilePathR); objFileStream = new FileStream(strFullFilePathR, FileMode.OpenOrCreate, FileAccess.Read); BinaryReader br = new BinaryReader(objFileStream); byte[] imagebytes = br.ReadBytes(Convert.ToInt32(objFileStream.Length)); objFileStream.Close(); image.Dispose(); ////��ת��������ݿ� //if (ProcessType.Equals("Save")) //{ // //���浽���ݿ� // new ZLJDMis.BizLogic.AttachManage.DB_Frame_Attach().UpdateAttachContent(AttachGuid, imagebytes); // //��Ĭ�����ɵ�ͼƬ // File.Delete(strFullFilePath); // strFullFilePath = Server.MapPath(attPath + "/" + AttachGuid + "/" + fileName); // Bitmap imageDB = new Bitmap(strFullFilePathR); // imageDB.Save(strFullFilePath); // imageDB.Dispose(); //} #endregion MakeThumbnail_And_AddWaterMark(strFullFilePathR); Response.Redirect(attPath + "/" + AttachGuid + "/" + fileNameR); } #endregion }
private void BindAttach() { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Convert.ToString(ViewState[this.ID + "ClientGuid"]); if (CliGuid == "") { CliGuid = Guid.NewGuid().ToString(); } //DataView dvAttch = StorgCom.Select(Convert.ToString(ViewState[this.ID + "ClientGuid"])); DataView dvAttch = StorgCom.Select(CliGuid); dgAttachment.DataSource = dvAttch; dgAttachment.DataBind(); //����������������ֹ�ϴ� if (dvAttch.Count >= MaxAttachCount && MaxAttachCount>0) { trAdd.Visible = false; trRemark.Visible = false; } else { trAdd.Visible = true; trRemark.Visible = true; } if (dvAttch.Count == 0 && this.ReadOnly) { //tabMain.Visible = false; dgAttachment.Visible = false; labMsg.Text = "����"; labMsg.Visible = true; } else { if (this.ReadOnly) { trAdd.Visible = false; trRemark.Visible = false; } labMsg.Visible = false; } }
protected void dgAttachment_ItemCommand(object source, DataGridCommandEventArgs e) { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string AttachGuid =dgAttachment.DataKeys[e.Item.ItemIndex].ToString() ; StorgCom.Delete_Attach(AttachGuid); if (this.ID == "SBZM") { string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", ViewState[this.ID + "ClientGuid"].ToString().Replace("SBZM", ""), DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00"); Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); } UpdateStatus(this.ID, ViewState[this.ID + "ClientGuid"].ToString()); this.BindAttach(); }
protected void cmdAttach_Click(object sender, System.EventArgs e) { Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); //string strFileName = ""; //string strFName = ""; //����·�����ļ��� //string strAttachXml = ""; string UserGuid = (string)Session["UserGuid"]; string DisplayName = Session["DisplayName"].ToString(); if (dgAttachment.Items.Count >= MaxAttachCount && MaxAttachCount>0) { trAdd.Visible = false; trRemark.Visible = false; Response.Write("<script language=javascript>alert('�����ϴ�" + MaxAttachCount + "��������');</script>"); return; } if (File1.PostedFile != null) { HttpPostedFile upFileName = File1.PostedFile; if (upFileName.ContentLength > 0) { string[] filesplit = upFileName.FileName.Split('\\');//�����ļ����� string fileName = filesplit[filesplit.Length - 1]; byte[] fileContent = new byte[upFileName.ContentLength]; upFileName.InputStream.Read(fileContent, 0, upFileName.ContentLength); string strAttachGuid = Guid.NewGuid().ToString(); string DocumentType = fileName.Substring(fileName.LastIndexOf('.'), fileName.Length - fileName.LastIndexOf('.')); StorgCom.Insert(strAttachGuid, fileName, upFileName.ContentType, DocumentType, Convert.ToString(ViewState[this.ID + "ClientTag"]), ViewState[this.ID + "ClientGuid"].ToString(), drpAttachType.SelectedValue, upFileName.ContentLength, fileContent); upFileName.InputStream.Close(); this.BindAttach(); txtFile.Value = string.Empty; //string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", MisRowGuid, DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59"); //Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //������籣֤������ͬ�������� if (this.ID == "SBZM") { string strSql = string.Format("update rg_ouinfo set SMJZSJ='{1}' where RowGuid='{0}' ", ViewState[this.ID + "ClientGuid"].ToString().Replace("SBZM", ""), DateTime.Now.AddMonths(6).ToString("yyyy-MM-dd") + " 23:59:59"); Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); } UpdateStatus(this.ID, ViewState[this.ID + "ClientGuid"].ToString()); } } }
protected void btnSub_Click(object sender, System.EventArgs e) { string strSql = "SELECT Status FROM RG_OUInfo WHERE RowGuid='" + Request["DWGuid"] + "'"; if (Epoint.MisBizLogic2.DB.ExecuteToString(strSql) != "90") { WriteAjaxMessage("alert('��ҵ��Ϣ��δ���ͨ��������ά��������Ϣ');window.close();"); return; } string message = ""; if (this.LoginID != "lift")//lift //13328457-X { //���Ӷ���Ա������ message = RG_DW.ChenkZYRY(Request["RowGuid"], DWGuid_2021.Text, ZiZhiDJCode_2021.Text); if (message != "")//˵����Щ����������רҵû�������� { WriteAjaxMessage("alert('" + message + "');"); return; } //��Ŀ������ message = RG_DW.CheckXMFuZeRen(Request["RowGuid"]); if (message != "")//��Ŀ����������ֻ��һ���� { WriteAjaxMessage("alert('" + message + "');"); return; } //רҵ������ message = RG_DW.ChenkZYFuZeRen(Request["RowGuid"], DWGuid_2021.Text, ZiZhiDJCode_2021.Text); if (message != "")//רҵ�����˲�����Ҫ�� { WriteAjaxMessage("alert('" + message + "');"); return; } //������û�б������û�б�����Ͳ����ύ Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RowGuid"] + "XM_HTBA"; DataView dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('���ϴ���Ŀ������');"); return; } CliGuid = Request["RowGuid"] + "XM_SJHT"; dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('���ϴ���ͬ');"); return; } } //���ʹ�������ˣ����ݽ�ɫ�� //��Ҫ���Dz����������ˡ���������Ŀ������ǣ������»�ȡ //Status_2021.SelectedValue = "70";//����ط�Ҫע�⣬����ǽ��������˵���Ŀ��Ҫ�ȵ�������������ˣ�Ȼ���ٵ����ܰ���� DataView dv = DBF.GetUserByRoleName("������Ϣ����"); if (XMAdd_2021.SelectedValue == "320282")//���� { dv = DBF.GetUserByRoleName("���˱�����Ϣ���"); Status_2021.SelectedValue = "69"; } else if (XMAdd_2021.SelectedValue == "320281")//���� { dv = DBF.GetUserByRoleName("����������Ϣ���"); Status_2021.SelectedValue = "69"; } else { Status_2021.SelectedValue = "70"; } TJRGuid_2021.Text = this.UserGuid; TJDate_2021.Text = DateTime.Now.ToString("yyyy-MM-dd"); oEditPage.SaveTableValues(Request["RowGuid"], tdContainer); for (int m = 0; m < dv.Count; m++) { string messageGuid = Guid.NewGuid().ToString(); new HTProject_Bizlogic.DB_Messages_Center().WaitHandle_Insert(messageGuid, XMName_2021.Text + "��������", "", dv[m]["UserGuid"].ToString(), dv[m]["DisplayName"].ToString(), "", "", "", @"HTProject/Pages/RG_XMBeiAn/RG_XMBeiAnAD_Detail.aspx?RowGuid=" + Request["RowGuid"], "", "", 1, "", "", "" ); //���±�־λ strSql = "update messages_center set PType='������Ϣ���',PGuid='" + Request["RowGuid"] + "' where MessageItemGuid='" + messageGuid + "'"; Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //��Ӷ��� string IsSendADSMS = ApplicationOperate.GetConfigValueByName("IsSendADSMS"); if (IsSendADSMS == "1") { if (dv[m]["Mobile"].ToString() != "") { HTSMS.SendSMS(this.DisplayName, dv[m]["DisplayName"], XMName_2021.Text + "�ύ������Ϣ���", dv[m]["Mobile"]); } } } AlertAjaxMessage("�ύ�ɹ�"); this.WriteAjaxMessage("refreshParent();window.close();"); }
protected void btnSubmit_Click(object sender, System.EventArgs e) { //判断下身份证s是否已经有了 string oName = ""; if (RG_DW.IsExistByIDNO(IDNum_2019.Text.Trim(), out oName, Request["RowGuid"])) { this.WriteAjaxMessage("alert('该身份证已经存在,姓名为:" + oName + "');"); return; } //看注册章 if (YinZhangNo_2019.Text.Trim() != "") { if (ZCZ_YXQ_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('请填写注册章1有效期');"); return; } } else { ZCZ_YXQ_2019.Text = ""; } if (YinZhangNo1_2019.Text.Trim() != "") { if (ZCZ_YXQ1_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('请填写注册章2有效期');"); return; } } else { ZCZ_YXQ1_2019.Text = ""; } if (YinZhangNo2_2019.Text.Trim() != "") { if (ZCZ_YXQ2_2019.Text == "") { //ZCZ_YXQ_2019.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM-dd"); this.WriteAjaxMessage("alert('请填写注册章3有效期');"); return; } } else { ZCZ_YXQ2_2019.Text = ""; } //看看有没有上传个人签名 Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom StorgCom = new Epoint.Frame.Bizlogic.AttachStorageInfo.StorageCom(); string CliGuid = Request["RowGuid"] + "RY_GRQM"; DataView dvAttch = StorgCom.Select(CliGuid); if (dvAttch.Count == 0) { this.WriteAjaxMessage("alert('请上传个人签名');"); return; } //先将原来的删除,防止重复 new HTProject_Bizlogic.DB_Messages_Center().DeleteWH("人员信息审核", Request["RowGuid"]); ZhuanYeCS_2019.Text = RegionTreeView.Text; ZhuanYeCSCode_2019.Text = RegionTreeView.Value; TJRGuid_2019.Text = this.UserGuid; Status_2019.SelectedValue = "70"; TJ_Date_2019.Text = DateTime.Now.ToString("yyyy-MM-dd"); oEditPage.SaveTableValues(Request["RowGuid"], tdContainer); //if (ApplicationOperate.GetConfigValueByName("IsHoldCurPage", "0") == "1") // this.WriteAjaxMessage("refreshParentHoldCurPage();"); //else // this.WriteAjaxMessage("refreshParent();"); //this.WriteAjaxMessage("EP_ShowMessageDiv(" + tdContainer.ClientID + ",'数据保存成功')"); //发送待审核事宜,根据角色来 DataView dv = DBF.GetUserByRoleName("人员信息审核"); for (int m = 0; m < dv.Count; m++) { string messageGuid = Guid.NewGuid().ToString(); new HTProject_Bizlogic.DB_Messages_Center().WaitHandle_Insert(messageGuid, XM_2019.Text + "[" + lblDWName.Text + "]信息审核", "", dv[m]["UserGuid"].ToString(), dv[m]["DisplayName"].ToString(), "", "", "", @"HTProject/Pages/RG_QYUser/RG_QYUser_Detail.aspx?stype=shenhe&RowGuid=" + Request["RowGuid"], "", "", 1, "", "", "" ); //更新标志位 string strSql = "update messages_center set PType='人员信息审核',PGuid='" + Request["RowGuid"] + "' where MessageItemGuid='" + messageGuid + "'"; Epoint.MisBizLogic2.DB.ExecuteNonQuery(strSql); //添加短信 string IsSendADSMS = ApplicationOperate.GetConfigValueByName("IsSendADSMS"); if (IsSendADSMS == "1") { if (dv[m]["Mobile"].ToString() != "") { HTSMS.SendSMS(this.DisplayName, dv[m]["DisplayName"], lblDWName.Text + "提交人员信息审核", dv[m]["Mobile"]); } } } AlertAjaxMessage("提交成功"); }