internal int SaveProcess2(DoctorsProcess2 dp2) { try { connection.Open(); command = new SqlCommand("sp_DoctorProcess2", connection); command.Parameters.Add("@birthDate", SqlDbType.NVarChar).Value = dp2.BirthDate; command.Parameters.Add("@nId", SqlDbType.NVarChar).Value = dp2.NId; command.Parameters.Add("@category", SqlDbType.NVarChar).Value = dp2.Category; command.Parameters.Add("@designation", SqlDbType.NVarChar).Value = dp2.Designation; command.Parameters.Add("@about", SqlDbType.NVarChar).Value = dp2.BmdcNo; command.Parameters.Add("@bmdcNo", SqlDbType.NVarChar).Value = dp2.About; command.Parameters.Add("@country", SqlDbType.NVarChar).Value = dp2.Country; command.Parameters.Add("@district", SqlDbType.NVarChar).Value = dp2.District; command.Parameters.Add("@cityOrVillage", SqlDbType.NVarChar).Value = dp2.CityOrVillage; command.Parameters.Add("@DocPassword", SqlDbType.NVarChar).Value = dp2.Password; command.Parameters.Add("@doctorEmail", SqlDbType.NVarChar).Value = dp2.DoctorEmail; command.Parameters.Add("@photo", SqlDbType.NVarChar).Value = dp2.Photo; command.CommandType = CommandType.StoredProcedure; row = command.ExecuteNonQuery(); } finally { connection.Close(); } return(row); }
protected void btnProcess2_Click(object sender, EventArgs e) { DoctorsProcess2 dp2 = new DoctorsProcess2(); if (!string.IsNullOrEmpty(txtDateOfBirth.Text) || !string.IsNullOrEmpty(txtBmdcNo.Text) || !string.IsNullOrEmpty(ddlDoctorCategory.SelectedValue)) { dp2.BirthDate = txtDateOfBirth.Text; dp2.NId = txtNid.Text.Trim(); dp2.Category = ddlDoctorCategory.SelectedValue; dp2.Designation = txtDesignation.Text; dp2.BmdcNo = txtBmdcNo.Text.Trim(); dp2.About = txtAbout.Text; dp2.Country = txtCountry.Text; dp2.District = txtDistrict.Text; dp2.CityOrVillage = txtCity.Text; dp2.Password = txtPassword.Text.Trim(); dp2.DoctorEmail = Session["DoctorEmail"].ToString(); var basePath = Server.MapPath("~/Images"); var rowFile = _dpManager.CountImageRow(); var fileName = string.Format("{0:00000000}_{1}", rowFile, doctorPhotoUpload.FileName); var filePath = System.IO.Path.Combine(basePath, fileName); dp2.Photo = Path.Combine("/Images", fileName); var selectedPhoto = doctorPhotoUpload; selectedPhoto.SaveAs(filePath); int rowCount = _dpManager.SaveProcess2(dp2); if (rowCount > 0) { Response.Redirect("DoctorProcess3.aspx"); return; } } else { lblMessage.Text = "Field cannot Be Empty."; } }
internal int SaveProcess2(DoctorsProcess2 dp2) { return(_dpGateway.SaveProcess2(dp2)); }