public int InsertNaghs_Article(CheckOutNaghsDTO oNaghs)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = _conn;
            cmd.CommandText = "Request.[SP_InsertNaghsArticle]";
            cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Parameters.AddWithValue("@StudentRequestID", oNaghs.StudentRequestId);
            cmd.Parameters.AddWithValue("@stcode", oNaghs.StCode);
            //  cmd.Parameters.AddWithValue("@Erae_Be", oNaghs.Erae_Be);
            cmd.Parameters.AddWithValue("@RequestLogID", oNaghs.RequestLogId);
            cmd.Parameters.AddWithValue("@SubmitDate", oNaghs.SubmitDate);
            cmd.Parameters.AddWithValue("@NaghsMessage", oNaghs.NaghsMessage);
            cmd.Parameters.AddWithValue("@ResolveDate", oNaghs.ResolveDate);
            cmd.Parameters.AddWithValue("@ResolveMessage", oNaghs.ResolveMessage);
            int naghsId = 0;
            var dt      = new DataTable();

            try
            {
                _conn.Open();
                var rd = cmd.ExecuteReader();
                dt.Load(rd);
                naghsId = Convert.ToInt32(dt.Rows[0][0]);
                _conn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            return(naghsId);
        }
        public int InsertOdat(CheckOutNaghsDTO oNaghs)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = _conn;
            cmd.CommandText = "Request.[SP_InsertOdatAndUpdateReq]";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@StudentRequestID", oNaghs.StudentRequestId);
            cmd.Parameters.AddWithValue("@stcode", oNaghs.StCode);
            cmd.Parameters.AddWithValue("@Erae_Be", oNaghs.Erae_Be);
            cmd.Parameters.AddWithValue("@RequestLogID", oNaghs.RequestLogId);
            cmd.Parameters.AddWithValue("@SubmitDate", oNaghs.SubmitDate);
            cmd.Parameters.AddWithValue("@NaghsMessage", oNaghs.NaghsMessage);
            cmd.Parameters.AddWithValue("@ResolveDate", oNaghs.ResolveDate);
            cmd.Parameters.AddWithValue("@ResolveMessage", oNaghs.ResolveMessage);
            int naghsId = 0;

            try
            {
                _conn.Open();
                naghsId = Convert.ToInt32(cmd.ExecuteScalar());
                _conn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            return(naghsId);
        }
        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 = "علت نقص پرونده را ذکر کنید... ";
            }
        }
Example #4
0
 public int InsertNaghs(CheckOutNaghsDTO oNaghs)
 {
     return(_naghsDAO.InsertNaghs(oNaghs));
 }
Example #5
0
 public int InsertNaghs_Article(CheckOutNaghsDTO oNaghs)
 {
     return(_naghsDAO.InsertNaghs_Article(oNaghs));
 }