public static STD_QuestionType GetSTD_QuestionTypeByQuestionTypeID(int QuestionTypeID) { STD_QuestionType sTD_QuestionType = new STD_QuestionType(); SqlSTD_QuestionTypeProvider sqlSTD_QuestionTypeProvider = new SqlSTD_QuestionTypeProvider(); sTD_QuestionType = sqlSTD_QuestionTypeProvider.GetSTD_QuestionTypeByQuestionTypeID(QuestionTypeID); return sTD_QuestionType; }
private void showSTD_QuestionTypeData() { STD_QuestionType sTD_QuestionType = new STD_QuestionType (); sTD_QuestionType = STD_QuestionTypeManager.GetSTD_QuestionTypeByQuestionTypeID(Int32.Parse(Request.QueryString["ID"])); txtQuestionTypeName.Text =sTD_QuestionType.QuestionTypeName.ToString(); string txtUpdatedBy_Text =sTD_QuestionType.UpdatedBy.ToString(); string txtUpdateDate_Text =sTD_QuestionType.UpdateDate.ToString(); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { STD_QuestionType sTD_QuestionType = new STD_QuestionType (); sTD_QuestionType.QuestionTypeID= int.Parse(Request.QueryString["ID"].ToString()); sTD_QuestionType.QuestionTypeName= txtQuestionTypeName.Text; sTD_QuestionType.AddedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; sTD_QuestionType.AddedDate= DateTime.Now; sTD_QuestionType.UpdatedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; sTD_QuestionType.UpdateDate = DateTime.Now; bool resutl =STD_QuestionTypeManager.UpdateSTD_QuestionType(sTD_QuestionType); }catch(Exception ex){}Response.Redirect("AdminDisplaySTD_QuestionType.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { try { STD_QuestionType sTD_QuestionType = new STD_QuestionType (); // sTD_QuestionType.QuestionTypeID= int.Parse(ddlQuestionTypeID.SelectedValue); sTD_QuestionType.QuestionTypeName= txtQuestionTypeName.Text; sTD_QuestionType.AddedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; sTD_QuestionType.AddedDate= DateTime.Now; sTD_QuestionType.UpdatedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; sTD_QuestionType.UpdateDate = DateTime.Now; int resutl =STD_QuestionTypeManager.InsertSTD_QuestionType(sTD_QuestionType); }catch(Exception ex){}Response.Redirect("AdminDisplaySTD_QuestionType.aspx"); }
public static bool UpdateSTD_QuestionType(STD_QuestionType sTD_QuestionType) { SqlSTD_QuestionTypeProvider sqlSTD_QuestionTypeProvider = new SqlSTD_QuestionTypeProvider(); return sqlSTD_QuestionTypeProvider.UpdateSTD_QuestionType(sTD_QuestionType); }
public static int InsertSTD_QuestionType(STD_QuestionType sTD_QuestionType) { SqlSTD_QuestionTypeProvider sqlSTD_QuestionTypeProvider = new SqlSTD_QuestionTypeProvider(); return sqlSTD_QuestionTypeProvider.InsertSTD_QuestionType(sTD_QuestionType); }
public bool UpdateSTD_QuestionType(STD_QuestionType sTD_QuestionType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateSTD_QuestionType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@QuestionTypeID", SqlDbType.Int).Value = sTD_QuestionType.QuestionTypeID; cmd.Parameters.Add("@QuestionTypeName", SqlDbType.NVarChar).Value = sTD_QuestionType.QuestionTypeName; //cmd.Parameters.Add("@QuestionTypeName", SqlDbType.NVarChar).Value = sTD_QuestionType.QuestionTypeName; //cmd.Parameters.Add("@QuestionTypeName", SqlDbType.NVarChar).Value = sTD_QuestionType.QuestionTypeName; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_QuestionType.UpdatedBy; cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = sTD_QuestionType.UpdateDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public int InsertSTD_QuestionType(STD_QuestionType sTD_QuestionType) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("InsertSTD_QuestionType", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@QuestionTypeID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@QuestionTypeName", SqlDbType.NVarChar).Value = sTD_QuestionType.QuestionTypeName; cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = sTD_QuestionType.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_QuestionType.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_QuestionType.UpdatedBy; cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = sTD_QuestionType.UpdateDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@QuestionTypeID"].Value; } }
public STD_QuestionType GetSTD_QuestionTypeFromReader(IDataReader reader) { try { STD_QuestionType sTD_QuestionType = new STD_QuestionType ( DataAccessObject.IsNULL<int>(reader["QuestionTypeID"]), DataAccessObject.IsNULL<string>(reader["QuestionTypeName"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"]) ); return sTD_QuestionType; } catch(Exception ex) { return null; } }