protected void Save_Click(object sender, EventArgs e) { string Thaotac = string.Empty; this.Page.Validate(vs_Themmoi.ValidationGroup); if (!Page.IsValid) { return; } if (txt_tencongviec.Text.Trim() == "") { FuncAlert.AlertJS(this, "bạn chưa nhập tên công việc"); return; } if (txt_NoidungCV.Text.Trim() == "") { FuncAlert.AlertJS(this, "bạn chưa nhập nội dung công việc"); return; } if (txt_NgayHT.Text.Trim() == "") { FuncAlert.AlertJS(this, "bạn chưa nhập ngày hoàn thành công việc"); return; } CongviecDAL _cvDAL = new CongviecDAL(); T_Congviec _cv = SetItem(); double _return = _cvDAL.InsertT_Congviec(_cv); if (_Filename.Length > 0 && _FileExt.Length > 0) { Uploadfile(_Pathfolder, _Filename, _FileExt); } if (Page.Request.Params["id"] == null) { Thaotac = "[Thêm mới công việc]-->[mã CV:" + _return.ToString() + " ]"; } if (Page.Request.Params["id"] != null) { Thaotac = "[Sửa công việc]-->[Mã CV:" + Page.Request["id"].ToString() + " ]"; } UltilFunc.Log_Action(_user.UserID, _user.UserFullName, DateTime.Now, int.Parse(Request["Menu_ID"]), Thaotac); Page.Response.Redirect("~/Congviec/EditCongviec.aspx?Menu_ID=" + Request["Menu_ID"].ToString() + "&ID=" + _return + "&Tab=1"); }
protected void Save_Click() { int Menu_ID = 0; string NoiDung = string.Empty; string SoTu = string.Empty; string NgayHT = string.Empty; string NguoiNhan = string.Empty; string tieudecv = string.Empty; string ip = string.Empty; try { System.Globalization.CultureInfo mProvider = new System.Globalization.CultureInfo("en-US", false); if (mContext.Request.QueryString["mn_id"] != "undefined") { Menu_ID = int.Parse(mContext.Request.QueryString["mn_id"], mProvider); } if (mContext.Request.QueryString["nguoinhan"] != "undefined") { NguoiNhan = mContext.Request.QueryString["nguoinhan"].ToString(); } if (mContext.Request.QueryString["tieudecv"] != "undefined") { tieudecv = mContext.Request.QueryString["tieudecv"].ToString(); } if (mContext.Request.QueryString["noidung"] != "undefined") { NoiDung = mContext.Request.QueryString["noidung"].ToString(); } if (mContext.Request.QueryString["sotu"] != "undefined") { SoTu = mContext.Request.QueryString["sotu"].ToString(); } if (mContext.Request.QueryString["ngayht"] != "undefined") { NgayHT = mContext.Request.QueryString["ngayht"].ToString(); } if (mContext.Request.QueryString["ip"] != "undefined") { ip = mContext.Request.QueryString["ip"].ToString(); } HPCBusinessLogic.NguoidungDAL _NguoidungDAL = new NguoidungDAL(); T_Users _user; T_RolePermission _Role = null; _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name); _Role = _NguoidungDAL.GetRole4UserMenu(_user.UserID, Menu_ID); #region GhiLog Lichsu_Thaotac_HethongDAL actionDAL = new Lichsu_Thaotac_HethongDAL(); T_Lichsu_Thaotac_Hethong action = new T_Lichsu_Thaotac_Hethong(); action.Ma_Nguoidung = _user.UserID; action.TenDaydu = _user.UserFullName; action.HostIP = ip; action.NgayThaotac = DateTime.Now; #endregion CongviecDAL _cvDAL = new CongviecDAL(); T_Congviec _cv = SetItem(NoiDung, SoTu, NgayHT, NguoiNhan, tieudecv); double _return = _cvDAL.InsertT_Congviec(_cv); action.Thaotac = "[Thêm mới công việc]-->[mã công việc:" + _return.ToString() + " ]"; actionDAL.InserT_Lichsu_Thaotac_Hethong(action); mContext.Response.Write("1"); } catch { mContext.Response.Write("0"); } }