protected void grdNaghs1_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "Delete") { string naghsId = (e.Item as GridDataItem).GetDataKeyValue("NaghsId").ToString(); CheckOutNaghsBusiness NaghsBus = new CheckOutNaghsBusiness(); var RequestLogId = ((int)CheckOutStatusEnum.FareghReqStatus.vrood_moavenat_ok); var Erae_be = ((int)CheckOutStatusEnum.FareghReqStatus.ersal_sodoor_ok); var stcode = ViewState["stNaghs"].ToString(); //int count = NaghsBus.DeleteNaghs(Convert.ToInt32(naghsId), Convert.ToInt32(Erae_be), Convert.ToInt32(RequestLogId), Convert.ToInt32(ViewState["reqId"])); } }
private void LoadRadWindowNaghs(string StudentRequestId, string stcode) { ViewState.Add("reqId", StudentRequestId); ViewState.Add("stNaghs", stcode); CheckOutNaghsBusiness NaghsBusiness = new CheckOutNaghsBusiness(); DataTable dtNaghs = NaghsBusiness.GetAllNaghsByReqId(Convert.ToInt32(StudentRequestId)); grdNaghs1.DataSource = dtNaghs; grdNaghs1.DataBind(); string scrp5 = "function f(){$find(\"" + RadWindowNaghs.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"; ScriptManager.RegisterStartupScript(this.Page, GetType(), ClientID, scrp5, true); }
protected void btnSubmitNaghs_Click(object sender, EventArgs e) { if (txtNaghsDescription.Text != "") { CheckOutNaghsDTO oNaghs = new CheckOutNaghsDTO(); CheckOutNaghsBusiness NaghsBus = new CheckOutNaghsBusiness(); oNaghs.StudentRequestId = Convert.ToInt32(ViewState["reqId"]); oNaghs.StCode = ViewState["stNaghs"].ToString(); oNaghs.RequestLogId = ((int)CheckOutStatusEnum.FareghReqStatus.end); oNaghs.Erae_Be = ((int)CheckOutStatusEnum.FareghReqStatus.end).ToString(); oNaghs.SubmitDate = DateTime.Now.ToPeString(); oNaghs.NaghsMessage = "نقص: " + txtNaghsDescription.Text; int id = NaghsBus.InsertOdat(oNaghs); var userID = Session[sessionNames.userID_Karbar].ToString(); business.SendOdatMessageAndInsertOdatLog(userID, oNaghs.StudentRequestId, oNaghs.NaghsMessage); if (id > 0) { lblNaghsMessage.Text = "نقص پرونده با موفقیت درج شد."; txtNaghsDescription.Text = ""; // ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "Close();", true); } else { lblNaghsMessage.Text = "خطا در درج نقص ! لطفا مجددا تلاش کنید یا با مدیر سامانه تماس بگیرید.."; } LoadRadWindowNaghs(oNaghs.StudentRequestId.ToString(), oNaghs.StCode); txtNaghsDescription.Text = ""; // btnSubmitMsg.Enabled = false; // this.btnSubmitMsg.Enabled = false; // BindData(Convert.ToInt32(drpUserRoles.SelectedItem.Value), false); } else { RadWindowManager1.RadAlert("علت نقص پرونده را ذکر کنید... ", 300, 100, "پیام سیستم", ""); // lblNaghsMessage.Text = "علت نقص پرونده را ذکر کنید... "; } }