From 24ac6e50da797cc3372f67f346618be86b86c4d1 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 21 十一月 2025 15:06:15 +0800
Subject: [PATCH] 提交
---
CY_ECommercePlatform/CY.WebForm/Pages/work/GongzuoneirongEdit.aspx.cs | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 201 insertions(+), 0 deletions(-)
diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/work/GongzuoneirongEdit.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/work/GongzuoneirongEdit.aspx.cs
new file mode 100644
index 0000000..9bf971d
--- /dev/null
+++ b/CY_ECommercePlatform/CY.WebForm/Pages/work/GongzuoneirongEdit.aspx.cs
@@ -0,0 +1,201 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Data;
+using System.Data.SqlClient;
+using CY.Model;
+using CY.BLL;
+using CY.Infrastructure.Common;
+using CY.BLL.Sys;
+using CY.BLL.EC;
+using CY.Infrastructure.DESEncrypt;
+using CY.Infrastructure.Query;
+
+namespace CY.WebForm.Pages.work
+{
+ //鍚磋緣
+ //琛屾斂鐗╁搧
+ public partial class GongzuoneirongEdit : BasePage
+ {
+ OA_GongzuoneirongBLL bll_OA_GongzuoneirongBLL = null;
+ OA_StaffBLL bll_OA_StaffBLL = null;
+ OA_DepartmentBll bll_OA_DepartmentBll = null;
+
+ public GongzuoneirongEdit()
+ {
+ bll_OA_GongzuoneirongBLL = new OA_GongzuoneirongBLL();
+ bll_OA_StaffBLL = new OA_StaffBLL();
+ bll_OA_DepartmentBll = new OA_DepartmentBll();
+ }
+
+ //椤甸潰鍔犺浇
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ try
+ {
+ switch (Request["Target"])
+ {
+
+ case "change":
+ Response.Write(reLoadAccountName(Request["TypeName"].ToString2()));
+ break;
+
+
+ default:
+ if (!IsPostBack)
+ {
+
+ this.selCateId.DataSource = bll_OA_GongzuoneirongBLL.GetDataByType(CurrentUser.MemberId);
+ this.selCateId.DataTextField = "Name";
+ this.selCateId.DataValueField = "Keyid";
+ this.selCateId.DataBind();
+ this.selCateId.Items.Insert(0, new ListItem("璇烽�夋嫨", ""));
+ this.selCateId.Value = "";
+
+ this.selZerenren.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, null, null);
+ this.selZerenren.DataTextField = "Name";
+ this.selZerenren.DataValueField = "Keyid";
+ this.selZerenren.DataBind();
+ //this.selZerenren.Items.Insert(0, new ListItem("鍏ㄩ儴", ""));
+ //this.selZerenren.Value = "";
+
+ Pagination pa = new Pagination();
+ pa.PageSize = 500;
+ pa.PageIndex = 1;
+ this.selBumen.DataSource = bll_OA_DepartmentBll.SelectModelPage(pa, CurrentUser.MemberId, "", "鍚敤");
+ this.selBumen.DataTextField = "Name";
+ this.selBumen.DataValueField = "Keyid";
+ this.selBumen.DataBind();
+ this.selBumen.Items.Insert(0, new ListItem("鍏ㄩ儴", ""));
+ this.selBumen.Value = "";
+
+ InitData();
+ }
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ PAGEHandleException(ex);
+ Response.Clear();
+ //Response.Write("-1");
+ Response.Write(ex.Message);
+ }
+ Response.End();
+
+
+
+ }
+
+ //鏁版嵁鍔犺浇
+ public void InitData()
+ {
+ OA_Gongzuoneirong m_OA_Gongzuoneirong = bll_OA_GongzuoneirongBLL.GetModelByKeyid(Request["keyid"].ToInt32());
+ if (m_OA_Gongzuoneirong != null)
+ {
+
+ this.txtCarNumbera.Value = m_OA_Gongzuoneirong.Gongzuozhize;
+
+ this.selZerenren.Value = m_OA_Gongzuoneirong.Zerenren.HasValue? m_OA_Gongzuoneirong.Zerenren.ToString():"";
+ }
+
+ }
+
+ //琛ㄥ崟鎻愪氦
+ protected void btn_submit_form(object sender, EventArgs e)
+ {
+ try
+ {
+ //if (string.IsNullOrEmpty(this.txtAllNum.Value) || string.IsNullOrEmpty(this.txtReceiveNum.Value))
+ //{
+ // JavaScript.MessageBox("鐗╁搧鎬绘暟閲忓拰宸查鍙栨暟閲忓潎涓嶈兘涓虹┖", this);
+ // return;
+ //}
+
+ //if (this.txtAllNum.Value.ToInt32() < this.txtReceiveNum.Value.ToInt32())
+ //{
+ // JavaScript.MessageBox("宸查鍙栨暟閲忎笉鑳藉ぇ浜庢�绘暟閲�",this);
+ // return;
+ //}
+
+ DateTime nowTime = DateTime.Now;
+ OA_Gongzuoneirong m_OA_Gongzuoneirong = bll_OA_GongzuoneirongBLL.GetModelByKeyid(Request["keyid"].ToInt32());
+ if (m_OA_Gongzuoneirong == null)
+ {
+ m_OA_Gongzuoneirong = new OA_Gongzuoneirong();
+ m_OA_Gongzuoneirong.MemberId = CurrentUser.MemberId;
+
+
+ }
+
+ m_OA_Gongzuoneirong.Gongzuozhize = this.txtCarNumbera.Value;
+
+
+ m_OA_Gongzuoneirong.Zerenren = this.selZerenren.Value.ToInt32();
+ var a_Staff = bll_OA_StaffBLL.GetModelByKeyid(m_OA_Gongzuoneirong.Zerenren);
+ if (a_Staff != null)
+ {
+ m_OA_Gongzuoneirong.ZerenrenName = a_Staff.Name;
+ }
+ else
+ {
+ m_OA_Gongzuoneirong.ZerenrenName = "";
+ }
+
+ m_OA_Gongzuoneirong.Updator = CurrentUser.ShortName;
+ m_OA_Gongzuoneirong.LastUpdateTime = nowTime;
+
+
+ if (Request["keyid"].ToInt32() > 0)
+ {
+ if (bll_OA_GongzuoneirongBLL.UpdateModel(m_OA_Gongzuoneirong))
+ {
+ JavaScript.MessageBox("鏇存柊鎴愬姛", this, true, true);
+ }
+
+ else
+ JavaScript.MessageBox("鏇存柊澶辫触", this);
+ }
+ else
+ {
+ m_OA_Gongzuoneirong.Creator = CurrentUser.ShortName;
+ m_OA_Gongzuoneirong.CreateTime = nowTime;
+ if (bll_OA_GongzuoneirongBLL.InsertModel(m_OA_Gongzuoneirong))
+ {
+ this.txtCarNumbera.Value="";
+ this.selCateId.Value = "";
+ JavaScript.MessageBox("鏂板鎴愬姛", this, false, true);
+ }
+
+ else
+ JavaScript.MessageBox("鎿嶄綔澶辫触", this);
+ }
+ }
+ catch (Exception ex)
+ {
+ PAGEHandleException(ex);
+ JavaScript.MessageBox("鎿嶄綔澶辫触", this);
+ }
+ }
+
+
+ protected string reLoadAccountName(string selAcoountType)
+ {
+
+ if (!string.IsNullOrEmpty(selAcoountType))
+ {
+ return JsonHelper.GetJsonStringByObject(bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId,false,false).Where(x => x.DepartmentId == selAcoountType.ToInt32()));
+ }
+ else
+ {
+ return JsonHelper.GetJsonStringByObject(bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, false));
+ }
+
+
+ }
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.1